Page 1 of 1

esp32 - sleep mode

Posted: Mon Nov 21, 2016 2:22 pm
by nisim-kwik
Hello,

How set the esp32 in sleep mode and how wake up?
Someone can give example or source code?

Tanks,
Nisim

Re: esp32 - sleep mode

Posted: Mon Nov 21, 2016 4:54 pm
by kolban
I believe the answer lies in calling "system_deep_sleep()". This takes a parameter of the number of microseconds to sleep for. When called, the device will all but power itself down and when the interval duration has passed, it will wake up and start again. I believe some small amount of non volatile RAM may remain refreshed so you can remember some state on wake up.

I also believe that there may be a way to specify an alternate wake up mechanism beyond just an interval timer using a GPIO pin signal change. This may work in conjunction with the deep sleep timer ... so the device will wake up again either because of a timeout of the interval or as a result of a GPIO signal change.

All in all, the core function is "system_deep_sleep()".

See also:

Re: esp32 - sleep mode

Posted: Tue Nov 22, 2016 11:33 am
by nisim-kwik
Thank you for your reply but "system_deep_sleep()" not work for me.
I use the blink led example and add button to set the esp32 in sleep mode for 10 sec but the led still blinking.
Someone can give example code?

Thanks,
Nisim