mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 17:18:40 +00:00
bad6a622269bd85537d77662e7862ead4005c2f8
Two bugs combined to make the RP2040 Pico W immediately think it was
connected to WiFi after starting the fallback AP, causing it to disable
the AP and stop retrying:
1. wifi_mode_(false, {}) was a no-op for STA disable — restart_adapter()
calls this to tear down STA, but the implementation only handled
sta=true. The CYW43 STA link state remained CYW43_LINK_JOIN from
the timed-out connection attempt.
2. wifi_ap_ip_config_() called WiFi.config(192.168.4.1) which configured
the STA interface's IP (not the AP's). When wifi_sta_connect_status_()
checked WiFi.status(), CYW43lwIP::status() saw CYW43_LINK_JOIN +
localIP().isSet() and returned WL_CONNECTED.
Fix wifi_mode_() to call WiFi.disconnect() when sta=false to clear stale
link state. Remove the WiFi.config() call from wifi_ap_ip_config_() since
WiFi.beginAP() already configures the AP IP internally. Also fix
wifi_soft_ap_ip() to use WiFi.softAPIP() instead of WiFi.localIP().
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%
