Replies: 2 comments
-
There may be a lower level that's running an NTP daemon behind your back. IIRC, PlatformIO sits atop Arduino framework which is atop ESP-IDF. ESP-IDF used LWIP for networking and LWIP can be configured to run the equivalent of ntpd. That call on boot to settimeofday() may have kicked that off for you. If that's indeed configured in and turned on in this build, the projects NDP implementation may be moot. Get the time on system startup or when a user changes it and maybe you're done. I don't think this project cares much about low power modes and going to sleep in one time zone but waking up in another time zone after the DST changeover the day before and such. The Espressif IDF is a pretty fully features "OS" unto itself. |
Beta Was this translation helpful? Give feedback.
-
It was a bug! A float was being added to a double, but the scale of the integer portion was so big that the decimal part was being lost in the float conversion. Fixed in v40 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now I've got NTP checking the time every 30 seconds, just temporarily. And I noticed that the time coming back from the server is ZERO delta from the time on the ESP32 once set.
The code plainly pulls second and MICROSECONDS from the packet, and yet they match the local clock down to the microsecond ever time.
Is it really possible that both NTP and the ESP32's RTC are accurate within one millionth of a second over a 30 second span?
The NTP protocol must be pretty amazing at what it does for this to work as well!
When this code runs, dOld == dNew. They're the same. Every time except the first time!
Beta Was this translation helpful? Give feedback.
All reactions