-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect time on WiFi Loss #21
Comments
Example Sketch: #include <ezTime.h>
#include <WiFi.h>
unsigned long previousMillis = 0;
Timezone myTZ;
void setup() {
Serial.begin(115200);
WiFi.begin("xxxxx", "xxxxx");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
setDebug(DEBUG);
waitForSync();
myTZ.setLocation(F("gb"));
myTZ.setDefault();
}
void loop() {
unsigned long currentMillis = millis();
events();
if (currentMillis - previousMillis >= 1000) {
previousMillis = currentMillis;
Serial.println("Time: " + myTZ.dateTime());
}
}
All good until the clock suddenly jumps from 20:19:00 to a future time, seems to then trigger an NTP update (And all events):
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've had a few false triggers on setEvent that appear to be due to datetime being incorrect immediately after a WiFi loss and reconnect. On the next update it's corrected (if WiFi is ok) but all of the days event's are triggered.
I'll write a simplified example (with DEBUG level) and post\test tomorrow and leaving it running. I have a timer doing the following every 10 minutes:
Output Example 1:
Output Example 2:
The text was updated successfully, but these errors were encountered: