N11 V2
AT Command Manual
Copyright © Neoway Technology Co., Ltd
105
16.3 Setting MQTT Parameters: +IMQTTPARA
Description
To set the parameters of the device for Ali MQTT communication
Format
AT+IMQTTPARA=<ParaTag>,<ParaValue><CR>
Parameter
Description
<ParaTag>: MQTT parameter tag
“TIMEOUT”: MQTT timeout interval, unit: second
“CLEAN”: to specify whether to clear session
0: No
1: Yes
“KEEPALIVE”: heartbeat interval, unit: second
“VERSION”: MQTT version, 3.1 or 3.1.1
“AUTHMODE”: authentication mode
0: set parameter only and do not enable authentication
1: set parameter and enable authentication
The default value is 1.
<ParaValue>: MQTT parameter value
Return Value
<CR><LF>OK<CR><LF>
Example
AT+IMQTTPARA=“TIMEOUT”,2,“CLEAN”,1
,“KEEPALIVE”,60,“VERSION”,“3.1.1”
OK
Parameters are set successfully.
AT+IMQTTPARA=“TIMEOUT”,2
OK
One parameter is set successfully.
Remarks
The query command is executed to query all parameters and their values.
16.4 Setting up MQTT Connection: +IMQTTCONN
Description
To set up an MQTT connection to Ali server
Format
AT+IMQTTCONN<CR>
Parameter
N/A
Return Value
<CR><LF>OK<CR><LF>
Example
AT+IMQTTCONN
OK
An MQTT connection to Ali server is
set up successfully.