Evaluate swarm readiness records
Compare freshness, battery reserve, route continuity, and leader changes in four virtual UAV records.

Blueprint Bina: I want you to justify each readiness decision from the record instead of trusting the scenario name.
Predict the reading, then compare it with the measurement.
Wokwi ESP32
Third party ToolCompare freshness, battery reserve, route continuity, and leader changes in four virtual UAV records.
Open the ESP32 editor, paste diagram.json, then paste sketch.ino.
Open Wokwi to paste in the files (new tab)Get the files
Use both prepared files. This is a paste-in setup; saving a project requires a Wokwi account.
sketch.ino
- Use the launch button above to open the ESP32 editor in Wokwi.
- Select the editor’s diagram.json tab and replace all its text with the supplied diagram.json.
- Select the sketch.ino tab, replace all its text with the supplied sketch.ino, then click Start Simulation.
Steps
Step 1
- Do
- Paste the supplied diagram.json and sketch.ino into Wokwi ESP32. Inspect the Node structure before starting.
- You will see
- The diagram contains one ESP32 and serial connections; each virtual node has id, role, battery, linkAge, leader, and routeOk fields.
- Why it matters
- The host treats coordination as explicit state and role ownership. This program models records, not flying aircraft or a radio network.

Step 1 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab) Step 2
- Do
- Start the simulation at 115200 baud and read RUN 1 SCENARIO normal-mesh.
- You will see
- Node 0 reports promote-leader; node 3 reports 3 edge 42 7 no ok hold-stale-link.
- Why it matters
- The supplied baseline already has a stale edge link because 7 exceeds the rule’s limit of 5. A scenario name cannot establish readiness.

Step 2 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab) Step 3
- Do
- Read the node 3 row under RUN 2 SCENARIO stale-edge-link.
- You will see
- 3 edge 42 9 no ok hold-stale-link shows linkAge changing from 7 to 9 while the decision remains hold-stale-link.
- Why it matters
- Freshness can block promotion even when the route field says ok. The host requires neighbor state to be current enough for its decision.

Step 3 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab) Step 4
- Do
- Read node 2 under RUN 3 SCENARIO low-relay-reserve.
- You will see
- 2 relay 24 3 no ok revise-low-reserve shows reserve below the gate of 30.
- Why it matters
- Relay ownership needs an energy constraint as well as connectivity. The host’s task-allocation record should explain why a relay must be replaced.

Step 4 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab) Step 5
- Do
- Read RUN 4 SCENARIO leader-change-route-gap and compare nodes 1 and 3.
- You will see
- Node 1 reports promote-leader. Node 3 has route gap but still reports hold-stale-link because freshness is checked before route continuity.
- Why it matters
- The order of policy checks determines the reported reason. A leader flag change alone does not repair stale or disconnected state.

Step 5 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab) Step 6
- Do
- Stop. Change node 3’s initial linkAge from 7 to 2 and the later swarm[3].linkAge assignment from 9 to 2. Restart.
- You will see
- Node 3 is promote in the baseline, then reject-route-gap in RUN 4.
- Why it matters
- Changing only freshness exposes the independent route gate. This separates causes before trying combined failure scenarios.

Step 6 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab) Step 7
- Do
- Stop. Change swarm[2].battery = 24 to swarm[2].battery = 35 and restart.
- You will see
- Node 2 now reports promote in RUN 3 because its reserve, link age, and route all pass.
- Why it matters
- The host’s reassignment decision should cite the state that changed. This controlled revision tests a reserve threshold without claiming measured aircraft endurance.

Step 7 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab) Step 8
- Do
- Restore the supplied sketch and restart to preserve a reproducible reference run.
- You will see
- The original stale-edge and low-reserve decisions return; RUN 4 again shows a route gap masked by the stale-link reason.
- Why it matters
- The final coordination record should preserve the scenario, changed field, evidence, and next revision. The model omits payload queues and acknowledgements that the host requires for an actual mission.

Step 8 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab)
Chapter checks
These questions refer to the chapter’s examples. Use the return links to review their answers.
A standby UAV can reach an uncovered search lane, but its image queue is nearly full and gateway freshness is weak. Urgent status from the lane is still required. Which coordination record is most defensible?
Return to the chapter’s knowledge checkA four-UAV search sweep loses one lane owner, the remaining UAVs still hear each other, the ground link is weak, and bulk imagery can wait. Which first record keeps the coordination decision traceable?
Return to the chapter’s knowledge check