Is there a maximum time you can specify for sleep? Is 24 hours possible?
Thanks
Zim
time limit for ESP32 sleep command
- PeterN
- Posts: 399
- Joined: Mon Feb 08, 2021 7:56 pm
- Location: Krefeld, Germany
- Has thanked: 189 times
- Been thanked: 222 times
- Contact:
Re: time limit for ESP32 sleep command
Hi Zim
not shure about the exact number of millis (32bit??) in the hardware counter, but remember that it results in a 71 minutes maximum.
So you may have to wake up x times, read and write a countdown counter into a file and return x-1 times to sleep
not shure about the exact number of millis (32bit??) in the hardware counter, but remember that it results in a 71 minutes maximum.
So you may have to wake up x times, read and write a countdown counter into a file and return x-1 times to sleep
-
- Posts: 222
- Joined: Mon Feb 15, 2021 1:44 pm
- Has thanked: 126 times
- Been thanked: 132 times
Re: time limit for ESP32 sleep command
Ah yes, that's something I forgot to mention. I'm pretty sure from way back that max asleep is much less than a day. My program would still work as long as you limit the maximum sleep time; it would just wake a few more times.
- PeterN
- Posts: 399
- Joined: Mon Feb 08, 2021 7:56 pm
- Location: Krefeld, Germany
- Has thanked: 189 times
- Been thanked: 222 times
- Contact:
Re: time limit for ESP32 sleep command
Now I remeber where I saw that 71 minutes maximum:
[Local Link Removed for Guests]
[Local Link Removed for Guests]
Re: time limit for ESP32 sleep command
Thanks Gents. I found a hardware solution that is adjustable from seconds up to 20 days. I will post my findings if it works.
Thanks
Zim
Thanks
Zim
- cicciocb
- Site Admin
- Posts: 2097
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1386 times
- Contact:
Re: time limit for ESP32 sleep command
I did a check in the code and It seems that it is actually limited to 32bits (copy paste from the esp8266);
This means that the max time is around 71 minutes (4294 seconds).
However the ESP32 is not limited at 32 bits so it could be possible to remove this limit in a future release
This means that the max time is around 71 minutes (4294 seconds).
However the ESP32 is not limited at 32 bits so it could be possible to remove this limit in a future release
Re: time limit for ESP32 sleep command
Wow, that would sure simplify my problem! Would it be possible to slip us a Bin file with this mod? Life would be so much simpler![Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat Feb 18, 2023 10:51 am However the ESP32 is not limited at 32 bits so it could be possible to remove this limit in a future release
Thanks
Zim
-
- Posts: 351
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 187 times
- Been thanked: 113 times
Re: time limit for ESP32 sleep command
When waking from sleep, the RTC RAM is not cleared. Therfore, you could simply increment a counter each sleep period in the non-volatile RAM.
No need to wear out the flash. A wake/read/increment/sleep routine would only keep it awake for a few mS, so no major impact on battery life.
The only downside with sleep periods is that they are +/- 1 brick and temperature sensitive.
Worst I've seen is a 3 minute sleep take 3:12
No need to wear out the flash. A wake/read/increment/sleep routine would only keep it awake for a few mS, so no major impact on battery life.
The only downside with sleep periods is that they are +/- 1 brick and temperature sensitive.
Worst I've seen is a 3 minute sleep take 3:12
- cicciocb
- Site Admin
- Posts: 2097
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1386 times
- Contact:
Re: time limit for ESP32 sleep command
Hi,[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat Feb 18, 2023 6:02 pmWow, that would sure simplify my problem! Would it be possible to slip us a Bin file with this mod? Life would be so much simpler![Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat Feb 18, 2023 10:51 am However the ESP32 is not limited at 32 bits so it could be possible to remove this limit in a future release
Thanks
Zim
please find here a version that should fix the sleep command.
Now you should be able to go beyond 71 minutes.
I did not tested ...
This version includes also other stuff not yet documented
You do not have the required permissions to view the files attached to this post.
Re: time limit for ESP32 sleep command
Thank you! I will test soon.[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat Feb 18, 2023 7:53 pm please find here a version that should fix the sleep command.
Now you should be able to go beyond 71 minutes.
I did not tested ...
This version includes also other stuff not yet documented
Annex32.bin
Zim