Overview
MQTT (Message Queuing Telemetry Transport) is the most popular protocol for IoT. It is designed for connections with remote locations where a 'small code footprint' is required or the network bandwidth is limited.
How it Works
- Broker: A central server that receives all messages and then filters and distributes them to subscribers.
- Publishers: Devices that send data (e.g., a temperature sensor).
- Subscribers: Devices or applications that want to receive data (e.g., a dashboard).
- Topics: Messages are published to specific 'topics' (e.g.,
home/livingroom/temp).
Key Features
- Quality of Service (QoS): Three levels of message delivery assurance.
- Last Will and Testament (LWT): Allows the broker to notify others if a device disconnects unexpectedly.
- Retained Messages: The broker stores the last message on a topic for new subscribers.