Skip to content

Commit

Permalink
Merge pull request #334 from kivancsikert/wifi/improve-battery-life
Browse files Browse the repository at this point in the history
  • Loading branch information
lptr authored Jan 19, 2025
2 parents 63e0482 + 43ab9d1 commit 5b8e31c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main/kernel/drivers/WiFiDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ class WiFiDriver {
LOGTV(Tag::WIFI, "Enabling power save mode, listen interval: %d",
listenInterval);
ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_MAX_MODEM));
ESP_ERROR_CHECK(esp_sleep_enable_wifi_wakeup());
ESP_ERROR_CHECK(esp_sleep_enable_wifi_beacon_wakeup());
config.sta.listen_interval = listenInterval;
}

Expand Down
3 changes: 3 additions & 0 deletions sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ CONFIG_PM_RESTORE_CACHE_TAGMEM_AFTER_LIGHT_SLEEP=y
# TODO Experiment with this
# CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y

CONFIG_ESP_PHY_MAC_BB_PD=y
CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP=y

# Recalibrate the RTC_FAST/SLOW clock less often
CONFIG_PM_LIGHTSLEEP_RTC_OSC_CAL_INTERVAL=16

Expand Down

0 comments on commit 5b8e31c

Please sign in to comment.