-->
Page 1 of 3

NTP + RTC (internal) library / example

PostPosted: Fri May 18, 2018 9:59 pm
by µrt
Hi,

Is there any library that integrates NTP and ESP8266 internal RTC? What I mean is that instead of sending NTP / UDP requests so often, we sync the NTP time to native RTC and sync the RTC with NTP every hour. This will keep the time accuracy pretty tight and keep the power needed for wifi pretty low.

Although I have read a lot of posts on internal RTC but not have been able to understand it.

Thanks.

Re: NTP + RTC (internal) library / example

PostPosted: Sat May 19, 2018 1:40 am
by Pablo2048

Re: NTP + RTC (internal) library / example

PostPosted: Sat May 19, 2018 4:07 am
by schufti
a) this example is .... minimalstic and misleading as it does not take advantage of the automated dst rules possible with new clib; fixed dst offset w/o rules is nonsense.
b) there is no (hw) rtc in esp8266

Re: NTP + RTC (internal) library / example

PostPosted: Sat May 19, 2018 5:44 am
by Pablo2048
Ugh, you are right Schufti - i'm using this:
settimeofday_cb(ntp_time_set);
configTime(0, 0, cfg->server);
setenv("TZ", (const char *)cfg->zone, 1);
tzset();
and Ii tought that it come from this example. Sorry for missleading...