esp32 sleep indefinitely?

If doesn't fit into any other category ....
Post Reply
Zim
Posts: 294
Joined: Mon Feb 08, 2021 9:15 pm
Has thanked: 273 times
Been thanked: 131 times

esp32 sleep indefinitely?

Post by Zim »

Hi
How do we code "sleep" to sleep indefinitely only to be awakened by a pin? I can't get it to sleep without a actual time associated...

Thanks
Zim
User avatar
Electroguard
Posts: 921
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 302 times
Been thanked: 339 times

Re: esp32 sleep indefinitely?

Post by Electroguard »

As a workaround, when periodically awakening it could read the 'wake-up' pin status and just go back to sleep if not activated (also offering opportunity for send low battery warnings if needed).
User avatar
cicciocb
Site Admin
Posts: 2160
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 461 times
Been thanked: 1435 times
Contact:

Re: esp32 sleep indefinitely?

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat May 11, 2024 5:20 pm Hi
How do we code "sleep" to sleep indefinitely only to be awakened by a pin? I can't get it to sleep without a actual time associated...

Thanks
Zim
You can simply use years as time .....
One year is 365*24*60*60 = 31536000 seconds
BeanieBots
Posts: 354
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 190 times
Been thanked: 113 times

Re: esp32 sleep indefinitely?

Post by BeanieBots »

I'd be tempted to go somewhere between Electroguard's and cicciocb's suggestion.
Perhaps once a week and as suggested, report battery condition.
Post Reply