关于deep-sleep模式下功耗过高问题。

zhoupeng
Posts: 35
Joined: Sun Sep 24, 2017 1:31 pm

关于deep-sleep模式下功耗过高问题。

Postby zhoupeng » Wed Nov 14, 2018 6:10 am

在开启和未开启wifi模式下进入sleep模式的功耗差异:
1、未使能wifi功能,休眠功耗大致在5微安左右。
2、先使能wifi功能,后关闭wifi功能进入休眠模式,功耗增加至1.4毫安左右:
esp_wifi_stop();
esp_deep_sleep_start();


这种现象是否正常,是什么原因导致的。

谢谢!

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

Re: 关于deep-sleep模式下功耗过高问题。

Postby ESP_igrr » Wed Nov 14, 2018 7:56 am

This is a regression in recent ESP-IDF versions; we are working on a fix, but for now you can call adc_power_off function before entering deep sleep to reduce the current.

zhoupeng
Posts: 35
Joined: Sun Sep 24, 2017 1:31 pm

Re: 关于deep-sleep模式下功耗过高问题。

Postby zhoupeng » Fri Nov 16, 2018 2:45 am

ESP_igrr wrote:
Wed Nov 14, 2018 7:56 am
This is a regression in recent ESP-IDF versions; we are working on a fix, but for now you can call adc_power_off function before entering deep sleep to reduce the current.
你好,谢谢你的回复。
我们使用的IDF版本是3.1:
1、这个现象是3.1版本才出现的吗,回滚回其它版本是否可以避免这个问题?
2、我们通过增加 adc_power_off 控制,功耗并没有下降。
3、近期是否版本发布计划修复此问题。

谢谢。

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

Re: 关于deep-sleep模式下功耗过高问题。

Postby ESP_igrr » Fri Nov 16, 2018 3:36 am

The issue is present in IDF 3.1.1 and 3.0.x versions as well; there likely exists a version on 3.0 branch which does not have the issue, but i can't say for sure which one is that.

Regarding adc_power_off not having effect, here's the code i used to test.
If I remove the adc_power_off line, then current is 1.4mA. If i add it back, current is 5.5uA.
Please check with this code sample to see if your issue is the same or not.

Code: Select all


#include "freertos/FreeRTOS.h"
#include "esp_wifi.h"
#include "esp_event_loop.h"
#include "nvs_flash.h"
#include "esp_sleep.h"
#include "driver/adc.h"

static void wifi_start_stop(void)
{
ESP_ERROR_CHECK(nvs_flash_init());
tcpip_adapter_init();
ESP_ERROR_CHECK(esp_event_loop_init(NULL, NULL));

wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_wifi_start());
vTaskDelay(pdMS_TO_TICKS(1000));
ESP_ERROR_CHECK(esp_wifi_stop());
ESP_ERROR_CHECK(esp_wifi_deinit());
}

void app_main()
{
wifi_start_stop();

/* The following line is necessary to reproduce the issue;
* An alternative way is to enable ext0 wakeup.
*/
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);

/* powering down ADC before entering sleep works around the issue */
adc_power_off();

esp_deep_sleep_start();
}

zhoupeng
Posts: 35
Joined: Sun Sep 24, 2017 1:31 pm

Re: 关于deep-sleep模式下功耗过高问题。

Postby zhoupeng » Fri Nov 16, 2018 6:14 am

ESP_igrr wrote:
Fri Nov 16, 2018 3:36 am
The issue is present in IDF 3.1.1 and 3.0.x versions as well; there likely exists a version on 3.0 branch which does not have the issue, but i can't say for sure which one is that.

Regarding adc_power_off not having effect, here's the code i used to test.
If I remove the adc_power_off line, then current is 1.4mA. If i add it back, current is 5.5uA.
Please check with this code sample to see if your issue is the same or not.

Code: Select all


#include "freertos/FreeRTOS.h"
#include "esp_wifi.h"
#include "esp_event_loop.h"
#include "nvs_flash.h"
#include "esp_sleep.h"
#include "driver/adc.h"

static void wifi_start_stop(void)
{
ESP_ERROR_CHECK(nvs_flash_init());
tcpip_adapter_init();
ESP_ERROR_CHECK(esp_event_loop_init(NULL, NULL));

wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_wifi_start());
vTaskDelay(pdMS_TO_TICKS(1000));
ESP_ERROR_CHECK(esp_wifi_stop());
ESP_ERROR_CHECK(esp_wifi_deinit());
}

void app_main()
{
wifi_start_stop();

/* The following line is necessary to reproduce the issue;
* An alternative way is to enable ext0 wakeup.
*/
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);

/* powering down ADC before entering sleep works around the issue */
adc_power_off();

esp_deep_sleep_start();
}
你好 ,问题如你代码描述,已解决。

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

Re: 关于deep-sleep模式下功耗过高问题。

Postby ESP_igrr » Fri Nov 16, 2018 6:36 am

Hope this helps! I'll update this topic when the fix makes its way into a release.

Who is online

Users browsing this forum: No registered users and 119 guests