NTP server is used from configuration setting
This commit is contained in:
parent
e0de8dabe8
commit
89070806f7
@ -399,9 +399,11 @@ void onHomieEvent(const HomieEvent& event) {
|
|||||||
Homie.getLogger() << "My statistics" << endl;
|
Homie.getLogger() << "My statistics" << endl;
|
||||||
break;
|
break;
|
||||||
case HomieEventType::MQTT_READY:
|
case HomieEventType::MQTT_READY:
|
||||||
|
Serial.printf("NTP Setup with server %s\r\n", ntpServer.get());
|
||||||
|
configTime(0, 0, ntpServer.get());
|
||||||
//wait for rtc sync?
|
//wait for rtc sync?
|
||||||
rtcDeepSleepTime = deepSleepTime.get();
|
rtcDeepSleepTime = deepSleepTime.get();
|
||||||
Serial << "MQTT ready " << endl;
|
Serial << "Setup plants" << endl;
|
||||||
for(int i=0; i < MAX_PLANTS; i++) {
|
for(int i=0; i < MAX_PLANTS; i++) {
|
||||||
mPlants[i].postMQTTconnection();
|
mPlants[i].postMQTTconnection();
|
||||||
}
|
}
|
||||||
@ -510,8 +512,6 @@ void systemInit(){
|
|||||||
//Homie.disableLogging();
|
//Homie.disableLogging();
|
||||||
Homie.setup();
|
Homie.setup();
|
||||||
|
|
||||||
configTime(0, 0, ntpServer.get());
|
|
||||||
|
|
||||||
mConfigured = Homie.isConfigured();
|
mConfigured = Homie.isConfigured();
|
||||||
if (mConfigured) {
|
if (mConfigured) {
|
||||||
for(int i=0; i < MAX_PLANTS; i++) {
|
for(int i=0; i < MAX_PLANTS; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user