The accelerometer and gyroscope were logged and never used. They measure
nothing about weather, but they do measure the one thing about this station
that nothing else can see: whether the sensor is still where it was.
Measured over four and a half days on the real station, four genuine
movements each stepped the temperature by a median of 1.02 C, against an
ordinary fifteen minute change of 0.107 C with a 95th percentile of 0.841.
A move therefore lands past the 95th percentile of normal variation. The
heads carry about 55 hours of memory, so an undeclared move contaminates two
days of training with a discontinuity they will try to fit rather than ignore.
This now gets the same treatment set_environment gives a window being opened,
because it is the same event: the coupling between the sensor and what it is
measuring changed, and nothing in the data says so.
Three choices in here were made by measurement, and the obvious one was wrong.
Raw accelerometer looks like the natural input and is not. Over the same
record a gravity-vector detector fires 112 times against this one's 4, because
RTIMULib's gyro fusion removes exactly the desk vibration a bare accelerometer
picks up. The fused pitch and roll have a p99 sample-to-sample noise of 0.0001
degrees, so a one degree trigger carries four decades of headroom.
Yaw and compass are excluded. They are the only attitude outputs that depend
on the magnetometer, and indoors the magnetometer is measuring the building.
RTIMULib restarts its fusion from a default attitude when SenseHat is
reconstructed, which put an 18 degree step in the record on every one of this
station's seven service restarts. Without a settle window every deploy would
queue a retrain. 300 seconds rather than 180: one artifact appeared three
minutes after a restart, still converging. Replayed against the full record
the detector finds 4 genuine movements and leaks 0 artifacts.
Co-Authored-By: Claude Opus 5 <[email protected]>
Three things the hardware offers that the code ignored.
The joystick has never had a line of code. Left records a dry label, right a
wet one, middle cycles the LED scene, and a full-panel flash acknowledges the
press because a headless box gives no other sign and a button you cannot tell
worked gets pressed twice. Precipitation is the weakest head in the bank and
strong labels are its binding constraint: this station has 80 of them against
thousands of proxy ones, entirely because the only label control lives in a web
page, and a web page is not where anyone is standing when it starts raining.
The board has no RTC, so a power cut without a network gives a clock somewhere
in 1970 on the next boot. Solar elevation, the diurnal harmonics and a sample's
position on the 5-minute grid then all lie with complete confidence, and unlike
a gap in the record the damage cannot be identified afterwards. train() now
refuses a clock below 2025 or one that has stepped behind the newest stored
row, and logs the refusal rather than training on fiction.
Undervoltage and thermal capping both shift the SoC temperature, which is the
regressor in the self-heating compensation, so a weak power supply presents as
an unexplained temperature bias rather than as anything resembling a power
problem. get_throttled is now sampled hourly and logged when set.
Measured and deliberately not done: colour features. r, g and b are logged and
74% of rows carry usable colour, but adding blue/red, green/red and saturation
made MAE 1.50% worse and helped in only 13 of 72 cases. Three more regressors
on a 33-feature model whose longest horizon trains on 13 independent pairs is
straightforwardly overfitting. That also prompted a sweep of the RLS prior and
forgetting factor in both directions; delta = 100 with lambda = 0.9985 is a
local optimum on both axes, so neither moved.
Co-Authored-By: Claude Opus 5 <[email protected]>
Equality on the row count raced the live sample loop under TestClient, which
legitimately inserts rows mid-test. Now asserts no rows are lost, which is the
property that matters. Run three times to confirm it is stable.
1. POST /api/recompute re-derives every compensated column from the untouched
raw values, removing the step a calibration otherwise leaves through the
history. Possible because temp_raw, cpu_temp and hum are never overwritten.
Idempotent by construction and tested per row: 0 of 6051 rows change on a
second run. 6069 rows in 0.25 s here, so a few seconds on the Pi.
2. Calibration now emits a 'discontinuity' event alongside the calibration log,
so downstream views can find the boundary without parsing prose.
3. Vendored Tailwind, Chart.js, hammer, the zoom plugin, KaTeX with its 20
woff2 faces, and both Google fonts into ashvale/static, served by the
station. 1.4 MB. Verified with every non-localhost request aborted in the
browser: zero external requests, equations still render, fonts still load.
The dashboard no longer needs internet.
4. 54 pytest cases over the pure numerics: physics closed forms and round
trips, both compensator inverse properties, the Kalman covariance
invariants and NIS consistency, the RLS trace cap under a deliberately
unexcited regressor, conformal coverage, and the Zambretti ordering. Wired
into CI after the seed step so the recompute cases have history. Writing
them caught my own sign error on the conformal update: a hit raises alpha
and narrows the band, which reads backwards until you follow it through.
5. Stats for Nerds gains the condition number of each head's covariance, a
standardised innovation histogram per Kalman filter from a bounded 600
sample ring buffer, and a reliability strip of realised against nominal
coverage. All arithmetic on data already in memory.
6. OutdoorProbe reads a DS18B20 over the kernel 1-Wire driver, no new
dependency. Polled on its own slower cadence because the sensor blocks for
up to 750 ms during conversion, which would eat a third of the 2 s sample
budget. Rejects the 85000 power-on sentinel and out-of-range values, and
reports age so a dead probe cannot masquerade as fresh.