Files
yaris-obd/deploy/yaris-netwatch.service
T
Mathieu MoranandCopilot 04cf74ccd3 Fix flaky hotspot->home WiFi reconnect in netwatch
Real-hardware finding: netwatch repeatedly reported 'home WiFi not found'
4 times over 13min while sitting right next to the router. Root cause:
a plain 'nmcli con up home-wifi' straight out of AP mode relies on NM's
scan cache for wlan0, which is stale/empty coming out of AP mode (the
radio can't scan while acting as an AP). A single con-up attempt didn't
wait for a fresh scan to land before giving up.

Fix: explicitly drop the AP connection first to free the radio, force a
fresh scan with a settle delay, and retry the connect attempt (longer
30s timeout) up to 2 times before conceding and restoring the hotspot.
Bumped the systemd unit's TimeoutStartSec to 180s to give the retry loop
enough headroom (was defaulting to 90s).

Co-authored-by: Copilot <[email protected]>
2026-08-09 15:44:19 -04:00

12 lines
371 B
Desktop File

[Unit]
Description=yaris-obd network watcher (hotspot -> home WiFi reconnect check)
After=NetworkManager.service
Wants=NetworkManager.service
[Service]
Type=oneshot
# Retry loop (down AP, rescan, retry connect up to 2x) can take ~80s worst
# case - default 90s systemd start timeout was too tight a margin.
TimeoutStartSec=180
ExecStart=/usr/local/bin/yaris-netwatch.sh