Manage Data through MQTT

MQTT is the standard messaging protocol for the Internet of Things based on publish/subscribe information. It allows for messaging between device to cloud and cloud to device. Connections are always handled by an MQTT broker, which is responsible for receiving and filtering the messages using topics.

The Altair IoT Studio Platform offers its own MQTT broker to interact with the platform and perform different operations through MQTT.


Figure 1.

To use this protocol, a connection between Altair IoT Studio and the Thing must be done with the username and password given. The data will be sent by publishing it to the properties using the correct MQTT topic. Check the MQTT documentation to learn more about the different topics available.

Host: tcp://mqtt.swx.altairone.com

Port: 1883

To handle the communication publisher/subscriber properly, an agreement regarding the guarantees of the message delivery is established. This is called the Quality of Service (QoS), and there are three levels of agreement:

Level 0
“At most once”. The message sent will not be stored nor redelivered by the sender and will not be acknowledged by the receiver.
Level 1
“At least once”. The message will be delivered at least once to the subscriber, but it can be delivered more than once.
Level 2
“Exactly once”. The message will be delivered strictly one time accompanied by multiple acknowledgment messages confirming the delivery of the message.


Figure 2.

Using the MQTT Inspector

The MQTT Inspector allows you to see MQTT incoming topics and messages and the format of the data payload. A list of the messages and topics is shown so you will know what topics are available.

Display the MQTT Inspector by opening the Utility Belt (left side menu) and clicking MQTT Inspector.


Figure 3.
A summary of topics and total messages received is shown.


Figure 4.
The message is published to the Thing:


Figure 5.
After publishing, you will be able to check all the details at the MQTT Inspector:


Figure 6.