Running at Specific Time
Posted: Sun Jan 17, 2016 11:13 pm
Hello, first time using the esp8266. I want to log temperature at 10AM and 4PM (It doesn't have to be very accurate). I'm able to log temperature every X milliseconds but have no idea how to do it at specific times. I've read about the TimeAlarms library and alarmRepeat functions. However I wanted to know what is the best way to do it:
a) Read current time with NTP , calculate milliseconds until next temperature log (10AM or 4PM, whichever is sooner), sleep until then.
b) Read time with NTP and set internal RTC every certain time and use the TimeAlarms to do the logging.
c) Any other suggestions.
Thanks a lot!
a) Read current time with NTP , calculate milliseconds until next temperature log (10AM or 4PM, whichever is sooner), sleep until then.
b) Read time with NTP and set internal RTC every certain time and use the TimeAlarms to do the logging.
c) Any other suggestions.
Thanks a lot!