Connect devices via MQTT
About MQTT
MQTT is an OASIS-standard messaging protocol for the Internet of Things (IoT). It is designed as a lightweight publish/subscribe message transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth.
The protocol is based on the publish/subscribe model (also known as Pub/Sub), and consists of 4 main components:
Publisher: A publisher is a source of messages. It sends messages to specific "topics" on the network. Topics are named channels or categories that identify the type of messages. For example, a weather station sensor could publish data to the "weather data" topic.
Subscriber: A subscriber receives messages by subscribing to specific topics. It specifies which topics it is interested in, and then receives the corresponding messages from publishers that send messages to these topics.
Broker (Manager): An MQTT broker is a server that receives all messages from publishers and then forwards the messages to the appropriate subscribers. The broker is the heart of the MQTT protocol.
Topics are like channels or categories under which messages are grouped. Publishers send messages to specific topics, and subscribers receive messages by subscribing to topics. For example, topics could include subjects such as "sensor data/temperature", "messages/warnings" or "control commands/light".
Procedure
Devices are connected via MQTT in the following steps:
First, a connection to a broker is established and configured.
A subscription to a specific topic is created on this broker.
Last updated
Was this helpful?