The MQTT (Message Queuing Telemetry Transport) Protocol is a lightweight and efficient messaging protocol, widely used in the Internet of Things (IoT). Its design facilitates communication in environments where low latency, minimal bandwidth consumption, and energy efficiency are required, which is essential for connected devices with limited resources.
MQTT is a messaging protocol based on the publish-subscribe model. It was designed in 1999 by Andy Stanford-Clark from IBM and Arlen Nipper from Arcom (now Eurotech), aiming to connect oil and gas systems over satellite connections with limited bandwidth and high latency. Today, it is used in a wide range of applications, from home automation to industrial telemetry.
The publish-subscribe model of MQTT is simple yet powerful. In this model, "clients" can subscribe to specific "topics" provided by an MQTT "broker". Other clients can publish messages on these topics, and the broker is responsible for distributing the messages to all clients subscribed to the corresponding topic.
A device or application that can publish messages to other clients and/or subscribe to topics to receive messages.
2. MQTT Broker:A server that receives all messages from the clients and then distributes them to the subscribed clients based on the topics they have subscribed to.
3. Topic:A message identifier that clients use to filter the messages they need to receive. Topics can have multiple levels of hierarchy.
MQTT has established itself as a fundamental pillar in the IoT world due to its simplicity and efficiency. It is particularly useful in applications where devices must communicate reliably and efficiently in resource-limited environments.
The IONA, as a panel indicator and automation measurement device, offers a significant enhancement for users needing advanced communication solutions. This device supports MQTT communication when equipped with an Ethernet communication option. This option is a peripheral that can be connected to the IONA motherboard and is typically sold together with the device.
To enable MQTT communication on the IONA, users need to install the Ethernet communication option. Once installed, data generated by the IONA can be sent to an MQTT broker for storage or further analysis. This setup allows for efficient data handling and integration into broader data management and analysis systems.
To activate and configure MQTT communication:
Accessing the Webserver: Navigate to the communications section on the IONA webserver.To utilize our MQTT server for the IONA, users must create an account at broker.ditel.es. This account allows users to manage their device connections securely and to handle the data transmitted via MQTT.
By connecting the IONA to an MQTT broker via the Ethernet option, users can greatly enhance the device’s functionality, making it a powerful tool for real-time data integration and analysis in various industrial applications.
By activating Ditel’s MQTT Cloud Service, the data from your IONA sensors is transmitted seamlessly to our MQTT broker. This setup enables real-time monitoring of temperature, humidity, and CO₂ data, which is securely received and stored on the cloud.
Not only can you monitor environmental data, but you also gain the capability to send messages to your IONA displays through MQTT commands. Messages can be sent directly from the broker to the displays, allowing for instant updates and customized information displays on your screens.
With MQTT Cloud, you’ll experience a fully integrated and interactive monitoring solution, ensuring efficient data handling and flexible control over your IONA devices.
The IONA device sends telemetry data in JSON format, which can be received by subscribing to a specific topic on the MQTT broker.
{useremail}/{devicetype}/{serialnumber}
user@example.com/iona/ITYYY2
The JSON sent by IONA contains relevant device information, including the serial number, date, local and public IP, temperature, humidity, signal level (dBm), battery, and MAC address. Here’s an example of a received message:
{
"serialNumber": "ITYYY2",
"date": "2024-11-03T19:22:01+01:00",
"ipLocal": "192.168.1.33/24",
"ipPublic": "79.156.39.210\n",
"temperature": 13.4,
"humidity": 63.6,
"dbm": -94,
"battery": 94,
"MAC": "bc:57:29:12:1f:b7"
}
Each field has the following purpose:
To send messages to IONA, the JSON format must include device details and the configuration for the text lines to display. The message is published to the specific topic for IONA.
{useremail}/{devicetype}/{serialnumber}
user@example.com/iona/ITYYYY
The following JSON configures the device screen, including text style, colors, effects, and message content. An example of a message to send would be:
{
"serialNumber": "ITYYYY",
"date": "2024-10-25T09:23:17+02:00",
"lines": {
"line1": {
"font-family": "Arial",
"font-size": "40",
"color": "#ff0000",
"background-color": "#000000",
"effect": "scroll",
"blink": true,
"message": "9:24",
"imageb64": ""
}
}
}
The parameters within lines
control the format and content of the text line displayed on the screen:
Subscribe to the topic to receive information:
user@example.com/iona/ITYYY2
Publish to the topic to send information:
user@example.com/iona/ITYYYY
{
"serialNumber": "ITYYYY",
"date": "2024-10-25T09:23:17+02:00",
"lines": {
"line1": {
"font-family": "Arial",
"font-size": "40",
"color": "#ff0000",
"background-color": "#000000",
"effect": "scroll",
"blink": true,
"message": "9:24",
"imageb64": ""
}
}
}
This manual allows you to configure and receive data from IONA via MQTT, facilitating the monitoring and adjustment of the information displayed on the device.
To send a message to IONA, use the mosquitto_pub
command. Replace {broker_address}
with your MQTT broker address, {username}
and {password}
with your MQTT credentials, and adjust the topic and message as needed.
# mosquitto_pub -h {broker_address} -t "user@example.com/iona/ITYYYY" -u {username} -P {password}
-m '{
"serialNumber": "ITYYYY",
"date": "2024-10-25T09:23:17+02:00",
"lines": {
"line1": {
"font-family": "Arial",
"font-size": "40",
"color": "#ff0000",
"background-color": "#000000",
"effect": "scroll",
"blink": true,
"message": "9:24",
"imageb64": ""
}
}
}'
To receive data from IONA, use the mosquitto_sub
command. Replace {broker_address}
, {username}
, and {password}
with your MQTT broker details and credentials. The example below subscribes to the specific topic for receiving data from the device.
mosquitto_sub -h {broker_address} -t "user@example.com/iona/ITYYY2" -u {username} -P {password}
This command subscribes to the IONA topic, allowing you to receive telemetry data in real-time.