diff --git a/tasmota/support_wifi.ino b/tasmota/support_wifi.ino index 2b5101174..f16a641fe 100644 --- a/tasmota/support_wifi.ino +++ b/tasmota/support_wifi.ino @@ -819,6 +819,8 @@ uint32_t WifiGetNtp(void) { // Leap-Indicator: unknown (clock unsynchronized) // See: https://github.com/letscontrolit/ESPEasy/issues/2886#issuecomment-586656384 AddLog_P(LOG_LEVEL_DEBUG, PSTR("NTP: IP %s unsynched"), time_server_ip.toString().c_str()); + ntp_server_id++; + if (ntp_server_id > 2) { ntp_server_id = 0; } // Next server next time return 0; } @@ -829,6 +831,8 @@ uint32_t WifiGetNtp(void) { secs_since_1900 |= (uint32_t)packet_buffer[42] << 8; secs_since_1900 |= (uint32_t)packet_buffer[43]; if (0 == secs_since_1900) { // No time stamp received + ntp_server_id++; + if (ntp_server_id > 2) { ntp_server_id = 0; } // Next server next time return 0; } return secs_since_1900 - 2208988800UL;