guild icon
Toit
#Deep sleep
Thread channel in help
DunjinnLord
DunjinnLord 12/14/2022 04:14 PM
Can I somehow make the ESP32 enter deep sleep for a specified amount of time?
floitsch
floitsch 12/14/2022 04:14 PM
on v1 or v2?
DunjinnLord
DunjinnLord 12/15/2022 08:59 AM
v1
floitsch
floitsch 12/15/2022 09:00 AM
The device goes to deep sleep whenever it has nothing to do.
floitsch
floitsch 12/15/2022 09:01 AM
Things to do are:
- connecting to the server (max offline)
- running user programs (defined by their specification)
floitsch
floitsch 12/15/2022 09:03 AM
If you set max offline to more than 1 minutes and install an application with interval 1 minute it will deep sleep one minute after each invocation.
floitsch
floitsch 12/15/2022 09:03 AM
Don't remember if the run time of the application is added or not.
DunjinnLord
DunjinnLord 12/15/2022 09:05 AM
Thank you for the answer. So I can't directly make it enter deep sleep? There's no method or anything I can use for it?
floitsch
floitsch 12/15/2022 09:06 AM
You can't. Programs run independently and having one program turn off the device would violate that.
floitsch
floitsch 12/15/2022 09:07 AM
I can have another look, but usually the specification was good enough for all scenarios.
floitsch
floitsch 12/15/2022 09:08 AM
Any particular use case you have in mind?
DunjinnLord
DunjinnLord 12/15/2022 09:11 AM
It was mainly so I had a some more control. My intention was to use it to make my device reset. And because I saw it was used in the weather station tutorial in the documentation.
floitsch
floitsch 12/15/2022 09:13 AM
With v1 you would just write into the specification that it should run every 15s.
floitsch
floitsch 12/15/2022 09:14 AM
If you set the interval to something small you could just return from the program with exit and the device should go to deep sleep (assuming some max offline)
14 messages in total