MQTT Essentials
HiveMQ's free MQTT Essentials series explains the protocol behind most IoT systems one idea at a time: publish and subscribe, clients and brokers, topics and wildcards, QoS levels, persistent sessions, retained messages, Last Will and keep alive, plus a separate MQTT 5 series.
Guide
Other
HiveMQ
About 3 to 4 hours for the core parts
Beginner
Free
What it is
MQTT Essentials is a series of articles from HiveMQ, a company that builds MQTT brokers, explaining the MQTT protocol from first principles. The core series walks through the publish and subscribe architecture, clients, brokers and connections, publishing, subscribing and unsubscribing, topics and best practices, quality of service levels, persistent sessions and queued messages, retained messages, Last Will and Testament, and keep alive with client take-over. A separate MQTT 5 Essentials series covers the features added in MQTT 5, and there are related pages on MQTT security fundamentals, a glossary and comparisons with other protocols. HiveMQ also offers the material as an ebook.
Why MQTT matters for embedded and IoT work
MQTT is the most common way for small devices to send readings and receive commands. A device publishes to a named topic on a broker, and any number of subscribers, such as a dashboard, a database writer or an alert service, receive the message without the device knowing about them. MQTT 3.1.1 and MQTT 5 are OASIS standards, and client libraries exist for ESP32, STM32 networking stacks, Python on the Raspberry Pi and every backend language.
Is it worth your time?
Yes. Most MQTT problems in student projects come from a few misunderstood features: a topic scheme with no structure, QoS 1 without handling duplicate messages, retained messages used for fast-changing data, or no Last Will, so the dashboard never learns a device went offline. Each of these has its own short article in the series, with diagrams and examples, and reading them before you write firmware saves a lot of redesign.
Prerequisites and time
No prior networking knowledge is needed beyond knowing what a client and a server are. The core parts take three to four hours to read. Try each idea with a local broker, such as Eclipse Mosquitto and its command-line clients, as you go.
What you can do after it
- Design a topic hierarchy that scales and supports per-device permissions.
- Choose QoS levels deliberately and handle duplicates at QoS 1.
- Use retained messages and a Last Will to show which devices are online.
- Understand persistent sessions and keep alive, and why clients drop.
- Know which MQTT 5 features, such as message expiry and shared subscriptions, might help later.
Free or paid?
The articles are free. HiveMQ sells broker products and a cloud service and mentions them on its pages, but the series explains the protocol itself and applies to any broker.
Common questions
Do I need HiveMQ's broker? No. Everything in the series applies to any standards-compliant broker, including Mosquitto.
MQTT 3.1.1 or 5? Learn the core ideas, which are shared, then read MQTT 5 Essentials when your client library and broker support it.
Best for: anyone connecting devices to dashboards or backends, from a first ESP32 project to a Raspberry Pi gateway.
Ready to start?
Opens on HiveMQ in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.