What is MQTT?

What is MQTT?

MQTT is a lightweight open-source messaging network protocol that transports messages between devices. It employs a publish/subscribe communication model to provide resource-constrained network clients with a simple way to distribute telemetry information in low-bandwidth environments.

It is designed for efficient communication between devices in an Internet of Things (IoT) environment. MQTT follows a publish-subscribe model, where devices publish messages to topics and other devices subscribe to those topics to receive the messages.



MQTT Server (broker) : An MQTT server (broker) is software running on a computer that receives messages from sources (publishing clients), and then forwards them to the destination (subscribing clients). The most popular open-source MQTT broker is the Mosquito broker. Lonely Binary's public MQTT server uses Mosquito as well.

Publishing Client : MQTT publishing clients can be any device or application ranging from a simple ESP32 or Raspberry PI Pico microcontroller to a full cloud-hosted application server. Publishing clients publish a message for a topic to MQTT broker.

Subscribing Client: Same as publishing client, it can be an MCU or application on a computer. subscribing clients receive message for MQTT broker a topic.

 MQTT Features

Here are some key features of MQTT:

  1. Lightweight: MQTT is designed to be lightweight and efficient, making it suitable for resource-constrained devices and low-bandwidth networks.

  2. Publish-Subscribe Model: MQTT uses a publish-subscribe messaging pattern. Devices, known as publishers, send messages to specific topics. Other devices, known as subscribers, can subscribe to those topics and receive the published messages.

  3. Quality of Service (QoS) Levels: MQTT supports different levels of message delivery assurance. There are three QoS levels: QoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exactly once). The QoS level determines the reliability and guarantee of message delivery.

  4. Retained Messages: MQTT allows publishers to send retained messages. A retained message is a message that is saved by the broker and sent to new subscribers when they connect to the topic. This feature is useful for transmitting status information or configuration data.

  5. Last Will and Testament (LWT): MQTT provides a mechanism called "Last Will and Testament" that allows a device to specify a message that will be published by the broker if the device unexpectedly disconnects. It helps in detecting and handling unexpected disconnections.

  6. Scalability: MQTT can handle large numbers of devices and connections efficiently. It is well-suited for IoT deployments where thousands or millions of devices need to communicate with each other.

  7. Security: MQTT supports various security mechanisms, including Transport Layer Security (TLS) for encryption and authentication, as well as username/password authentication.


Leave a comment

Your email address will not be published. Required fields are marked *

Please note, comments must be approved before they are published