From 7d7df040366af56b32f828c210e1432813872f4a Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Fri, 9 Aug 2019 18:45:13 +0200 Subject: [PATCH] remove Serial.print --- src/network/XD0MQTT.cpp | 8 ++++---- src/network/XD0OTA.cpp | 8 +++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/network/XD0MQTT.cpp b/src/network/XD0MQTT.cpp index 8b1e7e1..a323d77 100644 --- a/src/network/XD0MQTT.cpp +++ b/src/network/XD0MQTT.cpp @@ -106,10 +106,10 @@ bool XD0MQTT::begin(void) { mqtt_cfg.password = MQTT_PASSWORD; mqtt_cfg.user_context = (void*)this; - ESP_LOGI(TAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size()); - Serial.printf("BROKER URI: %s\n", MQTT_BROKER_URI); - Serial.printf("MQTT USERNAME: %s\n", MQTT_USERNAME); - Serial.printf("MQTT PASSWORD: %s\n", MQTT_PASSWORD); + ESP_LOGD(TAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size()); + ESP_LOGI(TAG, "BROKER URI: %s\n", MQTT_BROKER_URI); + ESP_LOGI(TAG, "MQTT USERNAME: %s\n", MQTT_USERNAME); + ESP_LOGI(TAG, "MQTT PASSWORD: %s\n", MQTT_PASSWORD); client = esp_mqtt_client_init(&mqtt_cfg); //esp_mqtt_client_register_event(client, ESP_EVENT_ANY_ID, mqtt_event_handler, client); esp_mqtt_client_start(client); diff --git a/src/network/XD0OTA.cpp b/src/network/XD0OTA.cpp index ef5ca85..32ab5f6 100644 --- a/src/network/XD0OTA.cpp +++ b/src/network/XD0OTA.cpp @@ -16,23 +16,21 @@ XD0OTA::XD0OTA(String deviceName) : deviceName{deviceName} {} void XD0OTA::setClock() { configTime(0, 0, "de.pool.ntp.org", "time.nist.gov"); // UTC - Serial.print(F("Waiting for NTP time sync: ")); + ESP_LOGI(TAG, "Waiting for NTP time sync: "); time_t now = time(nullptr); int tries = 0; while (now < 8 * 3600 * 2) { yield(); delay(500); - Serial.print(F(".")); + ESP_LOGI(TAG, "."); now = time(nullptr); tries++; if (tries>15) return; } - Serial.println(F("")); struct tm timeinfo; gmtime_r(&now, &timeinfo); - Serial.print(F("Current time: ")); - Serial.print(asctime(&timeinfo)); + ESP_LOGI(TAG, "Current time: %s", asctime(&timeinfo)); // setenv("TZ", "CET-1CEST,M3.5.0/2,M10.5.0/3", 1); // tzset();