Skip to content
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

Espurna fixes + backports #2

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

mcspr
Copy link

@mcspr mcspr commented Jan 6, 2019

  • Check if received timestamp is 0 before converting it to unix ts. Rare case when NTP server hates us, because we are sending too much requests / broken / unsynchronized / does not return correct data / (?) wifiudp returns bad data e.g. ntp timestamp is zero and -70y results in overflow:
>>> datetime.datetime.fromtimestamp((2 ** 32) - 2208988800)
datetime.datetime(2036, 2, 7, 9, 28, 16)

edit:

  • New check for receive and reference timestamps, kind-of sanity check for the NTP server

edit2:
ezTime checks with slightly shorter bitshift. ezTime itself is not here yet, pending some tweaks to make timezone handling more robust. until then - manually tweaking NtpClient

@mcspr
Copy link
Author

mcspr commented Feb 8, 2019

Ping.
Ofc it might be the best idea to actually "vendor" this version inside espurna repo. I think I start to understand ESPEasy / Tasmota way of things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants