Repository navigation
fix: kiosk restart loop, PC HDMI audio, server not saved after Wi-Fi join, join/scan race, Wi-Fi power save - #14
Merged
Conversation
…work Access) Since Chrome 142 a public site needs the Local Network Access permission to call 127.0.0.1, and a kiosk has nobody to answer the prompt. /tv's heartbeats and events never reached boxd, so the watchdog took the page for stuck and restarted the kiosk every few minutes (then rebooted the box after three). boxd config apply (every boot) and the setup save write a Chromium managed policy allowing the configured server's origin, under all three names the policy has had (LocalNetworkAccess, and the 146+ LocalNetwork / LoopbackNetwork split). config.ServerOrigin is shared with the bridge's Origin check.
…power saving off Right after the setup access point went down the scan list was empty, and 'nmcli device wifi rescan' returns before the scan ends, so a join could fail with "couldn't find <network>" for a network in range. Connect now rescans with --rescan yes (which waits) until the SSID shows, up to four times, before connecting. Commas in a name were never the problem: the SSID is one argument to nmcli (now pinned by the test). NetworkManager enables Wi-Fi power saving by default; with it, cards like the mt7921 stop answering incoming traffic while idle (the box answered ARP but not ping or SSH). A conf.d drop-in turns it off.
…p the last known time on /data A fresh box boots months behind (no RTC, and timesyncd's clock file lived on the overlay's tmpfs), so every https certificate looked invalid until NTP answered. The check after a join gave up after 30 s and didn't save the server, so it had to be set a second time from a phone. - the join restarts timesyncd (it had been backing off while offline) and checks the server for two minutes, logging why the last check failed - data-persist saves timesyncd's clock file (its mtime) to /data and restores it before timesyncd starts, so a box starts at its last known time instead of the image's build date
audio-setup took the first HDMI/DisplayPort sink. A PC has one per port (a Framework laptop: one per USB-C port), so the TV on another port got silence while the page played. And when the card sat on its analog profile (WirePlumber's preference on a laptop), the TV's output wasn't a sink at all. audio=hdmi on a PC now takes the sink whose port reports a display, and if none does, switches the card to the available HDMI profile (output only first; never re-switched once active, so the hotplug monitor can't loop). The TV-off fallback (first/second sink) and Pi behavior are unchanged; a Pi's cards are never switched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From a night running the x86 box (a Framework laptop) at a friend's house: the join failed on the first network, the server had to be set twice, there was no audio on the TV, and the kiosk died back to the console every ~5 minutes for two hours.
Kiosk restart loop (affects every box on a public server)
Since Chrome 142, a public site needs the Local Network Access permission to call
127.0.0.1. A kiosk has nobody to answer the prompt, so/tv's heartbeats and events never reached boxd. The watchdog then saw a page that "stopped beating while the server answers": it restarted the kiosk after the 4-minute settle, and rebooted after three restarts.boxd config apply(every boot) and the setup save write/etc/chromium/policies/managed/syncphony-box.json, allowing the configured server's origin underLocalNetworkAccessAllowedForUrls,LocalNetworkAllowedForUrlsandLoopbackNetworkAllowedForUrls(the 146+ split). Chromium ignores names it doesn't know. With no server there's no policy.config.ServerOriginis now shared with the bridge's Origin check.Audio on a PC
audio-setuptook the first HDMI/DP sink, but a laptop has one per USB-C port.audio=hdmion a PC now:availableThe TV-off fallback and all Pi behavior are unchanged, and a Pi's cards are never switched. ADR 0013 is updated.
Server not saved after a Wi-Fi join
A fresh box boots months behind (no RTC, and timesyncd's clock file lived on the tmpfs), so https failed and the 30-second server check gave up.
data-persistsaves and restores timesyncd's clock file (its mtime) through/data, ordered before timesyncd, so boots start at the last known time."Couldn't find " right after the hotspot
nmcli device wifi rescanis async, and the scan list is empty right after AP mode.Connectnow polls--rescan yes(which waits) up to 4 times for the SSID before connecting. The comma in the SSID was not the cause; the test pins it.Wi-Fi power save off
A NetworkManager
conf.ddrop-in setswifi.powersave = 2. The mt7921 box answered ARP but not ping or SSH while idle.Testing
make test(69 bats + Go) andmake lintpass ingolang:1.26-trixiejournalctl -u boxd | grep watchdogshould stay quiet past 5 minutes, andchrome://policyshould show the policy. The Chromium policy names come from vendor docs (Okta, Truu, Google's Samsung-hosted policy reference), not from a test against Chromium 155.