esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

vonnieda
Posts: 145
Joined: Tue Nov 07, 2017 3:42 pm

esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

Postby vonnieda » Fri Jan 12, 2018 11:24 pm

Hi all,

In an effort to save power, I am investigating various sleep modes and power saving modes. I've done some testing where I've determined that esp_wifi_set_ps(WIFI_PS_MODEM) does seem to decrease power usage by about 41mA but having BLE enabled keeps it from working. In addition, I've noticed in the documentation that light sleep mode is not compatible with BLE or WiFi, at the moment. So, a few questions:

1. Am I right that esp_wifi_set_ps(WIFI_PS_MODEM) is disabled by using BLE, and is there a way around this?
2. I saw in the documentation (https://esp-idf.readthedocs.io/en/lates ... leep-modes) that light sleep is compatible with WiFi, but that the current API does not support this. Is this still true, and is there a timeline for when light sleep will work with WiFi? Or is there an alternative API that can be used?
3. Is there any documentation for esp_wifi_set_ps(WIFI_PS_MODEM)? Specifically, I am curious if anything else needs to be enabled / disabled, or if there are any consequences to using this?
4. I have noticed that if I am using WiFi and BLE, and I enable "Support for power management" in menuconfig, I get trash on the monitor console. If I add "Enable dynamic frequency scaling" this goes away. Is this potentially a bug, or is there something that I need to be aware of when enabling this feature?

Thanks,
Jason

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

Postby ESP_igrr » Sat Jan 13, 2018 8:39 am

1. Correct, Bluetooth is not compatible with modem or light sleep and there is now way around this, at the moment.

2. Yes, still true, light sleep + WiFi is expected to be supported in 3.1, however we don't have the implementation ready yet.

3. WiFi modem sleep is only possible in station mode. AP or sniffer or Bluetooth will prevent it from working.

4. Sounds like a bug, could you please report it on GitHub, along with steps to reproduce?

vonnieda
Posts: 145
Joined: Tue Nov 07, 2017 3:42 pm

Re: esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

Postby vonnieda » Sat Jan 13, 2018 4:21 pm

ESP_igrr wrote:1. Correct, Bluetooth is not compatible with modem or light sleep and there is now way around this, at the moment.

2. Yes, still true, light sleep + WiFi is expected to be supported in 3.1, however we don't have the implementation ready yet.

3. WiFi modem sleep is only possible in station mode. AP or sniffer or Bluetooth will prevent it from working.

4. Sounds like a bug, could you please report it on GitHub, along with steps to reproduce?
Thank you for the response ESP_igrr, much appreciated! I will narrow down the bug in #4 and file an issue.

Thanks,
Jason

vonnieda
Posts: 145
Joined: Tue Nov 07, 2017 3:42 pm

Re: esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

Postby vonnieda » Mon Jan 15, 2018 6:00 pm

ESP_igrr wrote:1. Correct, Bluetooth is not compatible with modem or light sleep and there is now way around this, at the moment.

2. Yes, still true, light sleep + WiFi is expected to be supported in 3.1, however we don't have the implementation ready yet.

3. WiFi modem sleep is only possible in station mode. AP or sniffer or Bluetooth will prevent it from working.

4. Sounds like a bug, could you please report it on GitHub, along with steps to reproduce?
Hi @ESP_igrr, do you know an approximate timeframe for #2? I saw a post somewhere saying February at one point. Is that still likely?

Thanks,
Jason

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

Postby ESP_igrr » Tue Jan 16, 2018 12:52 am

We're aiming to have the feature freeze by mid February (before spring festival). This means that it is likely that this particular feature will trickle down to the master branch by then. If we miss that date for some reason, then end of February is likely.

vonnieda
Posts: 145
Joined: Tue Nov 07, 2017 3:42 pm

Re: esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

Postby vonnieda » Tue Jan 16, 2018 4:06 am

ESP_igrr wrote:We're aiming to have the feature freeze by mid February (before spring festival). This means that it is likely that this particular feature will trickle down to the master branch by then. If we miss that date for some reason, then end of February is likely.
Thank you @ESP_igrr, I really appreciate your fast and helpful responses!

Thanks,
Jason

athankok
Posts: 3
Joined: Thu Jan 11, 2018 6:38 am

Re: esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

Postby athankok » Tue Jan 30, 2018 1:06 pm

ESP_igrr wrote:We're aiming to have the feature freeze by mid February (before spring festival). This means that it is likely that this particular feature will trickle down to the master branch by then. If we miss that date for some reason, then end of February is likely.
What about BLE light sleep when it will be avaliable?

maciej
Posts: 3
Joined: Sat Feb 03, 2018 4:50 pm

Re: esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

Postby maciej » Tue Feb 13, 2018 12:13 pm

vonnieda wrote:
ESP_igrr wrote:4. Sounds like a bug, could you please report it on GitHub, along with steps to reproduce?
Thank you for the response ESP_igrr, much appreciated! I will narrow down the bug in #4 and file an issue.

Thanks,
Jason
Hi,
have you created an issue for this? I have same situation... :(

Gtracks
Posts: 5
Joined: Sun Jun 25, 2017 8:12 pm

Re: esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

Postby Gtracks » Wed Feb 14, 2018 6:52 pm

wondering if team can confirm if WiFi light sleep implementation will be supported in 3.1?

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: esp_wifi_set_ps(WIFI_PS_MODEM), BLE, and light sleep?

Postby loboris » Thu Mar 15, 2018 11:49 am

vonnieda wrote:...
4. I have noticed that if I am using WiFi and BLE, and I enable "Support for power management" in menuconfig, I get trash on the monitor console. If I add "Enable dynamic frequency scaling" this goes away. Is this potentially a bug, or is there something that I need to be aware of when enabling this feature?
Is there any progress on solving this issue ?

Edit:

This only happens if → Component config → ESP32-specific → CPU frequency is set to 240 MHz.

Possible workaround is to set the the CPU frequency to 160 MHz at the application start, then set it back to 250 MHz:

Code: Select all

#if defined(CONFIG_PM_ENABLE) && !defined(CONFIG_PM_DFS_INIT_AUTO) && defined(CONFIG_ESP32_DEFAULT_CPU_FREQ_240)
esp_pm_config_esp32_t pm_config;
pm_config.max_cpu_freq = RTC_CPU_FREQ_160M;
pm_config.min_cpu_freq = RTC_CPU_FREQ_80M; // or RTC_CPU_FREQ_XTAL
pm_config.light_sleep_enable = false;
esp_pm_configure(&pm_config);
vTaskDelay(2);
pm_config.max_cpu_freq = RTC_CPU_FREQ_240M;
esp_pm_configure(&pm_config);
#endif

Who is online

Users browsing this forum: No registered users and 99 guests