Deep sleep
# help
d
Can I somehow make the ESP32 enter deep sleep for a specified amount of time?
f
on v1 or v2?
d
v1
f
The device goes to deep sleep whenever it has nothing to do.
Things to do are: - connecting to the server (max offline) - running user programs (defined by their specification)
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.
Don't remember if the run time of the application is added or not.
d
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?
f
You can't. Programs run independently and having one program turn off the device would violate that.
I can have another look, but usually the specification was good enough for all scenarios.
Any particular use case you have in mind?
d
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.
f
With v1 you would just write into the specification that it should run every 15s.
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)