User Manual

Table Of Contents
SARA-R4/N4 series-AT Commands Manual
UBX-17003787 - R11
24MQTT
Page 255 of 308
Type Syntax Response Example
MQTT Message
URC +UUMQTTCM: <op_code>,<num_
unread_msgs> [Topic: <topic_
name>] [Len: <msg_length> Qos:
<Qos>] Message: <message_
contents>
+UUMQTTCM: 6,1 Topic: /sensor/
heat/SD/bldg5/DelMarConfRm Len:
16 QoS: 0 Message: 16 bytes of data
24.5.3Defined values
Parameter Type Description
<op_code> Number MQTT command request. Allowed values:
0: logs out/disconnects from MQTT server. Will message will not be sent
1: logs in/connects to MQTT server
2: publish a message to a specific topic to the MQTT message broker
3: publish a message from a file to a specific topic to the MQTT message broker
4: subscribe to a topic from the MQTT message broker
5: unsubscribe to a topic from the MQTT message broker. This should exactly
match the Topic Filter used during the Subscribe
6: read all unread messages received from MQTT message broker, at the terse/
verbose mode set at the time of message reception
7: sets the terse/verbose format for received messages (i.e. the amount of
information and headers with each received MQTT message)
8: ping the MQTT message broker
<QoS> Number Quality of service:
0 (default value): at most once delivery
1: at least once delivery
2: exactly once delivery
<retain> Number Allowed values:
0 (default value): the message will not be retained at the MQTT server across
disconnects from MQTT client
1: the message will be retained by the MQTT server across disconnects from MQTT
client (until superceded by another message)
<hex_mode> Number Allowed values:
0 (default value): ASCII input for <message_contents>
1: hexidecimal input for <message_contents>
<message_
contents>
String ASCII or hexidecimal data. The starting quotation mark shall not be taken into
account like data. At the end of the byte stream, another quotation mark is provided
for user convenience and visualization purposes.
<mqtt_server> String IP address or URL of MQTT server
<num_unread_
msgs>
Number Indicates the number of unread received messages.
<format> Number Specifies format of the messages when read using the <op_code>=6. Possible values"
0: no formating. All messages will be concatenated into a single line with no
separation between meeages
1 (default value): each messages will contain the <topic_name> and <message_
contents>
2: each messages will contain the <topic_name>, <msg_length>, <QoS> and
<message_contents>
<topic_name> String Indicates the topic to which the given MQTT message was published
<msg_length> Number Specifies the number of octets in <message_contents>
<reason> Number Result of an MQTT subscribe request:
0: success
128: failure
<MQTT_result> Number Result of an MQTT command request:
0: fail
1: success
<login_result> Number Result of an MQTT login request.
0: connection accepted
1: the server does not support the level of the MQTT protocol requested by the Client