-->
Page 1 of 3

Adjust DS3231 with NTP request

PostPosted: Thu Aug 20, 2015 9:23 am
by hugch
Hi all,

here is a sample sketch to update the DS3231 RTC shield with NTP Timestamp.

The sketch use not the RTC library from the Arduino ESP reference page, but in the git repository is a lib available.

The NTP stuff comes from the NTPUpdate example with some modifications and a simple user time zone selection.
Please take a look and post a comment if you are like it or not. :)

Regards,
Kalle

Re: Adjust DS3231 with NTP request

PostPosted: Sat Aug 22, 2015 11:49 am
by mrburnette
@Kalle:

Nice implementation, clean coding style. I may decide to experiment with your implementation.

Also, http://www.pgollor.de/cms/ is very informative, I have bookmarked!

Thanks,

Ray
My projects: https://www.hackster.io/rayburne

Re: Adjust DS3231 with NTP request

PostPosted: Sat Aug 22, 2015 2:59 pm
by hugch
Hi Ray,
thanks for your awesome response.

Best regards,
Kalle

Re: Adjust DS3231 with NTP request

PostPosted: Fri Dec 25, 2015 6:27 am
by bobcroft
Kalle, as others have noted a nice coding style. I have used a slightly modified version of your code on an ESP8266-12E and it works perfectly. However I have one issue and that is that the RTC module does not maintain the time when I turn the power off. It has a battery back up and I'll check the battery but I am baffled why the RTC doesn't retain the correct time.
I was also trying to use the time library and I coded time_t t = epoch; the sketch compiled but I am not certain if that code is correct to put the time into the Time library format. Do you know if that last bit of code is correct.

Thank you.