mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 22:02:17 +01:00
Every WiFi connect took about 17.6 s. Our scan already picks the AP and passes its BSSID and channel to WiFi.begin(), but the connect still ran with WIFI_ALL_CHANNEL_SCAN. So the driver swept every channel again before it sent the first auth frame. A capture of the join showed the AP silent for 17.6 s, the radio on ch7 while the AP is on ch6, and then auth, association and the handshake all done in 80 ms. When the BSSID is known (the normal connect, the strongest-AP path and roaming), use WIFI_FAST_SCAN: the driver starts on that channel and joins the first match, and with bssid_set only that AP matches. The hidden-SSID path still uses the all-channel scan, since there it is what finds the strongest AP (rstrouse/ESPSomfy-RTS#294). Soft reboots now connect in 0.3-1.5 s. Also log how long each join took and the AP's security mode, on the connect line and on the roaming-scan lines, so a slow connect shows up. One boot in the old logs connected in 2.47 s, and nothing in its log explains it. After a power cut the first attempts can still fail on the AP side; a soft reboot sends a deauth first and doesn't have that problem. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| test_utils.cpp | ||