-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wifi off deep sleep current (IDFGH-340) #2315
Comments
Yes, you need to shut down Wi-Fi driver before entering deep sleep. Please see https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/system/sleep_modes.html#wifi-bt-and-sleep-modes. |
I have run esp_wifi_stop(), and it successfully entered event SYSTEM_EVENT_STA_STOP, and then I run esp_deep_sleep(1000000LL * deepSleepSec), but the result is still around 1.5mA, if I do not start wifi, but just run esp_deep_sleep, the current is 5.x uA. |
Hi @denyip, unfortunately I wasn't able to reproduce your result. I have tested with esp_wifi_stop();
esp_deep_sleep_start(); With this, once the device connects to the AP, it goes into deep sleep, and the current is 5.5uA as expected. In this example, WiFi is being used in Station mode. Can you give a hint what your WiFi configuration is? Perhaps you can try the same example with above mentioned modification, and see whether you get same current readings? |
Hi @igrr , void app_main() { void gpio_init(void) { void init_connect_wifi(void) { static esp_err_t event_handler(void *ctx, system_event_t *event) {
} |
hi @igrr , any update on this? |
I've exactly the same problem. The call to esp_sleep_enable_ext0_wakeup increases the deep sleep current by 1mA. |
As a workaround, you can call adc_power_off() function before entering deep sleep. We are working on a fix. |
This actually works. What also works is to use ext1 instead of ext0. |
@igrr , I confirm the workaround with IDF v3.1, thank you. |
@igrr |
I tried to run a simple wifi program, init wifi ->then connect to router->wifi stop->deep sleep, the deep sleep current is around 1.x mA. However, if I don't run the wifi procedure, just start and then deep sleep, the current is around 5.x uA, is it normal? any procedure missing on the wifi routine b4 entering deep sleep mode?
The text was updated successfully, but these errors were encountered: