User Manual

Table Of Contents
SARA-R4 series-AT commands manual
UBX-17003787 - R16
25MQTT
Page 297 of 401
25MQTT
25.1Introduction
MQTT AT commands are implemented according with MQTT version 3.1.1. For a more detailed overview
on MQTT protocol, see MQTT version 3.1.1 - OASIS standard [134].
The Message Queueing Telemetry Transport (MQTT) protocol specifies a simple and lightweight messaging
protocol, designed for constrained devices and low-bandwidth, high-latency, or unreliable networks. An MQTT
client uses publish and subscribe methods to interact over a TCP connection with an MQTT message broker
(henceforth referred to as an MQTT server). The u-blox modules can be configured to operate as an MQTT
client.
To publish or subscribe, the MQTT client must first establish a TCP connection to an MQTT server.
The MQTT protocol specifies case-sensitive topics, with topic names containing topic level separators "/" to
which messages will be published. For example, a message of "78 Fahrenheit or 25 Celsius" could be published
to the topic name of "/heat/sensor/SD/bldg5/DelMarConfRm". MQTT clients subscribe to topic filters to
determine if the client receives messages published to a given topic name.
The topic filters may exactly specify a topic name or may contain either of the following wildcards:
'+' - (single level wildcard) applies to a single topic level;
'#' - (multi-level wildcard) applies to potentially many topic levels (and must be the last character specified
in a topic filter).
'#' can be specified on its own or following a topic level separator ('/'). For example, the topic filter, "/heat/sensor/
SD/#", would receive any messages published to the "/heat/sensor/SD/bldg5/DelMarConfRm" topic name.
MQTT specification states that topic filters starting with either wildcard will not match any topic name
that starts with "$".
The MQTT protocol also specifies a Quality of Service (QoS) level to be applied to message transactions:
0 (default setting): at most once delivery
1: at least once delivery
2: exactly once delivery
The MQTT protocol also allows an MQTT client to create a will message, which the MQTT remote server
will store and only publish (to the topic name specified as the will topic name) when the MQTT client gets
disconnected from the MQTT server, but not if the MQTT client explicitly sends a disconnect command.
25.2MQTT profile configuration +UMQTT
+UMQTT
SARA-R410M-02B SARA-R410M-52B SARA-R410M-63B SARA-R410M-73B SARA-R410M-83B
SARA-R412M
Modules
SARA-N4
Syntax PIN required Settings saved Can be aborted Response time Error referenceAttributes
partial No No No - +CME Error
25.2.1Description
Configures or reads the parameter value of an MQTT client profile. Issue a set command for each <op_code>
parameter to set all of the parameters in an MQTT client profile.
SARA-R410M / SARA-R412M / SARA-N4
The information text response to the read command provides a continuation string, (more), if more
information remains to be displayed. By issuing again the read command, the MQTT will attempt to
continue the previous display attempt.
25.2.2Syntax
Type Syntax Response Example
Generic syntax