MQTT Fundamentals

Learn how MQTT works: publish/subscribe, topics and wildcards, QoS, retained messages, sessions, Last Will, MQTT 5 features and packet structure.

Fundamentals

What Is MQTT? A Practical Introduction

What is MQTT? A practical introduction to the MQTT protocol: brokers, topics, publish/subscribe, QoS, retained messages and Last Will — with hands-on examples.

7 min read
Fundamentals

MQTT Ports Explained: 1883, 8883, 8083, 8084 and 443

Which MQTT port should you use? Learn what ports 1883, 8883, 8083, 8084 and 443 mean, which work in a browser, and the exact ports of popular public brokers.

6 min read
Fundamentals

MQTT QoS Levels Explained: QoS 0, 1 and 2

MQTT QoS explained: how QoS 0, 1 and 2 work packet by packet, what the downgrade rule means, how sessions affect delivery, and which QoS level to choose.

7 min read
Fundamentals

MQTT Topics and Wildcards: Design Guide and Best Practices

MQTT topics and wildcards explained: topic levels, the + and # wildcards, $SYS topics, shared subscriptions and best practices for designing a topic hierarchy.

7 min read
Fundamentals

MQTT Retained Messages: How They Work and How to Clear Them

MQTT retained messages explained: how the retain flag works, when to use it, how to clear a retained message with an empty payload, and MQTT 5 retain options.

6 min read
Fundamentals

MQTT Last Will and Testament (LWT) Explained

How MQTT Last Will and Testament works: when the broker sends it, will delay in MQTT 5, and the retained online/offline presence pattern with code examples.

6 min read
Fundamentals

MQTT Keep Alive Explained: PINGREQ, Timeouts and Tuning

How MQTT keep alive works: the 1.5x timeout rule, PINGREQ and PINGRESP, MQTT 5 Server Keep Alive, NAT and mobile pitfalls, and how to choose a good interval.

7 min read
Fundamentals

MQTT Persistent Sessions: Clean Session vs Clean Start

Understand MQTT persistent sessions: cleanSession in 3.1.1, Clean Start and Session Expiry in MQTT 5, the Session Present flag and how QoS 1/2 messages queue.

7 min read
Fundamentals

MQTT Shared Subscriptions: Load Balancing with $share

Learn MQTT shared subscriptions: the $share/group/filter syntax, how messages are distributed, broker support, real use cases and pitfalls like ordering.

7 min read
Fundamentals

Sparkplug B Explained: MQTT for Industrial IoT

Sparkplug B explained: the spBv1.0 topic namespace, NBIRTH/NDEATH and DATA/CMD messages, protobuf payloads, bdSeq and seq, and the primary host application.

8 min read