From 89070806f7c9d3d02ba5806f8d0e125a6b40f7f4 Mon Sep 17 00:00:00 2001 From: Ollo Date: Sun, 1 Nov 2020 20:29:24 +0100 Subject: [PATCH] NTP server is used from configuration setting --- esp32/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 3d88877..33aefdb 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -399,9 +399,11 @@ void onHomieEvent(const HomieEvent& event) { Homie.getLogger() << "My statistics" << endl; break; case HomieEventType::MQTT_READY: + Serial.printf("NTP Setup with server %s\r\n", ntpServer.get()); + configTime(0, 0, ntpServer.get()); //wait for rtc sync? rtcDeepSleepTime = deepSleepTime.get(); - Serial << "MQTT ready " << endl; + Serial << "Setup plants" << endl; for(int i=0; i < MAX_PLANTS; i++) { mPlants[i].postMQTTconnection(); } @@ -484,7 +486,7 @@ bool aliveHandler(const HomieRange& range, const String& value) { } void homieLoop(){ - + } void systemInit(){ @@ -510,8 +512,6 @@ void systemInit(){ //Homie.disableLogging(); Homie.setup(); - configTime(0, 0, ntpServer.get()); - mConfigured = Homie.isConfigured(); if (mConfigured) { for(int i=0; i < MAX_PLANTS; i++) {