B4R Question ESP8266: TimeNIST + RTC timer + DeepSleep ~ clock

peacemaker

Expert
Licensed User
Longtime User
HI, All

Is it possible to have not-super-sharp-clock using TimeNIST (get time, say, one time per week) and RTC timer and memory to calculate the current time after DeepSleep ?
Experimenting with RTC-memory read-write i found that "RTC time" from system_get_rtc_time() function after returning from DeepSleep is always Get rtc time around values of 12000......16000.
I cannot understand - if the module is power up, but use DeepSleep periodically - the RTC timer should go on all the time, and return bigger values ...
Or i do not understand something... how to use correctly DeepSleep and calculate time of this sleeping ?
 

peacemaker

Expert
Licensed User
Longtime User
But why RTC time after DeepSleep is not proportionally bigger than before ? No more than ~16000.
I guessed, it should tick all the time while powered up. And if 1 min in DeepSleep - after resume the value should be > 60 seconds
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Hmmm, yes, as in those example, how another, most of native functions in B4R we use via inline C.
 
Upvote 0

derez

Expert
Licensed User
Longtime User
You can get time from NIST with the limit that it must be not less than once in 4 seconds. I have a clock running with getting time from Nist every few minutes and a timer of 1 second to advance the time, not RTC. After wake up get time from NIST and continue.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
not less than once in 4 seconds

Thanks for info. But for batch of devices under shared WiFi IP address it will be rather often anyway, devices are asyncronouse..
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…