mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 17:18:40 +00:00
96657f71a26af3c8f56c9530487cfc215ee3a846
On ESP8266, the roaming scan goes off-channel for ~3 seconds. Some APs aggressively disconnect the client (Beacon Timeout) 8-20 seconds after the scan finishes. By that time, process_roaming_scan_() has already set roaming_state_ back to IDLE. When retry_connect() runs, it sees IDLE and calls clear_roaming_state_(), resetting the attempts counter to 0. This creates an infinite loop of "attempt 1/3" every 5 minutes. The aggressive AP behavior cannot be fixed from the ESP side, but we can prevent the counter from resetting so roaming eventually stops after 3 attempts. Fix by recording when the roaming scan completes and adding a 30s grace period. If a disconnect occurs within that window, the state transitions to RECONNECTING (preserving the counter) instead of clearing it. Closes https://github.com/esphome/esphome/issues/15124
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
597 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
