Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By nigelbe
#16466 I'm looking to make a second perfect digital clock.

I've got one going using DayTime protocol (port 13) from my network which I can poll every second or so. Also I have a NTP client running in another sketch.

I'd really like to use NTP for the clock but it requires you to keep time in software between calls to the NTP server.

Any ideas welcome,

Nigel.
User avatar
By jra
#16472 +1 the Time library. The version from https://www.pjrc.com/teensy/td_libs_Time.html works with the NTPClient.ino example distributed with https://github.com/esp8266/Arduino. Once you obtain a precise value for the time, set the local clock via setTime(epoch) and then check it after an hour, 24 hours, etc. to see how much your local clock drifts. That will give you an indication how often you need to resync.