N11 V2
AT Command Manual
Copyright © Neoway Technology Co., Ltd
104
16 Ali MQTT Command
16.1 Setting MQTT Mode: +IMQTTMODE
Description
To set the mode of MQTT connection
Format
AT+IMQTTMODE=<mode><CR>
Parameter
<Mode>: MQTT mode
0: MQTT
1: MQTT over TLS
Return Value
<CR><LF>OK<CR><LF>
Example
AT+IMQTTMODE=1
OK
Set the mode of MQTT connection
to MQTT over TLS
Remarks
By default, MQTT communication uses plain TCP connections.
To use MQTT over TLS, execute this command before authentication.
16.2 Setting Device Authentication: +IMQTTAUTH
Description
Device authentication information
Format
AT+CLOUDAUTH=<productKey>,<deviceName>,<deviceSecret><CR>
Parameter
<productKey>: product key
<deviceName>: device name
<deviceSecret>: device key
Return Value
<CR><LF>OK<CR><LF>
Example
AT+IMQTTAUTH=“productKey001”,“device
Name001”,“deviceSecret123”
OK
+IMQTTAUTH:OK
The device is authenticated
successfully.
Remarks
After the authentication is started, OK is returned to indicate legal input and then
authentication result is returned.