Skip to content

Say why the box couldn't join Wi-Fi, in words - #140

Merged
longzhi merged 4 commits into
mainfrom
claude/wifi-join-errors
Oct 13, 2026
Merged

longzhi merged 4 commits into
mainfrom
claude/wifi-join-errors

Conversation

@longzhi

@longzhi longzhi commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Why

dragon joined with a wrong password on purpose. The Status row said Couldn't join (Failed(DisconnectedInfo { ssid: "ByteTrade", bssid: [136, 220, 151, 19, 86, 27], reason: AuthenticationExpired, rssi: -59 })). Check the network name and password, then join again. after about 10 s, with nothing in between to say this takes a while.

Measured on the box over serial: WIFI CONNECTING → WIFI FAILED … AuthenticationExpired takes 12.8 s, and each retry 10 s later takes as long again. That time is the access point re-sending the first handshake message before it deauthenticates the box. The status reaches the apps over a stream, so they add no delay. Nothing on our side can tell a wrong password sooner, so the wait now says how long it can take.

What

  • Firmware sends the driver's disconnect reason alone (WIFI FAILED AuthenticationExpired) instead of the whole Debug of the error.
  • Daemon turns <why> into device.wifi_error: wrong_password (AuthenticationExpired, AuthenticationFailed, FourWayHandshakeTimeout, HandshakeTimeout, MicFailure), not_found, security, password, ssid, or the reason as it came. It also parses firmware 0.5.0's old form, so released boxes get the better text with no firmware update.
  • Daemon: POST /v1/device/wifi clears the last failure. Before, joining the same network name again kept showing the old password's error while the new one was being tried.
  • Mac and Linux apps explain each code, with zh-Hans; "Joining…" becomes "Joining… This can take up to 15 seconds."
  • Firmware: joining again while the box is still trying the last password no longer fails with WIFI FAILED config. Dropping connect_async left the driver connecting, and set_config refuses during that, so the attempt is now stopped with disconnect_async first. A wrong password keeps the driver connecting for 13 s of every 23 s retry cycle, so this happened to more than half of quick re-joins. dragon hit it at 07:25:36 today.
  • Docs: docs/protocol.md "Wi-Fi network" describes WIFI CONNECTING/FAILED and the codes.

Checks

  • Host tests: the classification (including the 0.5.0 form) and clearing on Join. cargo test --workspace, clippy, check-localization.py, swift build, and the firmware release build all pass.
  • On the box: join with a wrong password, then right away the right one, in the Mac app. The second Join should not fail with config.

🤖 Generated with Claude Code

The box sent the Wi-Fi driver's whole error (`Failed(DisconnectedInfo { ..
reason: AuthenticationExpired .. })`) and the apps put it in a sentence as is.
The box now sends the reason alone; the daemon turns it into wrong_password,
not_found, security, password or ssid (also from firmware 0.5.0's old form),
and both apps explain each. Joining says it can take up to 15 s, since a
wrong password takes the network that long to turn down, and joining again
clears the last failure instead of showing it while the new password is tried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 07:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

longzhi and others added 3 commits October 13, 2026 15:39
Dropping connect_async when new credentials arrive left the driver
connecting, and set_config refuses while it is: joining again during a wrong
password's 13 s attempt failed with WIFI FAILED config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The box reported its address once, as the network came up, and the apps showed
"Joining…" for as long as the daemon hadn't seen it: after a daemon restart,
or linked over the local network or the Relay. The box now repeats it in
answer to hello, the daemon takes the address it reached the box at over the
local network, and learning the network's name no longer drops the address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@longzhi
longzhi merged commit 9fbffc9 into main Oct 13, 2026
2 checks passed
@longzhi
longzhi deleted the claude/wifi-join-errors branch October 13, 2026 08:39
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.

2 participants