BUILD NOTES
Flashing and first boot
USB once. OTA forever. Unplug test last and not optional.

Applies to the hub, the DSC-Control panel, the soil probes and the Sonoff plugs. A kit's SD image already carries the binaries and their secrets; the Setup wizard flashes them over USB.
Problem
A board that boots into a guess is not adopted.
Build
Kit path: Setup › USB flash on the Pi, in order hub, panel, probes, then Sonoffs. Bench path: esphome run dsc-hub-kit.yaml from firmware/v4 (ESPHome 2026.6.5 or newer) with your own secrets.yaml.
Result
The hub opens DSC-Setup-XXXX, the fleet joins your Wi-Fi, and stopping the brain drops every Sonoff within 90 s.
How it works
Secrets
API, OTA and setup-hotspot passwords plus the ESP-NOW key. The kit card carries the hotspot passwords. Names only here. Values never; rotate anything that ever sat in a chat paste.
Validate
Tolerant YAML parse, esphome config with dummy secrets. A full PlatformIO compile failing offline is an environment limit, not a config fault.
First boot (hub)
Heartbeat grace, safe-boot ventilation (or persisted manuals), boot-resume prompt after a mid-photoperiod cut, SNTP Australia/Sydney.
Adopt
The brain finds the fleet in Kit › Inventory. Later updates go over the air from Settings › Devices › Firmware. Then stop the brain and watch the Sonoffs drop within 90 s.
Diagram
Milestones
- 1. Write secrets locally
- 2. Config check
- 3. USB flash
- 4. Adopt
- 5. Unplug
Cost band + next
Firmware files stay on Firmware releases, next to the flash notes.
You are live when the last test passes. Not before.
