Stage 6 of 6 · Lab session · Monday, November 2
Lab & hand-in
Today's lab has a strict dependency order, broker before node before monitor, so the timeline matters more than usual: a station stuck at a wall should call for help early, not nurse it. By the exit, your bench is a networked system and A2's telemetry rows are demonstrated or scheduled.
The two-hour plan
| Minutes | Block | Done means |
|---|---|---|
| 0–10 | Station up: both boards out, Pi booted, two SSH terminals open, repo pulled | hostname -I noted; Week 8 node sanity-checked over USB |
| 10–30 | The broker: install, service, both walls, UFW, loopback test | mosquitto_sub prints what mosquitto_pub sends; wildcard seen working |
| 30–50 | The node: config.py pattern, Wi-Fi up, umqtt in, publish loop | The terminal prints your station's light once a second; hand test passes |
| 50–70 | The Pi listens: paho in the venv, minimal subscriber, then LightMonitor | Python prints decoded percentages; callbacks are bound methods |
| 70–105 | The ladder: status + will, dark alert, then the command channel and beyond | Rungs 1–2 demonstrated; rung 3 reached by most stations |
| 105–115 | A2: demonstrate the brief's networking/telemetry rows; write docs/topics.md | Verification table rows checked off with the teacher, or scheduled |
| 115–120 | Evidence committed and pushed; bench packed | Both boards and the kit travel home: A2 finishes this week |
Evidence to hand in
Committed and pushed to your course repository by the end of the day:
- Node code:
net.py,lightnode.py, and the publishingmain.py, withconfig_example.pycommitted andconfig.pygit-ignored, the marker checks the.gitignoreline as seriously as the code. - Pi code:
lightmonitor.pyplus whatever ladder rungs you reached, each runnable. docs/topics.md: a short table of every topic your station uses, payload format, QoS, and retained yes/no, the namespace documented, Week 5's "write it down before it is folklore" applied to naming. If the A2 brief defines topics, record its scheme here and follow it.- Proof of flow: a screenshot or pasted transcript of
mosquitto_subshowing live readings (the hand-shadow dip makes it unmistakable), indocs/. - Journal entry in
station.txt: what wall you hit, how you read the failure (timeout vs refused counts), and the fix, this week's entries are precisely the midterm-log genre the final exam rewards.
Exit ticket
Say or write, without notes:
- The broker's job in one sentence, and why the node never addresses the Pi.
- Your station's three topics, and what
bench/+/lightmatches thatbench/s07/lightdoes not. - Why
sudo ufw allow 1883was necessary, in Week 3's own words. - QoS 0 versus QoS 1, and which this week's telemetry uses, with the reason.
- Why
config.pyis git-ignored whileconfig_example.pyis committed.
Before next Monday
- A2 finishes. The assignment is due Monday, November 9. Whatever remains of the brief's verification table after today, telemetry rows included, gets done at home against the three-week plan; the questions log travels with it.
- Re-run the system at home if you can. A 2.4 GHz network, the Pi's new
hostname -Iaddress intoconfig.py, and the whole bench reproduces; no home network, then the loopback half (broker + Pi subscriber +mosquitto_pubas a fake node) still exercises everything but the radio. - Journal while it is fresh: the wall you hit, the failure signature that named it, the fix.
Mind the calendar
The AE course-drop deadline is Tuesday, November 3, tomorrow after this class. And two weeks out, Week 11 (November 16) opens the LIA project phase with deliverable D1; arriving there with A2 closed and a working bench is the whole point of this fortnight.
Next week: closing the loop
Week 10 · Monday, November 9
Control: closing the loop
The PID lesson lands in full: error, the three terms, and tuning, then the bench closes its first real control loop, the controller's eyes being this week's telemetry and its hands Week 8's PWM. A2 is due at the start of class.
Why this week mattered
The infrastructure is permanent
Broker, topics, node, monitor: nothing built today is scaffolding. Week 10 subscribes to it, Week 11's Flask dashboard reads it, and the LIA project ships on it. You did not do an exercise this afternoon; you commissioned a system.