coreSNTP vs NTPDemo

Good day,

I think this question is mostly referred to Hein. Was wondering if you could briefly explain the differences/benefits/drawbacks of your NTPDemo Hein/NTP compared to the full CoreSNTP.

I’m about to implement an NTP client on a new device, and it would be useful to help me decide which way I want to go.

Thank You!
Pilot

Tagging @htibosch as the question is for him.

I wrote NTPDemo in order to have a test for UDP packets traveling through the Internet:

  • Find an endpoint that has a gateway to the Internet.
  • Lookup a time server like e.g. “0.europe.pool.ntp.org”, using DNS.
  • When the address is found: send a UDP packet with a time request.
  • When the answer comes in, use it to set the running clock.

I use NTP in simple applications like home appliances, such as a sound system with a HH:MM clock.
If you want a more precise estimate of “the real time”, you better use SNTP.

I would never use NTP to measure time differences: they can be measured more accurately using a hardware timer/counter, or by reading xTaskGetTickCount().

2 Likes