ShopLearnFluxgrid
Support
Lonely Binary
ESP32TinkerBlockProductsFundamentalsTools
AccountCart
MQTT
The post office3
01Why a post office02Topics03Subscribing
Sorting and keeping2
04Wildcards05Retained messages
Delivery2
06QoS 0 and 107QoS 2, and each hop
Staying connected3
08Keepalive09Last 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 →Four wires and a light6 articles
Lonely Binary

From Zeros to Heroes, One Bit at a Time.

Sydney, Australia · office@lonelybinary.com

Shop
BoardsKitsSensors & InputDisplaysBest SellersWholesale
Learn
ESP32TinkerBlockProduct handbooksFundamentalsDownloadsProduct codes
Fluxgrid
Get startedCheat sheetDocsLibrary on GitHubPrivacy policy
Help
Contact usDeliveryReturnsWarranty
© 2026 Lonely BinaryTermsRefund policy