-
Notifications
You must be signed in to change notification settings - Fork 92
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
Clock is set to 2036-02-07 about 7:30AM sometimes by sync #25
Comments
Related to #21? |
not sure, I dont think is related to lost WiFi signal (as the esp is in the same room as the AP) and always shifts me to 2036-02-07 about 7:30 when occurs. |
Hmmm, interesting. Thanks for spending the time documenting. I think I only parse an NTP packet if it is valid, but clearly something is wrong there. I will have a look at that code as soon as I have some time. Worst case I can just reject that particular time as invalid so it would retry 5 seconds later, but I'd rather spend a bit more time to figure out what's going on. |
Im happy to spend time to improve something what is worth, also when it helps others to avoid problems... |
I found ezTime very usefull and want to use it in my home automation project. If you need something that can help you to investigate this, Im ready to help / test / etc... |
Hi Ropg,
Now will wait until the issue occurs again and will inform you about the progress. Im also thinking about to add condition into updateNTP function to check the "correction" and update the time only when correction < something_like_1_minute (or configurable) - to avoid stupid updates which shifts the time years ago or ahead. |
First of all I have to say that there was a strong wind yesterday and my internet connection was unstable - because the log I captured yesterday is showing the problem occurred right after there was a problem with connection (in contrast with other logs I captured before, like that in first comment, not showing any problem with connection at all).
So the bad packet was in this case
I read some docs about NTP namely: In that packet there is "stratum" byte (buffer[1]) = 0, there are no timestamps, and the "reference identifier" is "52, 41, 54, 45" means "RATE" in ascii. They both say that reply with "stratum" = 0 (or anything else than 1..15) is not valid, more info about this is in the rfc4330 paragraph "8. The Kiss-o'-Death Packet" So my plan is:
|
First attempt to fix, compiled, logging running.... |
^^^ seems to be running fine, so far not a single "2036-02-07 ...." occurrence |
Added condition checking that data we got from NTP server are valid. ropg#25
Added check that data received from NTP server makes sense. ropg#25
Yes, I plan to release a new version today.
Rop
|
Supposedly fixed (means I haven't tested because I do not see this condition) by merging pull request (thanks Bugerdread) |
Hallo,
I made simple NTP clock using your ezTime library (https://github.com/BugerDread/esp8266-ezTIME-wifi-clock), but I noticed that it sometimes shows wrong time / date randomly. The wrong time / date is always 2036-02-07 about 7:30 (timezone Europe/Prague). So I made a simple sketch sending actual time and ezTime debug data to serial port which I captured to file.
Here is the testing sketch:
Here is the (truncated) log:
It occurs sometimes once / twice a day, randomly, it gets fixed after 10minutes as another sync is performed (as visible in the log above).
What can be source of the problem and how to avoid this?
Ggling around I found https://forum.arduino.cc/index.php?topic=92632.0 - maybe same or simmilar problem?
Ofcourse I can provide you with more info, just let me know...
The text was updated successfully, but these errors were encountered: