Skip to content

python3-improv: fix missing claim token on Wi-Fi success#40

Merged
ajlennon merged 1 commit into
mainfrom
fix/improv-claim-token
Jul 20, 2026
Merged

python3-improv: fix missing claim token on Wi-Fi success#40
ajlennon merged 1 commit into
mainfrom
fix/improv-claim-token

Conversation

@ajlennon

Copy link
Copy Markdown
Member

Summary

  • Fixes the app-reported error "connected to Wi-Fi but did not return a claim token" at its source in the firmware.
  • Root cause: pyImprov's build_rpc_response chunks the RPC response at max_response_bytes (default 100). Our Wi-Fi-success redirect URL is ~117 B (active-esl-onboard.active-esl.workers.dev?...&token=<uuid>), so it exceeds the threshold and pyImprov emits a spurious zero-length WIFI_SETTINGS packet before the packet that actually carries the URL. Clients that complete on the first (empty) result never see the token.
  • Fix: construct ImprovProtocol(..., max_response_bytes=200) on all three board variants (imx93-jaguar-eink, imx8mm-jaguar-inst, default). The URL now returns in a single ~121 B packet — no split, no leading empty packet — comfortably within the ~185 B BLE MTU the app negotiates.

Notes

  • Independent of, and complementary to, the app/CLI change that already tolerates the empty-then-URL sequence defensively (belt-and-braces).
  • No functional change to the advertised URL or token; only the BLE response chunking threshold.

Test plan

  • Flash an eink build with this change; onboard via the app and confirm a claim token is received on the first attempt.
  • Verify the WIFI_SETTINGS result arrives as a single packet (no leading empty packet) via the improv-provision CLI smoke test.

Made with Cursor

Pass max_response_bytes=200 when constructing ImprovProtocol on all three
board variants. The pyImprov default of 100 is below our Wi-Fi-success redirect
URL (~117 B: the active-esl-onboard.active-esl.workers.dev host plus a UUID
token), which trips a pyImprov chunking bug in build_rpc_response: it emits a
spurious zero-length WIFI_SETTINGS packet *before* the packet that carries the
URL. Improv clients that complete on the first (empty) result never see the
token, surfacing in the app as "connected to Wi-Fi but did not return a claim
token".

Raising the threshold returns the URL in a single ~121 B packet, well within
the ~185 B BLE MTU the app negotiates, so no split (and no leading empty
packet) occurs. The app/CLI also tolerate the empty-then-URL sequence defensively.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ajlennon
ajlennon merged commit 55e106d into main Jul 20, 2026
2 of 3 checks passed
@ajlennon
ajlennon deleted the fix/improv-claim-token branch July 20, 2026 09:41
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