Hello,
How set the esp32 in sleep mode and how wake up?
Someone can give example or source code?
Tanks,
Nisim
esp32 - sleep mode
Re: esp32 - sleep mode
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:
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:
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
-
- Posts: 3
- Joined: Thu Nov 17, 2016 3:47 pm
Re: esp32 - sleep mode
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
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
Who is online
Users browsing this forum: MicroController and 255 guests