- Notifications
You must be signed in to change notification settings - Fork7.8k
PowerManagement support#9083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
github-actionsbot commentedJan 9, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
👋Hello tshcherban, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
tshcherban commentedJan 9, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@SuGlider@VojtechBartoska is it possible to migrate from patching SDK-Config in github actions to just copy correspondingsdkconfig.defaults.target? that would be a bit more easy editing defaults, separate them for different targets and reuse for some other purposes (i.e. copy for examples, use in CMake build checks). |
CLAassistant commentedJan 9, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
SuGlider commentedJan 9, 2024
Actually we need to add this IDF sdkconfig changes to the Lib Builder scripts. The only way to changed sdkconfig and test it is by using Arduino as IDF Component and then build some examples that will verify how PM and light sleep will work. |
tshcherban commentedJan 10, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Found anissue IDFGH-11870 with IDF's UART implementation , it prevents UART usage with automatic llight sleep in some cases. |
tshcherban commentedFeb 2, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@igrr@VojtechBartoska@SuGlider for a BLE PowerManagement - i dont have ESP32 board with an external crystal, so for that part I would need your help in testing. On an ESP32S3 I'm planning to use Main XTAL as low power source by default. |
SuGlider commentedFeb 14, 2024
@tshcherban - This is part of another Task which also wants to add Power Management feature based on automatic Dynamic Frequency Scaling (DFS). The proposal is that the user will be able to set the Clock Source for each peripheral and also set it in a Global way whenever necessary in order to increase DFS applicability. This should be ready for Arduino 3.0.0 final release. |
tshcherban commentedFeb 14, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yes, for sure. |
github-actionsbot commentedJun 6, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Test Results 56 files 56 suites 5m 16s ⏱️ Results for commit205db45. ♻️ This comment has been updated with latest results. |
| /** | ||
| * @brief Set modem sleep state | ||
| * @param sleepType Modem sleep type, one of WIFI_PS_NONE, WIFI_PS_MIN_MODEM, WIFI_PS_MAX_MODEM | ||
| * @param listenInterval Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. Units: AP beacon intervals. Defaults to 3 if set to 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
it would be good to indicate the units of this parameter. As written it could be interpreted as milliseconds, seconds, minutes, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Unit is specified here (AP beacon intervals). It is determined by the access point parameters, I've often seen a 102400us value during testing with different routers, however it can differ.
safocl commentedSep 24, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
API and its comments are incompatible: and return type is bool (not [esp_return_type]) |
| returnfalse; | ||
| wifi_config_t current_conf; | ||
| if(esp_wifi_get_config((wifi_interface_t)ESP_IF_WIFI_STA, ¤t_conf) != ESP_OK){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
from(wifi_interface_t)ESP_IF_WIFI_STA
towifi_interface_t::WIFI_IF_STA
?
| boolsetAutomaticLightSleep(boolenabled) | ||
| { | ||
| uint32_tcpuFreq=getCpuFrequencyMhz(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
from
uint32_t cpuFreq = getCpuFrequencyMhz();to
const uint32_t cpuFreq = getCpuFrequencyMhz();?
| current_conf.sta.listen_interval = listenInterval; | ||
| if(esp_wifi_set_config((wifi_interface_t)ESP_IF_WIFI_STA, ¤t_conf) != ESP_OK){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
from(wifi_interface_t)ESP_IF_WIFI_STA
towifi_interface_t::WIFI_IF_STA
?
francisgariepy commentedSep 27, 2025
Anyone to resolve conflict and merge anytime soon? It's been more than 6 months and automatic light sleep is not working. |
Uh oh!
There was an error while loading.Please reload this page.
Description of Change
Enables Power Management support for arduino sketches.
API changes
Extended
WiFi.setSleepfunction to accept listenIntervalAdded
setAutomaticLightSleepfunction to enable/disable automatic LightSleep (without changing the CPU frequency)Tests scenarios
Tested WiFi connectivity, BLE scanning, OneWire, TwoWire, SPI, Serial on ESP32, ESP32-S3, ESP32-C3 boards.
Related links
Solves#6563 partially