-
Notifications
You must be signed in to change notification settings - Fork 14
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
.update() liefert niemals true #21
Comments
Dies liegt unter Umständen daran, dass die Verbindung zum Server abgerissen ist, bzw. die Netzwerkverbindung unterbrochen worden ist. |
I have a similar problem. It keeps time, but after a few hours it updates to a meaningless value (a few days into the future and the time will change as well). Wifi is OK because it runs on my ESP server and responds regularly every second. Tried other timeservers but same problem. Otherwise, the library is great. The question why does it update to a meaningless value after a while? |
Sorry but I didn't know why it happens. |
To add, I modified your logic in ntp.update. If the time until the update has not passed, the function returns -1, if it is kosher it returns true (default), if it is a problem the function returns false. It is precisely because of error catching that if it does not load the correct data, the ESP will get the time from the RTC. However, the problem will be somewhere else, because even with this modification, the wrong time was set, so the update function returned true. I perform a time update once every 10 minutes to local esp time variable |
If you find a final solution can you make a PR? Maybe you log the NTP packets to see if the wrong data comes from the time server. |
I will try to upload a piece of code to the second esp32 connected to a different network (at work) and see if there will be a difference, or the ntp packet log. |
Hi Frank, |
+1 |
i always get ntp status = 0 . even on reboots where mqtt and other stuff connects fine.
on recurring ntp poll a view minutes later i get the time, but status stays 0 ` Starting NTP ... |
Hallo Stefan,
habe Deine NTP-Bibliothek in mein Projekt eingebunden. Danke für Deine Arbeit und die Veröffentlichung. Leider bekomme ich von der Methode .update() niemals true zurück.
Definitionen im Kopf des Sketch:
Im setup() habe ich diesen Code:
Im loop() dieses:
Den Inhalt der Variable letztesNTPUpdate lasse ich mir dann auf einer generierten HTML-Seite vom Webserver, der auf dem ESP läuft anzeigen. Doch auch nach nun einigen Stunden bleibt der Inhalt der Variable letztesNTPUpdate auf dem Stand beim Start des ESP. Anscheinend erhalte ich nie true von .update() zurück. Die gesetzte Uhrzeit im timeClient ist aber korrekt und stimmt +-1 Sekunde mit der "richtigen" Zeit überein.
Wo mache ich einen Fehler?
Grüße
Frank
The text was updated successfully, but these errors were encountered: