jedie wrote: ↑
Mon Dec 16, 2019 4:36 pm
MostlyHarmless wrote: ↑
Tue Dec 10, 2019 2:30 am
completely ignores fractional seconds,
The RTC on the ESP8266 (Maybe on other board, too?) is totally inaccurate. That's why i think the precision of ntp sync is totally sufficient.
Or do i see it wrong?
If you only intend to sync the internal clock at boot time and leave it at that, then that is certainly true.
I didn't measure an ESP8266 yet, but the ESP32 I have on the desk right now is gaining 37us per second on average. "inaccurate" is one word for that. I believe that micropython on the ESP32 is using one of the 8MHz XTAL based clock sources by default. Switching to the internal 150kHz oscillator makes things worse.
The ESP32 at least implements adjtime(3) (see viewtopic.php?f=18&t=7403
). With that I can keep the internal clock accurate enough for my taste. A maximum difference of 370us is good enough for me, considering that a single threaded system using uasyncio cannot guarantee sub millisecond scheduling of tasks anyway.
So now that I can sync the thing to a DS3231 within less than a millisecond, I want better precision than 1 second from NTP. I'm working on that.