Files
svc-core/deploy/yukart-orin-status.service
T
mikkeli f77676f1e2
/ crosscheck (push) Successful in 0s
Rust (L4T) / Clippy, test, build, glibc (push) Successful in 14s
orin-status: clean poweroff when the UPS pack stays low while discharging
--poweroff-below V --poweroff-after N (deployed: 11.0 V, 30 readings at 1/s).
Charging or a missing reading restarts the count. Publishes 'stopping' first;
poweroff through svc-gw's polkit grant, no sudo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
2026-10-14 08:32:17 +09:00

22 lines
819 B
Desktop File

[Unit]
Description=Yukart orin-status: the Orin's own health on the bus
Documentation=gitea:yukart/svc-core
# Tier 2. Ordered after the broker and nothing else; it reconnects by itself if the broker restarts.
After=mosquitto.service
StartLimitIntervalSec=0
[Service]
User=mikkeli
# The UPS INA219 is on /dev/i2c-7, group i2c.
SupplementaryGroups=i2c
# The ELM's address, for elm_connected; without the file nothing is reported.
EnvironmentFile=-/etc/default/yukart-elm
# Below 11.0 V while discharging for 30 s (about 10 % left at the Orin's load): power off
# cleanly, through the polkit grant svc-gw installs (50-yukart-gw-power.pkla), not sudo.
ExecStart=/usr/local/bin/yukart-orin-status --elm ${ELM_ADDR} --poweroff-below 11.0 --poweroff-after 30
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target