Smart Machine Smart Decision
SIM7500_SIM7600_SIM7800 Series_MQTT_AT Command Manual 37 / 41
OK
// Set the client certificate of the first SSL context
AT+CSSLCFG=”clientcert”,0,”cert.pem”
OK
// Set the client key of the first SSL context
AT+CSSLCFG=”clientkey”,0,”key_cert.pem”
OK
// start MQTT service, activate PDP context
AT+CMQTTSTART
OK
+CMQTTSTART: 0
// Acquire one client which will connect to a SSL/TLS MQTT server
AT+CMQTTACCQ=0,”client test0”,1
OK
// Set the first SSL context to be used in the SSL connection
AT+CMQTTSSLCFG=0,0
OK
// Set the will topic for the CONNECT message
AT+CMQTTWILLTOPIC=0,10
>0123456789
OK
// Set the will message for the CONNECT message
AT+CMQTTWILLMSG=0,6,1
> qwerty
OK
// Connect to a MQTT server
AT+CMQTTCONNECT=0,"tcp://hooleeping.com:8883",60,1
OK
+CMQTTCONNECT: 0,0
// Set the topic for the PUBLISH message
AT+CMQTTTOPIC=0,13
> dddrrrggghhhk
OK
// Set the payload for the PUBLISH message
AT+CMQTTPAYLOAD=0,60