Wake up in specific date with internal RTC
Posted: Mon Aug 20, 2018 11:59 pm
With the internal RTC, we can easily set a date and keep it updated automatically and smoothly in the sleep cycles with the functions of settimeofday() and etc...
But how to use that date to wake the microcontroller? I'm using archaic and less accurate methods than directly using the RTC value which consists of accounts for calculating the total sleep time (discounting code execution times and boot times).
For example use something like:
This would wake up the microcontroller exactly on the date specified in UNIX/POSIX, which is kept automatically by the internal RTC and would be very interesting. The simple method would simply subtract the dates, however, I think you can have something more efficient. Is this the only method or is there something more "precise and sophisticated"?
But how to use that date to wake the microcontroller? I'm using archaic and less accurate methods than directly using the RTC value which consists of accounts for calculating the total sleep time (discounting code execution times and boot times).
For example use something like:
Code: Select all
esp_deep_sleep_to_date(1534898687);