mirror of https://github.com/arendst/Tasmota.git
Try next NTP server on error
This commit is contained in:
parent
e891c4e490
commit
d60b69a712
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue