I’d like to build a battery-powered clock with no physical interface and no access to the Internet. The user will set the time from a web page the clock will broadcast for the first five minutes after the battery is installed, then turn off the radio to conserve power. ESP8266-based systems and the Photon are the main contenders.
Of course, there are lots of Photon clock projects out there, but all the ones I’ve come across get their time from the net. At this point in my analysis, it seems fairly straightforward to do what I want with the Photon, plus the Photon has an RTC which is missing from the ESP8266 offerings I’ve seen so far.
The general approach I’m thinking of taking (feel free to offer a better one) is to use System.sleep() to sleep for, say, 55 seconds, update the time variable and display (it’s e-ink, so it takes awhile), then use one of the Time object methods to decide when to, precisely, go back to sleep.
I just wanted to confirm the Time object is preserved during System.sleep(). Wouldn’t make much sense otherwise, but I often get hammered when I assume. I also assume it gets its time from the RTC, but regardless of where it comes from, is there a way to measure the accuracy of its timebase so I can introduce a correction factor to improve the accuracy?
I may make 50-100 of these clocks, so I can afford to invest 10-15 seconds determining the factor for each (using a frequency counter, e.g.) and then customizing a variable in the code before flashing. Running each for an hour or more to measure an accumulated error won’t work, though. Thanks for any tips.