Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
The relay's minute sample records pi:temp and pi:undervolt from the arm's GET /health/pi into facts (no chart) #551
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
The relay's minute sample now records the Pi's temperature and under-voltage flag from the arm's GET /health/pi. I ran bun test src/facts.test.ts src/relay.test.ts (36 pass) and have pushed. I did not run bun --cwd Software/so101 test, the full suite.
shipped merged
The relay's minute sample now records the Pi's temperature and under-voltage flag from the arm's GET /health/pi. I ran bun test src/facts.test.ts src/relay.test.ts (36 pass) and have pushed. I did not run bun --cwd Software/so101 test, the full suite. tsc --noEmit couldn't resolve the bun type definitions in this sandbox, so I have no type-check result.
- Sampling: before each sample, the relay fetches
/health/pifrom the live arm (or the simulation) with a timeout of at most 1 s. If the arm is unreachable, slow, non-OK or answers nulls, the sample lands without those two values. - Storage:
samplesgains nullablepi_tempandpi_undervoltcolumns, added to an existingfacts.sqliteon open.samples()returnspiTempandpiUndervoltonly when they were recorded. A newparsePiHealthinsrc/facts.tskeeps only a finitetempCand a booleanunderVoltage. The wiring is insrc/relay.ts. - Tests: in
src/facts.test.ts, a fake arm gives a sample with both values. An unreachable arm, a null answer and a 404 each give a sample with neither value and the other fields intact. - Scope: there is no page or chart change.
Does what #540/#539 left open and nothing more: the minute sample stores pi_temp and pi_undervolt from the arm GET /health/pi. No page, no chart, no dependency. The fetch follows the same pattern as the neighbouring arm reads (1 s cap, no-store, errors swallowed). parsePiHealth keeps only a finite number and a boolean. The new columns are added by migration and are nullable. The tests cover the stored values and the unreachable, null and 404 cases. The preview answers 200. Two things to do next: (1) run the full bun test and tsc, which the builder did not run; (2) sample timestamp is taken after the up-to-1s fetch, so take it before the await if exact minute alignment matters.
The relay's minute sample now records the Pi's temperature and under-voltage flag from the arm's
GET /health/pi. I ranbun test src/facts.test.ts src/relay.test.ts(36 pass) and have pushed. I did not runbun --cwd Software/so101 test, the full suite.tsc --noEmitcouldn't resolve thebuntype definitions in this sandbox, so I have no type-check result./health/pifrom the live arm (or the simulation) with a timeout of at most 1 s. If the arm is unreachable, slow, non-OK or answers nulls, the sample lands without those two values.samplesgains nullablepi_tempandpi_undervoltcolumns, added to an existingfacts.sqliteon open.samples()returnspiTempandpiUndervoltonly when they were recorded. A newparsePiHealthinsrc/facts.tskeeps only a finitetempCand a booleanunderVoltage. The wiring is insrc/relay.ts.src/facts.test.ts, a fake arm gives a sample with both values. An unreachable arm, a null answer and a 404 each give a sample with neither value and the other fields intact.Closes #545