MQTT & Wi-Fi: the bench becomes a network
420-302-VA · WEEK 9 · FALL 2026

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

ResourceWhat it isUse it when
mqtt.orgThe protocol's home: specification, FAQ, software directoryYou want the standard's own words on QoS, retained messages or wills
mosquitto.orgThe broker's documentation, including man pages for mosquitto_pub/mosquitto_sub and the configuration fileConfiguring listeners, reading client-tool flags, checking defaults
paho-mqtt on PyPIThe Pi-side library's reference, with the current (2.x) callback signatures and migration notesWriting or debugging the monitor; checking a callback's exact arguments
umqtt.simple in micropython-libThe node-side client's source and README: API, bytes convention, QoS 0/1 scopeChecking MQTTClient's methods, set_last_will, check_msg semantics
MicroPython: network.WLANThe Wi-Fi interface class used by connect_wifiStation vs AP mode, ifconfig, status codes
MicroPython ESP32 quick referenceWeek 8's bookmark, whose networking section now appliesOne-page reminders of the Wi-Fi and socket idioms
HiveMQ: MQTT EssentialsA broker vendor's tutorial series on the protocol, unusually careful and widely citedA second, longer-form pass over pub/sub, QoS, retained, LWT and keep-alive

Background reading, stage by stage

After reading…Deepen with
Publish & subscribeWikipedia: Publish–subscribe pattern and MQTT, the pattern in general and the protocol's history, versions and adopters
The brokerWikipedia: Transmission Control Protocol and Port (computer networking), what "a reliable connection to port 1883" actually names
The Pi listens, rung 4Wikipedia: 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 "#" -v running 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

TermMeaning
BrokerThe server that accepts every publish and routes it to matching subscribers; ours is Mosquitto on the Pi
ClientAny program holding a connection to the broker, publisher, subscriber, or both
Publish / subscribeSend a message to a topic / register interest in a topic filter; the pattern where producers and consumers never meet
TopicSlash-separated, case-sensitive message address: bench/s07/light
Topic filterA subscription pattern, possibly with wildcards
Wildcard+ matches exactly one level; #, legal only at the end, matches all below
PayloadThe message body, bytes on the wire; meaning is the designer's contract
QoS 0 / 1 / 2Delivery promises: at most once, at least once, exactly once, in rising cost
Retained messageThe 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-aliveThe heartbeat interval; silence past 1.5× marks the client dead and triggers its will
Port / 1883 / 8883TCP's numbered doors on a host; MQTT's standard door, and its TLS-encrypted one
TCPThe internet's reliable, ordered byte-stream transport; MQTT's carrier, and SSH's
Service / daemonA program supervised by the OS (systemd here): started at boot, restarted, logged; spoken to via systemctl
SSIDA 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
mipMicroPython's on-board package installer; fetched umqtt.simple over the node's own Wi-Fi
IdempotentSafe to apply twice; the property that makes QoS 1 duplicates harmless for commands
TelemetryMeasurements transmitted from remote equipment, the T MQTT was named for