Repository navigation
fix(viewer): show the splash page once a WiFi setup portal ends - #3412
Conversation
A device set up from the captive portal never showed its address. The boot splash runs once, minutes before anyone picks a network on their phone, and at that point the only interface up is the device's own access point -- so the one screen carrying the IP and admin URL went past before there was an address to put on it. When the portal came down the viewer fell straight through to the playlist, which on a first boot is empty, and the screen sat on the standby logo with no way to find the web UI. - The reporter arms a one-shot replay on the portal's active->inactive edge, and asset_loop shows /splash-page for SPLASH_DELAY before handing the display back to the playlist. - Only on an answered poll. An unreachable server already drops the setup screen deliberately, but it says nothing about a portal having finished -- and the splash is served by the server that just failed to answer. - The flag is cleared before the page goes up, so a second portal run inside the splash window cannot queue a second splash. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
There was a problem hiding this comment.
Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.
There was a problem hiding this comment.
Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.
There was a problem hiding this comment.
Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.
There was a problem hiding this comment.
Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.
There was a problem hiding this comment.
Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.
anthias_viewer doesn't re-export settings, so mypy's strict attr-defined check rejected viewer.settings. Patch the same object from its home module, as tests/test_viewer.py already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
The replayed splash started its SPLASH_DELAY countdown on the portal's active -> inactive edge, but at that point the device has only just started joining the chosen network and has no lease yet. On hardware the address was on screen for under 30 seconds of the 60 (GH #3411). The viewer now puts the splash up at once, polls the same /api/v2/network/ip-addresses endpoint the page uses until an address someone can reach the device on appears, and only then shows it for the full SPLASH_DELAY. The wait is capped at POST_WIFI_SETUP_ADDRESS_TIMEOUT_S (180 s) and ends early if the portal comes back up, which is what a failed join looks like. - The portal's own address is excluded: once the portal ends nothing strips it from the address list, and the resolvers behind it lag the interface. /api/v2/network/wifi-setup now reports the live portal's gateway so the viewer can remember it. Loopback, link-local and unspecified addresses are excluded too. - The splash page stops polling for addresses 120 s after it loads, so an address that arrives near or after that reloads the page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
b2ee9fa to
ed1c0f4
Compare
|



Issues Fixed
Fixes #3411
Description
A device set up from the WiFi captive portal never showed its address. The boot
splash runs once, minutes before anyone picks a network on their phone, and at
that point the only interface up is the device's own access point — so the one
screen carrying the IP and admin URL went past before there was an address to
put on it. When the portal came down the viewer fell straight through to the
playlist, which on a first boot is empty, and the screen sat on the standby
logo with no way to find the web UI.
active → inactive edge.
asset_loopputs/splash-pageup at once,holds it until the device has an address someone can reach it on,
then shows it for the full
SPLASH_DELAYbefore handing the displayback to the playlist.
screen deliberately (failing towards playback), but it says nothing about a
portal having finished — and the splash is served by the server that just
failed to answer, so arming there would trade the setup screen for a blank
page.
and ending inside the splash window cannot queue a second splash on top of
the playlist it is finally free to play.
goes down (from hardware testing in WiFi setup: the screen shows the standby logo instead of the IP/admin URL after joining WiFi via the portal #3411, where the address was on
screen for under 30 s of the 60: the device still has to join the
chosen network and get a lease). The viewer polls the same
/api/v2/network/ip-addressesendpoint the page uses until it returnsa non-loopback, non-link-local address that is not the portal's own
gateway, capped at
POST_WIFI_SETUP_ADDRESS_TIMEOUT_S(180 s)./api/v2/network/wifi-setupnow reports the live portal'sgatewayso the viewer can exclude it once the portal is gone and a lagging
address cache still lists it.
failed join looks like (wifi-connect drops the AP to try the network,
then re-raises it), so the setup screen is not held off by the splash.
an address that arrives near or after that point reloads the page.
Verification
The hardware runs below cover the original change (
db37554). Thefollow-up that holds the splash until an address appears (
fcb079f) iscovered by unit tests and needs a retest on hardware.
Both boards ran the same scenario against the published
latest-<board>imagewith only
src/anthias_viewer/__init__.pyoverlaid from this commit — thein-container file was byte-identical to
masterbeforehand, so nothing elserode along. A portal run was driven at the two boundaries Anthias actually
reads: wifi-connect's
--state-fileon the sharedresin-datavolume (with alive heartbeat) and the portal gateway held on a WiFi interface, both removed
together to represent a successful join. Nothing inside Anthias was stubbed.
pi4-64, eglfs)GET /hotspot/GET /hotspot/— setup screen with SSID + passphraseGET /splash-page/, then its IP poll returns the board's LAN addressSPLASH_DELAYFramebuffer captures on the x86 board (grim through cage's headless output)
confirm the before/after pair visually: standby logo before, splash page with
the address after.
Unrelated note: the splash page's client-side IP poll keeps running after the
viewer navigates to the standby image, because the webview's image path does
not tear down the previous page's JS context. Confirmed pre-existing on a plain
boot splash with no portal involved, so it is left alone here.
Checklist
* One pre-existing failure, not from this change:
tests/test_viewer.py::TestWaitForWaylandSocket::test_probe_reports_not_ready_for_a_non_socket_pathfails under
pytest -n autoand passes when run alone. Reproduced identicallyon a clean
mastertree. Everything else: 2559 passed, 3 skipped.🤖 Generated with Claude Code