1183 MQTT: Message Queuing Telemetry Transport
1183.1 MQTT Protocol Overview
MQTT (Message Queuing Telemetry Transport) is a lightweight publish-subscribe messaging protocol designed for constrained devices and unreliable networks. It is the de facto standard for IoT communication, powering systems from Amazon Alexa to industrial automation.
1183.2 Quick Start
New to MQTT? Start with MQTT Introduction for fundamentals, terminology, and prerequisites.
1183.3 MQTT Chapter Guide
This comprehensive MQTT guide is organized into seven focused chapters:
| Chapter | Focus | Estimated Time |
|---|---|---|
| MQTT Introduction | Fundamentals, terminology, when to use MQTT | 10 min |
| MQTT Architecture | Broker architecture, pub-sub pattern, components | 15 min |
| MQTT Topics & Wildcards | Topic design, wildcards, naming best practices | 10 min |
| MQTT QoS Levels | QoS 0/1/2, battery considerations, delivery guarantees | 15 min |
| MQTT Security | TLS encryption, authentication, ACLs | 15 min |
| MQTT Labs | ESP32 labs, Python examples, interactive simulators | 30 min |
| MQTT Advanced Topics | Clustering, HA, performance, troubleshooting | 20 min |
1183.4 Key Concepts at a Glance
What it is: Lightweight publish-subscribe protocol for IoT
How it works: Devices publish messages to topics on a broker; subscribers receive messages from topics theyβre interested in
Why it matters: 2-byte minimum overhead, works over unreliable networks, perfect for battery-powered devices
Key features: - Publish-Subscribe: Decouples message producers from consumers - Quality of Service: Three levels (0, 1, 2) for reliability trade-offs - Retained Messages: Last value stored for new subscribers - Last Will: Automatic notification on unexpected disconnect - Topics: Hierarchical message routing with wildcards
1183.5 MQTT vs Other Protocols
| Feature | MQTT | CoAP | HTTP |
|---|---|---|---|
| Pattern | Publish-Subscribe | Request-Response | Request-Response |
| Transport | TCP | UDP | TCP |
| Min Overhead | 2 bytes | 4 bytes | ~200 bytes |
| Best For | Frequent updates, many subscribers | Direct queries, RESTful APIs | Web integration |
1183.6 Learning Path
Beginner Path (45 min): 1. Introduction - Start here 2. Architecture - Understand the broker 3. Topics & Wildcards - Design your topics
Intermediate Path (add 30 min): 4. QoS Levels - Master reliability trade-offs 5. Security - Secure your deployment
Advanced Path (add 50 min): 6. Labs - Hands-on implementation 7. Advanced Topics - Production deployment
1183.7 Video Overview
1183.8 Quick Reference
1183.8.1 MQTT Ports
| Port | Purpose |
|---|---|
| 1883 | Unencrypted MQTT (development only) |
| 8883 | MQTT over TLS (production) |
| 443 | MQTT over WebSocket with TLS |
1183.8.2 QoS Levels
| Level | Name | Guarantee | Use Case |
|---|---|---|---|
| 0 | At most once | Fire and forget | Frequent sensor readings |
| 1 | At least once | Acknowledged | Important alerts |
| 2 | Exactly once | Guaranteed once | Critical commands |
1183.8.3 Topic Wildcards
| Wildcard | Matches | Example |
|---|---|---|
+ |
Single level | home/+/temp matches home/bedroom/temp |
# |
Multi-level | home/# matches home/bedroom/sensor/temp |
1183.9 See Also
- CoAP Fundamentals: Alternative lightweight protocol
- Application Protocols Overview: Compare all IoT protocols
- IoT Reference Architectures: Where MQTT fits in IoT systems
- Simulations Hub: Interactive MQTT simulators