MQTT (MQ Telemetry Transport) is a publish/subscribe protocol for M2M applications. It’s now an OASIS standard. It’s a simple protocol, easy to implement for any client.
This procotol supplies:
The supported version is 3.1.1
MQTT must be secured using TLS (Transport Layer Security) the successor of SSL. TLS will create a secure tunnel between your client and the server. The server will be authenticated using a X.509 certificate (like for HTTPS websites).
MQTT uses the publish/subscribe paradigm. Clients connect to a “broker”, in our case the AirVantage server. Clients can publish messages on “topics”. All the subscribers to this topic will receive the messages. A client can connect to any topic. This allows one-to-one, many-to-one or one-to-many communication patterns.
A topic name is an UTF-8 string. It’s used by the broker for matching publisher and subscribers. Topics can be composed using “/” separators. A topic doesn’t need to be created upfront, just publish a message on a given topic.
AirVantage uses some specific topics to be used if you want to publish data in the AirVantage data store, define alerts, visualize the data or stream it to your servers. Specific topics are also used for receiving operation tasks (like read, write, commands) from AirVantage operations. This is described in the page Using MQTT with AirVantage .
A client can use wildcards for subscribing to a set of topics. Wildcards are not allowed in publish topics, only for subscribing.
Wildcards are used with topic hierarchy. The topic hierarchy is defined by the “/” used for separating the different sections of a topic.
The possible wildcards are:
You can send MQTT publish or subscribe messages with a QoS level (0, 1 or 2).
Each different level provides different guarantees of delivery priority.
When you publish a message on a topic you can ask the broker to retain the last value for this topic. When a client subscribes to this topic it will receive the last retained value.
When a client connects it can ask the broker to publish a specified message on a specified topic if the client disconnects abruptly (without sending the MQTT disconnect message).
A client connecting to the broker can specify if it wants a persistent session. This type of session will make the broker keep the undelivered message with QoS 1 or 2. So if the client disconnects, the server will keep the messages and send them at the next reconnection with the same “client ID”.
MQTT is payload-agnostic, so you can use any format as payload.
However we have defined a format for you to use with the MQTT protocol to connect your embedded application to Using MQTT with AirVantage .
Using MQTT with AirVantage : The MQTT Errors section explains how to receive trace logs of the data you are sending and how to troubleshoot communications with AirVantage.