esp32 wake from sleep via interrupt then return to sleep

rktuttle
Posts: 2
Joined: Fri Apr 17, 2020 9:44 pm

esp32 wake from sleep via interrupt then return to sleep

Postby rktuttle » Fri Apr 17, 2020 11:10 pm

I would like to put esp32 into light sleep mode then be able to wakeup via ext interrupt. Next, I want to resume the sleep cycle. My attempts restart sleep cycle after interrupt is serviced. Problem is that a new sleep cycle is started after each interrupt.

Agree007
Posts: 103
Joined: Mon Sep 18, 2017 7:11 pm
Location: Copenhagen

Re: esp32 wake from sleep via interrupt then return to sleep

Postby Agree007 » Sat Apr 18, 2020 11:48 am

Thats the way it works, you will have to save you state and other required data, before going to sleep and the reload data when it wakes up.

User avatar
fasani
Posts: 197
Joined: Wed Jan 30, 2019 12:00 pm
Location: Barcelona
Contact:

Re: esp32 wake from sleep via interrupt then return to sleep

Postby fasani » Mon Apr 20, 2020 3:01 pm

Yes I agree with that.
Do you think is a good idea to use the Preferences class to save state?
epdiy collaborator | http://fasani.de Fan of Espressif MCUs and electronic design

Agree007
Posts: 103
Joined: Mon Sep 18, 2017 7:11 pm
Location: Copenhagen

Re: esp32 wake from sleep via interrupt then return to sleep

Postby Agree007 » Mon Apr 20, 2020 5:54 pm

fasani wrote:
Mon Apr 20, 2020 3:01 pm
Yes I agree with that.
Do you think is a good idea to use the Preferences class to save state?
The Preferences class is very easy to use and control, so in most cases I would use it, but it migth depend on what else you code does and require.

rktuttle
Posts: 2
Joined: Fri Apr 17, 2020 9:44 pm

Re: esp32 wake from sleep via interrupt then return to sleep

Postby rktuttle » Thu Apr 23, 2020 10:04 pm

Thank you both for your replies. I am new to this and will have to learn about the Preference class. Will do a google search.
Thanks again.

Who is online

Users browsing this forum: No registered users and 86 guests