Commit Graph
61 Commits
Author SHA1 Message Date
Andreas WredeandClaude Opus 4.8 8fcc959551 robustness: hardware watchdog + hbc heartbeat client
Two TODO Tier-1 items:

- Hardware watchdog: power/10-vanlink-watchdog.conf drop-in sets
  RuntimeWatchdogSec=20s + RebootWatchdogSec=5min; deploy.sh applies it via
  daemon-reexec. PID1 pets intel_oc_wdt; a >20s systemd hang hard-resets the box.

- Heartbeat / dead-man's switch: vendored hbc.yaml + hbc.service report to
  hbd.wrede.pvt (UDP 50003) every 15s as user andreas, shipping cpu/mem/disk/
  network/zfs metrics. The hbc binary is installed once via the heartbeat
  project's installer (README §4); deploy.sh starts the service when present.

Auto-power-on-when-mains-returns: documented as a BIOS-only option (not
OS-controllable on this ZenBook) in README §3 + TODO, per decision.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 22:20:09 -04:00
Andreas WredeandClaude Opus 4.8 97309970ec docs: add TODO.md robustness backlog
Tiered list of candidate improvements toward a robust unattended van router,
with an "already in place" section so nothing gets redone.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 22:03:44 -04:00
Andreas WredeandClaude Opus 4.8 473a75c729 cockpit: battery/power card; van-battery publishes thresholds in state
New "Battery / Power" card shows mains vs battery, charge % with a severity-
colored bar (only bites while on battery), the last alert level, and the
configured warn/shutdown thresholds. van-battery now includes warn_levels +
shutdown_level in /run/van-battery/state.json so the card stays self-describing
instead of hardcoding the numbers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 21:56:20 -04:00
Andreas WredeandClaude Opus 4.8 52e948654e battery: alert on mains<->battery transitions
Pushover notification when the router loses mains (now on battery) and when
mains is restored. One alert per real transition; first sample is skipped so a
restart while already on battery doesn't false-fire. Independent of the
low-charge 25/20/15/10% alerts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 21:52:49 -04:00
Andreas WredeandClaude Opus 4.8 b75b5b16c7 battery: van-battery daemon (low-charge Pushover alerts + safe shutdown)
While on battery (AC0/online=0), sends escalating Pushover alerts at 25/20/15%
and at 10% sends a final alert then `systemctl poweroff` (after shutdown_grace
so the alert flushes first). Edge-triggered per discharge episode; re-arms when
mains returns; plug-out already-low collapses to a single alert (no burst).

Pushover token+user live only in /etc/van-battery/pushover.json (0600), seeded
from pushover.json.example on first deploy and never committed. Missing/
placeholder creds disable sending but NOT the shutdown — running flat must
always power down safely. Publishes /run/van-battery/state.json. Stdlib only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 21:48:24 -04:00
Andreas WredeandClaude Opus 4.8 ef6c1ce182 thermal: van-thermal daemon (CPU+NVMe monitor, alert, log)
Single sysfs sample loop drives three jobs off one daemon (modeled on
van-failover):

- live state at /run/van-thermal/state.json; new Cockpit "Temperatures"
  card reads it in the existing 5s loop (no per-refresh `sensors` shell-out)
- journal alerts on ok<->warn<->crit crossings, with clear_margin hysteresis
- throttled, self-rotating CSV history at /var/log/van-thermal.csv

Sensors resolved by hwmon name+label (coretemp/Package id 0, nvme/Composite),
never by hwmonN index (not stable across boots). Defaults: CPU warn 80 /
crit 95, NVMe warn 65 / crit 70. deploy.sh installs + enables the service.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 21:32:13 -04:00
Andreas WredeandClaude Opus 4.8 35466f0141 power: keep wayback awake lid-closed (never-sleep)
wayback runs as an always-on router living lid-closed in the van, but
stock logind HandleLidSwitch=suspend would sleep it on lid close (even
on AC). Add a logind drop-in that ignores the lid in all states and
mask every sleep target so idle/GUI/stray `systemctl suspend` can't
suspend it either.

- power/10-vanlink-nolid.conf -> /etc/systemd/logind.conf.d/
- deploy.sh: install drop-in, mask sleep/suspend/hibernate/hybrid-sleep,
  restart systemd-logind
- README: power/ layout row, never-sleep operation notes + reversal recipe

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 21:16:59 -04:00
Andreas WredeandClaude Opus 4.8 387375de1e failover/boot: mask networkd-wait-online instead of RequiredForOnline=no
The previous fix (RequiredForOnline=no on the ZT link) could not work and the
~2min boot stall returned. systemd-networkd-wait-online (systemd 255) only
declares the network online when at least one managed, online-eligible link
goes routable. networkd here manages only the AP (wlxc…, local-only) and the ZT
overlay — and with the ZT link also marked RequiredForOnline=no (on top of the
AP link that already was), wait-online had zero candidate links and could never
satisfy "online", burning its full 120s timeout every boot. Journal confirmed:
"Timeout occurred while waiting for network connectivity" at exactly +120s,
gating network-online.target → zerotier-one (the recovery path).

Mask systemd-networkd-wait-online entirely — neither networkd link is a real
uplink, and real uplink readiness is already covered by NetworkManager-wait-online.
Wire the mask into deploy.sh, delete the now-dead RequiredForOnline=no drop-in,
and correct README §3/§5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 20:57:21 -04:00
Andreas WredeandClaude Opus 4.8 118f2f2f5e failover/boot: stop ZeroTier link from deadlocking network-online.target
systemd-networkd-wait-online waits for every managed networkd link to go
routable. The ZT link ztuga7c2kh only appears once zerotier-one starts, but
zerotier-one is ordered After=network-online.target — so wait-online blocked
on the not-yet-existing link until its 120s timeout, adding ~2min to every
boot and delaying ZeroTier (the recovery path).

Add a RequiredForOnline=no drop-in so the overlay link is excluded from the
gate; real uplink readiness is already covered by NetworkManager-wait-online
(networkd owns only the AP + ZT links here, neither a true uplink). Wire it
into deploy.sh and document the loop in README §3/§5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 20:44:26 -04:00
Andreas Wrede cc25dee7e2 initial commit 2026-06-28 15:09:28 -04:00
Andreas Wrede bd865831d6 first commit 2026-06-28 15:08:04 -04:00