arduino-libraries / NTPClient

Connect to a NTP server
533 stars 366 forks source link

isTimeSet() does not reset when update fail #175

Open KianoJ opened 1 year ago

KianoJ commented 1 year ago

Hello

When I check if the Arduino success to update the date, if I disconnect the cable, isTimeSet() does not return false


void loop(){
    timeClient.update();
    if (timeClient.isTimeSet())
    {
        Serial.println("Updated");
    }
    else
    {
        Serial.println("Not updated");
    }
}
KianoJ commented 1 year ago

The same occur if I do this

void loop(){
    if (timeClient.update())
    {
        Serial.println("Updated");
    }
    else
    {
        Serial.println("Not updated");
    }
}

Or use forceUpdate()