Skip to main content

Rpi Rtc

@aaronge/rpi-rtcv2026.11.05.2· 16d agoBEHAVIORSWORKFLOWS
01README

Raspberry Pi 5 onboard RTC telemetry (system-vs-RTC clock drift, coin-cell battery voltage) via sysfs, as a typed, versioned Swamp model — catches a dead RTC battery before it costs you the system clock across a power cut.

02Release Notes

New batteryFitted global argument: declare false on a board with no RTC coin cell and the workflow skips the low-battery check. batteryPresent now reports that declaration.

03Behaviors1
@aaronge/rpi-rtcv2026.08.26.1rpi_rtc.ts

Global Arguments

ArgumentTypeDescription
rtcDevicePath?stringsysfs path to the RTC device. The Pi 5's onboard RTC is deterministically
timedatectlPath?stringPath to the timedatectl binary. Override for odd installs.
batteryFitted?booleanWhether an RTC coin cell is fitted, as declared by whoever set up
fn readRtc()
Read since_epoch/hctosys/name/battery_voltage from the RTC

Resources

rtc(infinite)— System-vs-RTC clock drift and RTC coin-cell battery voltage,
04Workflows1
@aaronge/rpi-rtc02bcbe13-5a81-424d-9122-4c9b9b1410f2

Read RTC drift and coin-cell battery voltage from rtc-local and assert two thresholds: drift stays under driftWarnSeconds (a few seconds is normal, minutes means trouble), and batteryVolts — when readable — stays above lowBatteryVolts. The battery check passes without comparing when batteryVolts is null (no battery instrumentation) or when batteryPresent is false, meaning the model's batteryFitted argument declares that no coin cell is fitted. The hardware can't tell "no cell" from "dead cell",

collectRead RTC drift and battery state.
1.readRtcrtc-local.readRtc
assertFail the run when drift or battery voltage crosses a threshold.
1.drift-within-bounds
2.battery-not-low
reportPrint a one-screen summary. Depends on collect only (not assert), so it still runs when an assertion fails.
1.summarize
05Previous Versions2
2026.11.05.1

Ship the workflow in the package so a single ops repo can pull it and run it under swamp serve's own scheduler.

Added 1 workflows

2026.08.26.1
06Stats
A
93 / 100
Downloads
33
Archive size
9.2 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License1/2partial

    no SPDX license declared

  • Verified public repository2/2earned
07Platforms