Browse Source

fix(esp8266): disable WiFi modem-sleep on station connect

Set WiFi.setSleepMode(WIFI_NONE_SLEEP) in the GOT_IP handler, after
mAp.disable() completes the AP→STA mode transition. Placement after the
mode change ensures the sleep setting is not reset, and re-applies on
every reconnect.

Without this, ESP8266 defaults to modem-sleep. At weak RSSI the STA
misses DTIM beacons, causing outbound TCP (MQTT) to wedge while the
async web server remains reachable — a "zombie" state recoverable only
by inbound LAN traffic or reboot.
pull/1888/head
permissionBRICK 2 weeks ago
parent
commit
087e4b4242
  1. 1
      src/network/AhoyWifiEsp8266.h

1
src/network/AhoyWifiEsp8266.h

@ -91,6 +91,7 @@ class AhoyWifi : public AhoyNetwork {
case NetworkState::GOT_IP:
if(!mConnected) {
mAp.disable();
WiFi.setSleepMode(WIFI_NONE_SLEEP);
mConnected = true;
ah::welcome(WiFi.localIP().toString(), F("Station"));
MDNS.begin(mConfig->sys.deviceName);

Loading…
Cancel
Save