Utility · for the week and after
Resources
MQTT's documentation culture is excellent: the standard, the broker and both client libraries all keep canonical references. Bookmark these four first; they serve to the end of term.
References you will actually use
| Resource | What it is | Use it when |
|---|---|---|
| mqtt.org | The protocol's home: specification, FAQ, software directory | You want the standard's own words on QoS, retained messages or wills |
| mosquitto.org | The broker's documentation, including man pages for mosquitto_pub/mosquitto_sub and the configuration file | Configuring listeners, reading client-tool flags, checking defaults |
| paho-mqtt on PyPI | The Pi-side library's reference, with the current (2.x) callback signatures and migration notes | Writing or debugging the monitor; checking a callback's exact arguments |
| umqtt.simple in micropython-lib | The node-side client's source and README: API, bytes convention, QoS 0/1 scope | Checking MQTTClient's methods, set_last_will, check_msg semantics |
| MicroPython: network.WLAN | The Wi-Fi interface class used by connect_wifi | Station vs AP mode, ifconfig, status codes |
| MicroPython ESP32 quick reference | Week 8's bookmark, whose networking section now applies | One-page reminders of the Wi-Fi and socket idioms |
| HiveMQ: MQTT Essentials | A broker vendor's tutorial series on the protocol, unusually careful and widely cited | A second, longer-form pass over pub/sub, QoS, retained, LWT and keep-alive |
Background reading, stage by stage
| After reading… | Deepen with |
|---|---|
| Publish & subscribe | Wikipedia: Publish–subscribe pattern and MQTT, the pattern in general and the protocol's history, versions and adopters |
| The broker | Wikipedia: Transmission Control Protocol and Port (computer networking), what "a reliable connection to port 1883" actually names |
| The Pi listens, rung 4 | Wikipedia: JSON, the structured-payload format the dashboard era will standardize on |
Practice between classes
- Topic-design drills. Sketch namespaces for: a greenhouse with 12 benches of 4 sensors; a building's HVAC per floor and room; your LIA project idea. For each, write the one wildcard subscription a dashboard would use, and the one a single-zone controller would.
- QoS reasoning. For five messages, a light reading, a "pump on" command, a daily totals report, a fire alarm, a firmware-update notice, choose a QoS level and defend it in one sentence each.
- Re-run the bench end to end from memory: broker checks, node up, monitor up, one ladder rung re-demonstrated. The sequence is Week 10's first ten minutes.
- Explore with the firehose. Leave
mosquitto_sub -t "#" -vrunning during all of it and watch your own system gossip; surprises found here are bugs found early. - A2. The brief's remaining verification rows, finished at home, due Monday, the plan's final week.
Glossary
| Term | Meaning |
|---|---|
| Broker | The server that accepts every publish and routes it to matching subscribers; ours is Mosquitto on the Pi |
| Client | Any program holding a connection to the broker, publisher, subscriber, or both |
| Publish / subscribe | Send a message to a topic / register interest in a topic filter; the pattern where producers and consumers never meet |
| Topic | Slash-separated, case-sensitive message address: bench/s07/light |
| Topic filter | A subscription pattern, possibly with wildcards |
| Wildcard | + matches exactly one level; #, legal only at the end, matches all below |
| Payload | The message body, bytes on the wire; meaning is the designer's contract |
| QoS 0 / 1 / 2 | Delivery promises: at most once, at least once, exactly once, in rising cost |
| Retained message | The topic's broker-stored last word, delivered immediately to every new subscriber |
| Last will (LWT) | A message lodged at connect time that the broker publishes if the client vanishes ungracefully |
| Keep-alive | The heartbeat interval; silence past 1.5× marks the client dead and triggers its will |
| Port / 1883 / 8883 | TCP's numbered doors on a host; MQTT's standard door, and its TLS-encrypted one |
| TCP | The internet's reliable, ordered byte-stream transport; MQTT's carrier, and SSH's |
| Service / daemon | A program supervised by the OS (systemd here): started at boot, restarted, logged; spoken to via systemctl |
| SSID | A Wi-Fi network's broadcast name; the ESP32 joins 2.4 GHz networks only |
| Station mode (STA_IF) | The radio joining an existing network, versus access-point mode broadcasting one |
| mip | MicroPython's on-board package installer; fetched umqtt.simple over the node's own Wi-Fi |
| Idempotent | Safe to apply twice; the property that makes QoS 1 duplicates harmless for commands |
| Telemetry | Measurements transmitted from remote equipment, the T MQTT was named for |