Chapter · MQTT
The post office
Why devices post to a broker instead of to each other, what goes on the envelope, and who gets a copy.
- 01Why a post office3 minA sensor that sends its reading straight to a phone has to know the phone's address, and breaks the day the phone moves. MQTT puts a post office in the middle, and every device needs only one address.
- 02Topics3 minAn MQTT message is addressed to a topic, a name for what it is about, never to a device. The broker sorts by that name alone, and a single wrong capital sends a reading where nobody is listening.
- 03Subscribing4 minA device tells the broker which topics it wants, and the broker copies every message on them to it. The sender never learns who is listening — and when nobody is, nothing tells it.
Start at 01 and read down — the order is the order things get easier in. Or take the one with your part in it; every article stands on its own, and links back to whatever it needs.