2.2.8 AT+CMQTTCONNECT Connect to MQTT server
AT+CMQTTCONNECT is used to connect to a MQTT server .
NOTE: If you don't set the SSL context by AT+CMQTTSSLCFG before connecting a SSL/TLS MQTT server by
AT+CMQTTCONNECT, it will use the <client_index> (the 1st parameter of AT+CMQTTCONNNECT) SSL
context when connecting to the server.
AT+CMQTTCONNECT Connect to MQTT server
Test Command
AT+CMQTTCONNECT=?
Read Command
AT+CMQTTCONNECT?
Write Command
AT+CMQTTCONNECT=<client_index>,
<server_addr>,<keepalive_time>,<clean_
session>[,<user_name>[,<pass_word>]]
Defined Values
<client_index>
<server_addr>
SIM7500_SIM7600_SIM7800 Series_MQTT_AT Command Manual
Response
+CMQTTCONNECT: (0-1),(9-256),(60-64800),(0-1)
OK
Response
+CMQTTCONNECT:
0[,<server_addr>,<keepalive_time>,<clean_session>[,<user_
name>[,<pass_word>]]]
+CMQTTCONNECT:
1[,<server_addr>,<keepalive_time>,<clean_session>[,<user_
name>[,<pass_word>]]]
OK
Response
a)If successfully:
OK
+CMQTTCONNECT: <client_index>,0
b)If failed:
OK
+CMQTTCONNECT: <client_index>,<err>
c)If failed:
+CMQTTCONNECT: <client_index>,<err>
ERROR
d)If failed:
ERROR
A numeric parameter that identifies a client. The range of
permitted values is 0 to 1.
The string that described the server address and port. The range
of the string length is 9 to 256 bytes. The string should be like
Smart Machine Smart Decision
16 / 41
Need help?
Do you have a question about the SIM7500 Series and is the answer not in the manual?
Questions and answers