ESP32S2: Scheduling tasks with deepsleep
Posted: Sun Oct 24, 2021 9:26 am
I'm looking for a way to schedule tasks in micropython, for example read a sensor every 15 minutes, upload data every hour etc...
There are lots of methods to do this using various techniques however I can't find much info on how this can be done if you want to put the MCU to sleep in between task runs as deepsleep will usually results in losing state.
I was thinking of making a list of events in advance and then storing this in the RTC memory. When the MCU wakes it would pull the next task from the list, complete task and then determine how long it needs to go back to sleep for.
Does anyone have any better suggestions?
There are lots of methods to do this using various techniques however I can't find much info on how this can be done if you want to put the MCU to sleep in between task runs as deepsleep will usually results in losing state.
I was thinking of making a list of events in advance and then storing this in the RTC memory. When the MCU wakes it would pull the next task from the list, complete task and then determine how long it needs to go back to sleep for.
Does anyone have any better suggestions?