Mission
Build this
Build a physical clinic that tracks expected periodic evidence from selected nodes, separates late from silent, and raises one calm flag for a documented outage.
Borrowed parts are labelled below and have a fallback. The registered device ID is fixed; sensing and behaviour decisions remain yours.
Bill of materials
Parts
| Source | Part | Fallback |
|---|---|---|
| ● kit | OLED | — |
| ● kit | RGB LED and 220 Ω resistors ×3 | — |
| ● kit | Active buzzer module | — |
| ● kit | SG90 servo | — |
Disconnect USB before rewiring. Motors, the relay, and the servo need appropriate power and a shared ground. Never drive an actuator from the ESP32 3V3 pin.
Backup assignment · your invitation
Become useful when everyone else’s project becomes mysterious
Spine Doctor watches a small, declared set of garden devices and asks whether their expected evidence is still arriving. It shows who is timely, who is late, and who has crossed a documented silence limit.
The danger is false confidence. A quiet status topic may belong to a healthy device whose state has not changed. A chatty device may be online while publishing nonsense. Your monitor must say exactly which kind of health it observes.
“No expected message arrived” is an observation. “The sensor is broken” is one possible diagnosis.
The central idea
Online, fresh, and correct are three different claims
Can it reach the garden?
Broker and backend evidence may show recent communication.
Did expected data arrive?
A periodic topic can be compared with its documented interval.
Does the value make sense?
This needs project-specific validation that Spine Doctor usually does not possess.
Your required claim is freshness for selected periodic topics. Status messages provide useful context, but because many publish only when state changes, silence on status alone is not evidence of failure.
Write the care plan
Every monitored device deserves its own clock
| Device | Periodic topic | Expected interval | Grace | Late after | Why this topic? |
|---|---|---|---|---|---|
| gm-01 | …/temperature | 60 s | ___ s | ___ s | regular climate reading |
| cc-01 | …/temperature | 5 min | ___ min | ___ min | regular compost reading |
| team chooses | … | ___ | ___ | ___ | ___ |
A counter may remain unchanged for hours. A warning status may remain ok for days. Choose a periodic measurement or make an explicit heartbeat agreement with that team.
Wiring
Build a calm clinic, not a permanent alarm
Show monitored devices and message ages on the OLED before adding the flag. Use colour and one brief sound only when the overall state changes; repeated beeping does not improve diagnosis.
The power rule: The OLED, RGB logic, and verified buzzer module use 3V3. Each LED colour needs 220 Ω. The servo uses a separate 5 V supply. Join all grounds.
Bench referenceOpen the exact wiring map
| ESP32 pin | Part | Part marking | Carries |
|---|---|---|---|
3V3 | OLED (SSD1306) | VCC | 3V3 power |
GND | OLED (SSD1306) | GND | Ground |
GPIO 21 | OLED (SSD1306) | SDA | I²C bus |
GPIO 22 | OLED (SSD1306) | SCL | I²C bus |
GPIO 25 | RGB LED | R via 220 Ω | Digital in/out — common-cathode LED; invert for common-anode |
GPIO 26 | RGB LED | G via 220 Ω | Digital in/out |
GPIO 27 | RGB LED | B via 220 Ω | Digital in/out |
GND | RGB LED | common cathode | Ground |
GPIO 33 | Active buzzer module | SIG | Digital in/out — brief transition cue only |
3V3 | Active buzzer module | VCC | 3V3 power |
GND | Active buzzer module | GND | Ground |
GPIO 18 | SG90 servo | signal (orange) | PWM to actuator — system flag |
external 5 V | SG90 servo | power (red) | 5V power — separate supply |
GND | SG90 servo | ground (brown) | Ground — join servo and ESP32 grounds |
Never power the servo from ESP32 3V3. Confirm the buzzer type and current before wiring. A health monitor must remain quiet enough for teams to leave it running.
- 3V3 power
- Ground
- I²C bus
- Digital in/out
- PWM to actuator
- 5V power
The map assumes a common-cathode RGB LED and small three-pin active-buzzer module. Invert RGB logic for common-anode hardware.
Give silence a fair trial
Late should come before silent
No baseline exists. Do not count the device alive or failed.
Expected messages arrive inside the documented interval plus grace.
The expected time has passed. Show uncertainty before raising the flag.
A longer evidence threshold is crossed. Raise the flag once.
A new valid message arrives. Record recovery delay and lower the flag.
Your team decides:
- How much grace reflects real network variation rather than wishful waiting?
- Does one silent node make the overall status warning or error?
- How are “never seen” and “was seen, now silent” displayed differently?
- What evidence is required before a recovered node rejoins the alive count?
Your controlled outage ward
Break one known connection at a time
- Collect a healthy baseline.
Run the selected devices through enough expected intervals to measure ordinary message delay and occasional gaps.
- Schedule short and long outages.
With the owning team present, disconnect one test device for durations below and above its thresholds.
- Record the complete response.
Measure late detection, silent detection, false alarms on other nodes, and recovery after the first valid message.
- Repeat after one rule change.
Use the same outage script so lower false alarms cannot hide a much slower diagnosis.
| Device | Planned outage | Late delay | Silent delay | Recovery | Other false alarms |
|---|---|---|---|---|---|
| gm-01 | ___ min | ___ s | ___ s | ___ s | ___ |
| cc-01 | ___ min | ___ s | ___ s | ___ s | ___ |
| short outage | below threshold | ___ | no | ___ | ___ |
When the doctor misdiagnoses the garden
Disagreement tells you which health model you built
A healthy event counter is declared dead
The monitored topic publishes only when something happens. Replace it with a periodic topic or negotiate a periodic heartbeat.
Every node fails at the same moment
The shared network, broker, or Doctor itself may be unavailable. Publish an error for the monitor’s own connection instead of blaming every patient independently.
The flag chatters during brief delays
The grace region is too narrow or has no late state. Measure normal arrival variation before changing thresholds.
The dashboard says alive while Doctor says silent
They may observe different messages or use different timeouts. Compare the exact last-seen times and definitions before calling either wrong.
A recovered node leaves the alarm raised
The overall state or alive count was not recomputed after its valid message. Derive all outputs from one current patient table.
Choose your systems question
What kind of Doctor team will you become?
The fairness designers
Build device-specific expectations and show why one universal silence timeout rewards chatty nodes and punishes slow ones.
The outage scientists
Make detection delay, recovery, and false alarms the experiment across a carefully scripted set of failures.
The model comparers
Compare Doctor, dashboard last-seen state, and API health. Explain disagreements through definitions and observation points.
A calm way through the build
Collect four small wins
sd-01says hello.Prove the monitor can report its own status first.
- One periodic topic shows a growing message age.
Record arrival time without using a blocking timer.
- One short outage becomes late, not dead.
Add grace and a patient-specific silence threshold.
- One long outage and recovery move the flag once each.
Add the remaining patients, then run the fixed script.
The garden handshake
Share what you found
These names are the rigid part of the project. They let another team find your work without knowing what you called the variables in your code.
Patients currently fresh
garden/workshop/spine-doctor/sd-01/nodes-aliveUnit: devices
Monitor operating state
garden/workshop/spine-doctor/sd-01/statusUnit: enum
Listen beyond your own device.
garden/+/+/+/statusWildcard status messages provide declared state context, not a universal heartbeat. Determine aliveness from selected periodic topics or explicit heartbeat agreements with documented intervals.
Finish line
Ready to introduce to the garden
sd-01 stays online and publishes fresh-node count every minute plus a registered monitor status.
The reject feed stays clear after the final code starts.
Each monitored node has a documented periodic evidence topic, expected interval, grace, and silence threshold; on-change status is not treated as heartbeat.
Display, light, brief cue, and flag derive from one patient table without blocking messages or repeating alarms.
The build log contains a healthy baseline, planned short and long outages, late and silent detection delays, recovery time, false alarms, and a repeated script after one change.
The monitor distinguishes its own network failure from patient silence, the servo is safely powered, sound is restrained, and the label can be scanned.
Spine Doctor is trustworthy when its alarm names the evidence it lost, the clock it expected, and the limits of the diagnosis—not merely the device it suspects.