§2.1 · Stages
A reading takes the same path on both sides up to the broker, then diverges:
- Sample. ESP32 reads its I²C / ADC sensors at the configured cadence.
- Publish. Sample is published over Wi-Fi to the Pi-local Mosquitto
broker on a topic of the form
home/{node_id}/{metric}. - Edge sink. A Pi-local subscriber writes to a SQLite ring buffer and computes derived metrics in-process. No cloud dependency.
- Cloud sink. The Pi-local
mqtt-bridgesubscriber forwards the same MQTT topics to AWS Aurora Serverless v2 via a thin Lambda ingest (POST /home/sensor-datawithx-api-key). - Durability. Aurora row is written; daily archival job (separate
Lambda,
archival-broker) freezes a day’s rows into NDJSON.gz on S3.
DRAFT — sequence diagram pending §2 finalisation.
§2.2 · MQTT contract
| Topic | Direction | Payload |
|---|---|---|
home/{node_id}/temp | ESP32 → broker | {"value": 22.4, "ts": "..."} |
home/{node_id}/humidity | ESP32 → broker | {"value": 47.1, "ts": "..."} |
home/{node_id}/moisture | ESP32 → broker | {"value": 41.0, "ts": "..."} |
home/{node_id}/cmd/water | broker → ESP32 | {"duration_sec": 15} |
home/{node_id}/heartbeat | ESP32 → broker | {"uptime": 12345, "rssi": -56} |
DRAFT — full topic catalogue + retained-message policy by 2026-07.
§2.3 · Aurora schema (read-only excerpt)
The cloud path’s relevant table is home_sensor_readings. Schema is
stable and versioned via @scraper/db’s schema.ts. Public exporter
(PLN-003) reads from the same table and emits gap-aware JSON to S3 for
the live dashboard.
CREATE TABLE home_sensor_readings (
id BIGSERIAL PRIMARY KEY,
recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
node_id TEXT NOT NULL,
stable_id TEXT, -- IDENT-001 phase
temp_c DOUBLE PRECISION,
humidity_pct DOUBLE PRECISION,
moisture_pct DOUBLE PRECISION,
raw JSONB -- full sensor envelope
);
raw::jsonb is intentionally not included in the public exporter
output (per ADR-010). The methodology dataset uses the same scrubbed
shape as the public dashboard, with the same gaps treated the same way.
DRAFT — full DDL + retention policy detail by 2026-07.
§2.4 · Cadences
Default sampling cadences, all configurable per-node via Aurora’s
scraper_configs table:
| Node | Sensors | Default cadence |
|---|---|---|
| esp32-1 | BME280 + soil + valve | 60s |
| esp32-2 | BME280 + BH1750 + CO₂ | 30s |
| esp32-3 | BME280 + soil | 60s |
Lambda ingest is asynchronous; cloud-write latency does not back up the ESP32. If the hub is offline, samples queue at the broker (volatile, non-persistent for v1).
DRAFT — quantified back-pressure behaviour during simulated WAN flap pending §3.5 confounder analysis.
§2.5 · Why two sinks?
The methodology question (§3.1) is answerable only if both paths see the same MQTT events. Edge and cloud are not alternatives in the production rig — they are parallel processors of the same publish stream during the measurement window. After the measurement window ends, the chosen path stays in production and the other is decommissioned for that variable.
Status: structural draft v0.1, 2026-05-07. Citation:
https://plantir.garden/thesis/2026/pipelineis locked per ADR-011. Related ADRs:docs/adr/006-aurora-serverless.md,docs/adr/008-node-architecture.md.