From 087e4b4242e2b09246140531cc424619bb46185a Mon Sep 17 00:00:00 2001 From: permissionBRICK <40219477+permissionBRICK@users.noreply.github.com> Date: Sun, 12 Jul 2026 01:26:04 +0000 Subject: [PATCH] fix(esp8266): disable WiFi modem-sleep on station connect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/network/AhoyWifiEsp8266.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/AhoyWifiEsp8266.h b/src/network/AhoyWifiEsp8266.h index 03cd54b1..0a9ec34f 100644 --- a/src/network/AhoyWifiEsp8266.h +++ b/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);