Skip to content

P3.W2 (firmware half): waste bin-node reference firmware - #24

Merged
ocularminds merged 1 commit into
masterfrom
p3.w2-bin-firmware
Aug 17, 2026
Merged

ocularminds merged 1 commit into
masterfrom
p3.w2-bin-firmware

Conversation

@ocularminds

Copy link
Copy Markdown
Owner

Roadmap item

P3.W2, firmware half — the per-bin node that replaces the shared-gateway framing of P2.7 for this vertical. Compiles to a real ESP32 image (verified locally via PlatformIO in a sandboxed toolchain — 73 % flash, 14.5 % RAM — and now in CI with a cached toolchain).

What it implements

  • Full envelope per TELEMETRY.md: NVS-held Ed25519 identity, one-time-code enrollment, canonical-JSON signing with JSON.stringify-compatible number formatting (the sharp edge that would silently break signatures, documented), strictly monotonic seq, store-and-forward in RTC memory across deep sleep, and 409-after-lost-ack correctly treated as 'batch accepted'.
  • Median-of-5 ultrasonic sampling with per-bin calibration — the runbook's defense against bag/rain misreads, in code.
  • Bench mode (WiFi + NTP, 30 s cycle): desk-testable today against the compose stack with a $5 devkit — enroll from the provisioning manifest, watch it appear in fleet health and on the dashboard.
  • Field builds hit a deliberate #error at the cellular swap point (TinyGSM/SIM70xx documented) so a bench transport can't silently ship to the field.

Remaining for M4

Hardware procurement (runbook BOM), board-specific battery/tilt/temp hooks, install, 30-day run.

🤖 Generated with Claude Code

ESP32/PlatformIO implementation of the full platform envelope
(docs/TELEMETRY.md), compiled to a real image (verified locally and
now in CI with a cached toolchain):

- Ed25519 identity generated on first boot, held in NVS; one-time-code
  enrollment against /devices/enroll
- median-of-5 ultrasonic fill sampling with per-bin EMPTY/FULL
  calibration, clamped to 0-100%
- canonical-JSON signing with JSON.stringify-compatible number
  formatting (2dp, trailing zeros stripped) — the signature-breaking
  sharp edge, documented in the firmware README
- strictly monotonic seq in NVS; store-and-forward buffer in RTC
  memory across deep sleep; 409-after-lost-ack treated as accepted
- BENCH_MODE (WiFi + NTP, 30s cycle) for desk testing against the
  compose stack; field builds hit a deliberate #error at the marked
  TinyGSM cellular swap point so the bench transport cannot ship
- battery/tilt/temp left as marked hooks for the chosen board

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ocularminds
ocularminds merged commit 6d26554 into master Aug 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant