（Past wonderful articles, click to jump to read）
MQTT, standing for Message Queuing Telemetry Transport, was created in 1999 by Andy Stanford Clark and Arlen Nipper. It is a messaging protocol that creates a reliable standard for machine-to-machine (m2m) communication. MQTT is a publish-subscribe protocol. This means that client devices and applications are not communicating with servers directly, but publishing and subscribing to topics that are managed by brokers.
MQTT typically uses TCP/IP (Transmission Control Protocol/Internet Protocol) as its transmission, but other bidirectional transmissions can also be used. MQTT has become the de facto standard for IoT communication due to its efficiency and flexibility. Ebyte modules use it to cover various wireless networks (2G-4G cellular and LoRa) and protocols (USSD, UDP), providing developers with a familiar and straightforward experience.
MQTT allows devices and systems (clients) to communicate by sending messages. Messages are not sent directly from client to client but published by the client to the topic stored in the MQTT broker. Clients can receive messages by subscribing to one or more topics.
Different Quality of Service levels can publish messages, which define the level of reliability and whether data is generated to be delivered.
- Publish-subscribe model for one-to-many message delivery.
- Base on TCP/IP network connection, providing ordered, lossless, bidirectional connections.
- 1-byte fixed header, 2-byte heartbeat message, minimizing the transfer overhead and protocol exchange, effectively reducing network traffic.
- Support for message QoS to ensure reliable transmission.
- Reliability: Many IoT devices rely on radio connections to transmit and collect data, which means that the connection is not always reliable. MQTT can allow messages to be stored in the broker until the device is ready to receive them. With QoS, MQTT can queue messages to ensure they reach their destination and, if necessary, ensure they are delivered only once.
- Bidirectional message transmission: Perhaps more accurately, MQTT is omnidirectional. Any device, thing, or application can publish or subscribe to any topic that the broker handles. This means that there are no restrictions on what can be talked about or listened to on the network.
- Large-scale message delivery: Broadcasting messages to one million devices is as easy as sending them to one hundred devices. To be heard by everything on the network, a thing only needs to publish to topics that all devices subscribe to.
Ultimately, an IoT task is to obtain data between devices on the network. And these networks may be anywhere in the world, and each network faces many situations that may cause their data transmission to fail. MQTT has countless built-in features to help mitigate some of these problems, thus reducing the user's worries.