LBLonely Binary Learn
ESP32TinkerBlockProductsFundamentalsTools
Shop
MQTT
The post office3
§All 3 in brief01Why a post office02Topics03Subscribing
Sorting and keeping2
§All 2 in brief04Wildcards05Retained messages
Delivery2
§All 2 in brief06QoS 0 and 107QoS 2, and each hop
Staying connected3
§All 3 in brief08Keepalive09Last will10Postcards and strangers
All fundamentals →
Fundamentals/MQTT/Staying connected
Chapter · MQTT

Staying connected

How the broker knows a device is still there, what it says when one vanishes, and who it lets in.

3 articlesabout 12 minutesNo board required
  1. 08Keepalive4 minAn MQTT connection stays open for days, and the broker cannot see down it. So an idle device checks in every keepalive interval, and the broker hangs up after one and a half intervals of silence.
  2. 09Last will4 minPull the plug on a sensor and its phone goes on showing the last reading, looking perfectly normal. A last will is a message the device leaves with the broker to be posted for it if it vanishes.
  3. 10Postcards and strangers4 minA broker takes messages from anyone who can reach it, and plain MQTT carries everything, the password included, as readable text. Usernames keep strangers out; TLS seals the envelopes.

Start at 08 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.

← Previous chapterDelivery2 articlesNext chapter →Soldering2 articles
Lonely Binary Learn · Sydney, AustraliaHomeBlocksManualsESP32-S3 bookCompare chipsDownloadsProduct codesSearchCommunityRSSFluxgridShop