Close

NTP synchronization

A project log for Home security

Home security project based on atmega and ardunio. MQTT gateway for data gathering.

vysocan76vysocan76 10/03/2014 at 13:400 Comments

There is RTC circuit on the main board which is battery backed up. But it lacked the feature to set the correct time other then the compilation. As it has drifted a minute a month, or so, I guessed it is right time to make it synchronized with some NTP server.

I have put a button on the home page of the interface to get the correct time, as well as letting the service thread synchronize time when it starts.

It took me some hours to combine some examples on the net into working code, that I think is a bit optimised, and also working with the rest of threads and web-service. The changes are pushed to Git Hub.

On the Arduino forum is a good post about choosing the right NTP server, which is a valuable resource to read. Especialy the attached link to Flawed Routers Flood University of Wisconsin Internet Time Server.

Discussions