mirror of
https://github.com/esphome/esphome.git
synced 2026-07-11 01:15:33 +00:00
fc07796acf63aed3a4c64e73bb95163c5f464ee5
WiFi.disconnect() sets _wifiHWInitted=false and _mode=WIFI_OFF, which causes beginAP to run in AP-only mode (_mode=WIFI_AP). In AP-only mode, subsequent beginNoBlock() calls hit the ESP8266 compatibility hack in _beginInternal that redirects to beginAP() instead of starting a STA connection, creating a connect/disconnect loop. Without WiFi.disconnect(), _wifiHWInitted stays true and beginAP correctly enters AP_STA mode, allowing STA reconnection attempts to work properly alongside the fallback AP. The wifi_sta_connected() helper from the previous commit is sufficient to prevent false CONNECTED reports by checking WiFi.localIP() instead of the AP-contaminated WiFi.status().
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
549 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
