NTPClient icon indicating copy to clipboard operation
NTPClient copied to clipboard

isTimeSet() does not reset when update fail

Open MGMehdi opened this issue 2 years ago • 1 comments

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");
    }
}

MGMehdi avatar Jul 27 '22 12:07 MGMehdi

The same occur if I do this

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

Or use forceUpdate()

MGMehdi avatar Jul 27 '22 14:07 MGMehdi