A Cheap Yellow Display pointed at this site's own data instead of a third-party service -- no cloud weather API, no external dashboard, just the CYD's screen polling larsi.org's own weather and sensors APIs directly for one chosen station's latest readings. Belongs here under Sensor Network rather than the CYD's other Fun Projects entries, since it's live infrastructure monitoring, not a standalone toy.
Two Arduino sketches, cyd-larsi-org (not yet published), each a small read-only API
client:
Same CYD display wiring as the Internet Radio build
(GPIO 14/13/12 SPI, not the ESP32's default VSPI pins). WiFi credentials and the station to
display live in a gitignored secrets.h per sketch, copied from a committed
secrets.h.example template. Both verify larsi.org's TLS certificate against the same
curated 5-root CA bundle the sensor-node
library uses, copied in rather than pulled as a cross-repo dependency.
Weather and sensors already returned nearly the same shape for a station's channel list
(json/sensors.php?prefix=X -- label, property, unit, min/max, per channel), but only
weather had a reduced, ready-to-display "latest value" endpoint. Sensors' equivalent
(csv/data.php) only returned a raw time-windowed stream, leaving the client to reduce
it to "latest per channel" itself -- extra complexity (an NTP-synced time window) that didn't
belong in a display sketch.
Rather than build that reduction into SensorsStation, the API itself gained it:
weather/csv/current.php gained an optional prefix filter,
returning one station's latest reading as channel,value,epoch rows -- its existing
all-stations dump (what weather/index.php's map depends on) is
untouched when the filter is absent.sensors/csv/current.php is a new endpoint returning the same shape, computed
per channel via a MAX(epoch) join rather than weather's single shared-epoch
shortcut -- sensors' devices can go stale independently of each other, so each channel needs
its own latest-epoch lookup.With both sections speaking the same protocol (station prefix in, channel list from
json/sensors.php, latest values from csv/current.php), WeatherStation
and SensorsStation compile to byte-identical sizes -- they're now the same sketch in every way
that matters, differing only in which section's API they point at and the default station in
secrets.h.example. (The wire parameter stayed prefix rather than
renaming to station, matching every other endpoint sitewide -- only the sketches'
own local variable is named STATION_PREFIX.)
Looking closely at weather's channel list while doing this turned up 7 "predicted" channels
(16-22, meant for a forecast source) that nothing had ever actually logged to -- removed from the
display layer as a follow-on cleanup, along with confirming the one piece of harvester code that
would have written them (NDFD2, in the separate weather-tools repo) was
never actually scheduled to run.