Page 1 of 1

ESP32S2: Scheduling tasks with deepsleep

Posted: Sun Oct 24, 2021 9:26 am
by p_j
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?

Re: Scheduling tasks with deepsleep

Posted: Mon Oct 25, 2021 7:15 am
by pythoncoder
You haven't told us what hardware you're using. There is information on how to do this with Pyboards here but other platforms will vary greatly.

Re: Scheduling tasks with deepsleep

Posted: Thu Oct 28, 2021 2:55 am
by p_j
Thanks Peter I'll have a look at that link.

I'm currently using an ESP32S2 chip, custom PCB.
pythoncoder wrote:
Mon Oct 25, 2021 7:15 am
You haven't told us what hardware you're using. There is information on how to do this with Pyboards here but other platforms will vary greatly.

Re: ESP32S2: Scheduling tasks with deepsleep

Posted: Thu Oct 28, 2021 9:54 am
by pythoncoder
I've no experience wit that chip. I've changed the title of your root message in the hope that someone will pop up who can help.