How does the clock in this example work?
Hardware implementation in ESP32 or software library?
How often do you need to sync them?
Where can you find out more about this?
My understanding is that the ESP32 has an internal RTC but it’s not very accurate with frequency error of about 5%. With an external 32k crystal the error will be determined by the crystal, usually about 20-30ppm. The de facto standard in the industry for crystal inaccuracy is 20ppm. You can also express ppm as a percentage: ±20/1,000,000 = ±0.002%. So after 30 days (2,592,000 seconds) we can expect the clock to drift about ±52 seconds; after 60 days about ±104 seconds, and so on.
Basically if you are using the internal RTC without an external crystal you would need to sync frequently to keep accuracy. With an external crystal you can sync a lot less.
Thank you so much for your answer, Steve 🙂
I wouldn’t explain it better.
With a little more research on this it appears just adding a crystal can be more complex as you would need to recompile the base ESP32 system. I’m thinking a better idea would be to use an external high accuracy DS3231sn module with crystal and backup battery. These have an error of about 2ppm. That way you can just use a library.