guild icon
Toit
#Support for ESP32 Power Management
Thread channel in help
inneos
inneos 04/17/2025 03:16 PM
I was wondering if Toit does support the power management features implemented in esp-idf?
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/power_management.html
For battery-powered devices, this helps keep power consumption minimal.
inneosOPinneos
I was wondering if Toit does support the power management features implemented in esp-idf? https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/power_ma...
floitsch
floitsch 04/18/2025 08:22 AM
we found that the only option to run on battery is to go to deep-sleep as often as possible.
If your use-case is different, let us know, and I can see if we should expose the power-management functions.
inneos
inneos 04/18/2025 08:35 AM
Yes, we go to deep-sleep as often as possible, but when using esp-idf framework, we also enable pm to save few more milliamps when esp is running
floitsch
floitsch 04/18/2025 08:38 AM
We are basically talking about the esp_pm_configure function. Right?
So if I add a pm_configure max_freq_mhz min_freq_mhz light_sleep_enable function that would be enough. Or do you need more of the API?
inneos
inneos 05/02/2025 09:44 AM
Yes, this would be great. I also use the esp_pm_lock_* api functions to prevent entering light sleep, but for now I could simply use esp_pm_configure to disable automatic light sleep when needed.
inneosOPinneos
Yes, this would be great. I also use the esp_pm_lock_* api functions to prevent entering light sleep, but for now I could simply use esp_pm_configure to disable automatic light...
floitsch
floitsch 05/02/2025 10:25 AM
I will try to find some time to expose the functions then. Feel free to ping me from time to time
inneos
inneos 05/02/2025 10:39 AM
Thanks a lot!
floitsch
floitsch 05/06/2025 05:27 PM
I just wrote a PR that exposes the config functions.
floitsch
floitsch 05/06/2025 05:30 PM
Adding support for the locks is also relatively easy, but would take me a few minutes. For now I will leave it unimplemented, but ping us, if you start needing it.
inneos
inneos 05/07/2025 07:11 AM
Great, thanks a lot!
I will try probably next week and report back here.
floitsch
floitsch 05/07/2025 08:38 AM
Couldn't resist...
Now also added support for the lock class.
All still under review, but I hope it will be committed today and that we will do a new release soon.
11 messages in total