Maker tech hub — AI · 3D print · Pi · ESP32 · plus the classic tech archive.

Free ESP32 kit · AI tools directory · Books · Archive

Guide · Intermediate · Raspberry Pi

Tool Review: Mosquitto as a Workshop MQTT Broker (Measured Lab Notes)

Review standard: see /review-standard. This page states a measurement protocol you should re-run on your Pi — do not invent latency numbers without a stopwatch/log. Versions & hardware under test ItemValue …

Review standard applies. This piece is held to versions, comparison/context, failure modes, and a verdict. Read the standard →

Written by

Avery J. Parker

IT veteran, maker educator, and author of Network Ninja, 3D Printing Mastery, and AI Workflow Mastery. Business IT: Diversified Tech Solutions.

Project template

  • Goal & materials
  • Steps / firmware
  • Troubleshooting
  • AI assist notes
  • Related gear & books

Review standard: see /review-standard. This page states a measurement protocol you should re-run on your Pi — do not invent latency numbers without a stopwatch/log.

Versions & hardware under test

ItemValue
BrokerEclipse Mosquitto (Debian/Ubuntu package class — pin mosquitto -h output in NOTES.md)
HostRaspberry Pi 4/5 class, Ethernet preferred
Clientsmosquitto_pub / mosquitto_sub + one ESP32 node
NetworkLAN only; WAN closed

What we compared against

  • Primary: Mosquitto on Pi for workshop labs
  • Alternatives not required for v1: EMQX, HiveMQ, cloud MQTT — overkill until auth and LAN discipline are boring

Measurement protocol (fill on your bench)

TestMethodPassYour result
Local looppub/sub on localhostMessage appears immediately
LAN RTT feelESP32 publish every 1s; sub timestampsStable 1 Hz stream, no multi-second gaps
Broker rebootrestart mosquitto serviceClients reconnect ≤2 min with backoff
Host rebootreboot PiBroker + one node recover without laptop babysitting
WAN closedscan from outside / cloud VPS1883/8883 not open

Security minimums (non-negotiable)

  • Password auth before any non-lab exposure
  • No anonymous WAN listener “for testing”
  • Unique credentials when you pass three devices

What broke / confused

  • ESP32 connects to Wi-Fi but not broker → wrong IP, wrong port, or AP isolation
  • “It worked until reboot” → no systemd enable / no client reconnect
  • Retained retained storms on command topics → simplify payloads; use TTL when ready

Export

Topic plan + payload examples: pi-esp32-mqtt-lab.zip

Review verdict

Mosquitto is the right default for a Pi workshop coordinator. It is not exciting — that is the point. Win reliability and closed ports before chasing clustering or cloud bridges.

Related: Pi + ESP32 mesh · home lab AI stack