MQTT

MQTT is a lightweight publish and subscribe messaging protocol in which devices send messages to topics on a central broker, which delivers them to every subscriber. It is an OASIS standard, in versions 3.1.1 (also ISO/IEC 20922) and 5.0, and is widely used for IoT telemetry. Delivery guarantees are set per message with three quality-of-service levels.

How it works

Clients keep a connection to a broker, publish messages to named topics, and subscribe with topic filters. QoS 0 delivers at most once, QoS 1 at least once, and QoS 2 exactly once, at the cost of more round trips.

For clients that disconnect, a persistent session (clean session off in 3.1.1, a session expiry interval in 5.0) makes the broker keep the client's subscriptions and queue QoS 1 and 2 messages for it until it reconnects. A retained message on a topic is stored and sent to new subscribers.

Why it matters

Small headers and long-lived connections suit constrained devices on unreliable networks, which is why MQTT is a default for sensor data, fleet telemetry, and industrial monitoring.

It assumes a broker is reachable. What a device publishes while it cannot reach the broker depends on the client library's own buffering, and devices cannot exchange messages with each other without the broker.

How it relates to Offline Protocol

Offline Protocol's telemetry is opt-in runtime observability that the SDK batches and uploads itself, and messages between devices travel over the mesh with store-and-forward, so devices do not need a broker in reach to talk to each other.

The two can work together: an app can publish to an MQTT broker when it has a connection and use the mesh between devices when it does not. See delay-tolerant networking.

Frequently asked questions

What are MQTT QoS levels?

QoS 0 delivers a message at most once, QoS 1 at least once, and QoS 2 exactly once. Higher levels add acknowledgments and round trips.

Does MQTT work offline?

Not without a broker. A persistent session lets the broker queue QoS 1 and 2 messages for a client that is away, and client libraries can buffer what a device publishes while offline, but devices cannot reach each other without the broker.

Is MQTT the same as a mesh?

No. MQTT is hub and spoke: every message goes through a broker. A mesh passes messages between devices directly or through other devices, with no central broker.

Move device data without a broker in reach. 350,000+ devices, 140+ countries.