SARA-R4/N4 series - AT Commands Manual
UBX-17003787 - R09
24 MQTT
Page 253 of 307
Type
Syntax
Response
Example
MQTT logout
Set
AT+UMQTTC=0
+UMQTTC: 0,<MQTT_result>
OK
AT+UMQTTC=0
+UMQTTC: 0,1
OK
MQTT login
Set
AT+UMQTTC=1
+UMQTTC: 1,<MQTT_result>
OK
AT+UMQTTC=1
+UMQTTC: 1,1
OK
URC
+UUMQTTC: 1,<login_result>
+UUMQTTC: 1,0
MQTT publish to a topic
Set
AT+UMQTTC=2,<QoS>,<retain>,
[<hex_mode>],<topic>,<message>
+UMQTTC: 2,<MQTT_result>
OK
AT+UMQTTC=2,0,0,"/sensor/heat/
SD/bldg5/DelMarConfRm","23
degrees Celsius"
+UMQTTC: 2,1
OK
MQTT publish a file to a topic
Set
AT+UMQTTC=3,<QoS>,<retain>,
<topic_name>,<filename>
+UMQTTC: 3,<MQTT_result>
OK
AT+UMQTTC=3,0,0,"/home/u-blox",
"/home/greetings/will.txt"
+UMQTTC: 3,1
OK
MQTT subscribe to the specified topic filter
Set
AT+UMQTTC=4,<max_QoS>,
<topic_filter>
+UMQTTC: 4,<MQTT_result>
OK
AT+UMQTTC=4,0,"/sensor/heat/SD/
#"
+UMQTTC: 4,1
OK
URC
+UUMQTTC: 4,<reason>,<QoS>,
<topic_name>
+UUMQTTC: 4,0,2,"/sensor/heat/
SD/#"
MQTT unsubscribe from the specified Topic Filter
Set
AT+UMQTTC=5,<topic_filter>
+UMQTTC: 5,<MQTT_result>
OK
AT+UMQTTC=5,"/sensor/heat/SD/
#"
+UMQTTC: 5,1
OK
MQTT read message
Set
AT+UMQTTC=6
+UMQTTC: 6,<MQTT_result>
OK
AT+UMQTTC=6
+UMQTTC: 6,1
OK
URC
+UUMQTTC: 6,<num_unread_
msgs>
+UUMQTTC: 6,3
MQTT verbose/terse Reception format
Set
AT+UMQTTC=7,<format>
+UMQTTC: 7,<MQTT_result>
OK
AT+UMQTTC=7,1
+UMQTTC: 7,1
OK
Ping MQTT server
Set
AT+UMQTTC=8,<mqtt_server>
+UMQTTC: 8,<MQTT_result>
OK
AT+UMQTTC=8,"192.168.1.0"
+UMQTTC: 8,1
OK
Test
AT+UMQTTC=?
+UMQTT: (list of supported <op_
codes>s)
OK
+UMQTTC: (0-8)
OK
Generic syntax
URC
+UUMQTTC: <op_code>,<param1>[,
<param2>,<param3>
+UUMQTTC: 4,0,2,"/sensor/heat/
SD/#"