Skip to content

Commit

Permalink
Add wifi.sta_ps_mode for ESP8266
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed Dec 16, 2021
1 parent bda94df commit 137c1e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 1 addition & 0 deletions mos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ conds:
libs:
- location: https://github.com/mongoose-os-libs/lwip
config_schema:
- ["wifi.sta_ps_mode", "i", 0, {title: "WiFi sleep mode: 0 - none, 1 - light, 2 - modem"}]
# min/max values are from enum RATE_11{B,G,N}_ID in the SDK, see user_interface.h for declarations.
- ["wifi.tx_rate_limit_11b", "i", -1, {title: "TX rate limit for 11B mode, ((max << 8) | min)"}]
- ["wifi.tx_rate_limit_11g", "i", -1, {title: "TX rate limit for 11G mode, ((max << 8) | min)"}]
Expand Down
10 changes: 1 addition & 9 deletions src/esp8266/esp_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,7 @@ static bool mgos_wifi_set_mode(uint8_t mode) {
s_cur_mode = mode;

if (mode == STATION_MODE) {
/*
* Turn off modem sleep.
* There is just no end to misery with it on.
* https://github.com/espressif/ESP8266_NONOS_SDK/issues/119 is particularly
* bad, but even without it there are regular disconnections reported by
* multiple people (and observed by us), sometimes with device never coming
* back (disconnect event getting lost).
*/
wifi_set_sleep_type(NONE_SLEEP_T);
wifi_set_sleep_type(mgos_sys_config_get_wifi_sta_ps_mode());
} else {
/* When AP is active, modem sleep is not active anyway. */
}
Expand Down

0 comments on commit 137c1e3

Please sign in to comment.