Skip to content

A kit that loses Wi-Fi joins again on its own (W-1056) - #372

Merged
wr merged 1 commit into
mainfrom
wells/w-1056-wifi-rejoin
Oct 16, 2026
Merged

wr merged 1 commit into
mainfrom
wells/w-1056-wifi-rejoin

Conversation

@wr

@wr wr commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

At 9:03 AM on 15 Oct 2026 UniFi's automatic channel optimization changed the Front AP U6+'s channel (5 GHz 64 → 149; the AP stayed up, 17 days). Both kits were on it, on 2.4 GHz at −40 and −53 dBm, and UniFi logged both disconnecting that minute. Neither joined again: Cloud saw no check-in from either kit for the next 13 hours, and UniFi logged no join attempt. The EE03 came back only when it was unplugged (10:20 PM). The same optimization had moved the 2.4 GHz channel on 12 Oct (6 → 11), and that time both kits rejoined, so whether a kit came back depended on the disconnect reason.

Why. An always-awake kit joins Wi-Fi once, in setup() (ensureWifi), and is then kept on it by the Arduino core's auto-reconnect alone. The core retries only the reasons in _is_staReconnectableReason (STA.cpp) and stops for good on the rest. A join that fails at boot is never tried again either. A deep-sleep kit is not affected: it calls ensureWifi on every wake.

What changed. keepWifi(), called on every pass of loop(): while the station is down (and the setup portal is not open), it calls WiFi.begin() on the saved network every FF_WIFI_REJOIN_MS (30 s). The first call waits one gap, so the core's own retry goes first. WiFi.begin() rather than reconnect(), because it also starts the station if it was stopped.

Verified. pio run for release, release_ee02, xiao_ee03, ee02 and generic_bench builds. The server tests that read the firmware's sources pass.

Left. Not seen on a kit yet. The check is a kit on this build rejoining within a minute after its access point changes channel (UniFi: the AP's channel can be changed by hand to provoke it).

Refs W-1056

An always-awake kit joined Wi-Fi once, at boot, and was then kept on it by
the Arduino core's auto-reconnect alone. That retries only some disconnect
reasons and stops for good on the rest, so on 15 Oct 2026 both kits sat
off a working network with the slashed Wi-Fi mark up until they were
unplugged. While the station is down, the loop now joins the saved network
again every 30 s.

Refs: W-1056
@linear-code

linear-code Bot commented Oct 16, 2026

Copy link
Copy Markdown

W-1056

@wr
wr merged commit 37e9d20 into main Oct 16, 2026
6 checks passed
@wr
wr deleted the wells/w-1056-wifi-rejoin branch October 16, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant