Think of MQTT as a bulletin board in the cloud: your board "posts" a note under a labeled topic (like home/sensors/temperature), and any other device that's "subscribed" to that topic instantly gets a copy — no need to know each other's address or be online at the same moment. This publish-subscribe pattern is the standard way real IoT products (smart plugs, thermostats, industrial sensors) talk to the cloud, because it's lightweight enough to work even over a slow or unreliable connection.
1. Real-World Uses
MQTT is the backbone of most "real" IoT products you've heard of:
- Home automation — connecting a project to Home Assistant, so a DIY sensor or switch shows up alongside your real smart-home devices.
- Cloud dashboards — publishing sensor readings to AWS IoT Core or Azure IoT Hub so they show up on a live graph, viewable from anywhere.
- Many-to-many device networks — unlike ESP-NOW (Section 7.2), which is one board talking directly to another, MQTT lets dozens of boards publish and subscribe to shared topics through one central broker — a much better fit for a whole house or building full of sensors.
- Remote control over the internet — publish a command to a topic like
home/lights/setfrom anywhere in the world, and any subscribed device acts on it instantly.
2. Specifications & Port Standards
- Compatible Boards: ESP32, ESP8266, Pico W, Pico 2 W.
- Requires Wi-Fi: this extension needs the Wi-Fi extension (Section 7.1) to already be connected — MQTT rides on top of a normal internet connection, it doesn't have its own radio protocol like ESP-NOW or Bluetooth.
- Ports: Port
1883(Standard TCP), Port8883(SSL/TLS encrypted for AWS IoT / Azure). - Quality of Service (QoS): QoS 0 (At most once — fire and forget), QoS 1 (At least once — the broker confirms receipt).
