SimCom SIM7500 Series Command Manual
SimCom SIM7500 Series Command Manual

SimCom SIM7500 Series Command Manual

Mqtt at, lte module
Hide thumbs Also See for SIM7500 Series:

Advertisement

SIM7500_SIM7600_SIM7800
Series_MQTT_AT Command Manual_V1.00
LTE Module
Shanghai SIMCom Wireless Solutions Ltd.
Building A, SIM Technology Building, No.633, Jinzhong Road
Changning District 200335
Tel:86-21-31575100/31575200
support@simcom.com
www.simcom.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SIM7500 Series and is the answer not in the manual?

Questions and answers

Summary of Contents for SimCom SIM7500 Series

  • Page 1 SIM7500_SIM7600_SIM7800 Series_MQTT_AT Command Manual_V1.00 LTE Module Shanghai SIMCom Wireless Solutions Ltd. Building A, SIM Technology Building, No.633, Jinzhong Road Changning District 200335 Tel:86-21-31575100/31575200 support@simcom.com www.simcom.com...
  • Page 2 Manual_V1.00 General Notes SIMCom offers this information as a service to its customers, to support application and engineering efforts that use the products designed by SIMCom. The information provided is based upon requirements specifically provided to SIMCom by the customers. SIMCom has not undertaken any independent search for additional relevant information, including any information that may be in the customer’s possession.
  • Page 3: Version History

    Smart Machine Smart Decision Version History Version Date Chapter What is new V1.00 2018-09-28 New version SIM7500_SIM7600_SIM7800 Series_MQTT_AT Command Manual 2 / 41...
  • Page 4: Table Of Contents

    Smart Machine Smart Decision Contents Version History ..........................2 Contents ............................3 Introduction ..........................4 1.1 The SSL Context Management AT Commands (for SSL/TLS MQTT) ..........4 1.2 The process of Using MQTT AT Commands ..................4 2 Description of AT Command ......................5 2.1 SSL Context Management AT (only for SSL/TLS MQTT) ..............
  • Page 5: Introduction

    Smart Machine Smart Decision This document is a reference guide to all the AT commands defined for MQTT. Through these MQTT AT commands, you can communicate with a MQTT server. 1 Introduction 1.1 The SSL Context Management AT Commands (for SSL/TLS MQTT) Step 1: Configure SSL version by AT+CSSLCFG=“sslversion”,<ssl_ctx_index>,<sslversion>.
  • Page 6: Description Of At Command

    Smart Machine Smart Decision Step 9: Unsubscribe to message by AT+CMQTTUNSUB. Step 10: Input the topic of a publish message by AT+CMQTTTOPIC. Step 11: Input the payload of a publish message by AT+CMQTTPAYLOAD. Step 12: Publish message by AT+CMQTTPUB. Step 13: Disconnect from the server by AT+CMQTTDISC. Step 13: Release the client by AT+CMQTTREL.
  • Page 7 Smart Machine Smart Decision ca_file>,<clientcert_file>,<clientkey_file> +CSSLCFG: 4,<sslversion>,<authmode>,<ignoreltime>,<negotiatetime>,< ca_file>,<clientcert_file>,<clientkey_file> +CSSLCFG: 5,<sslversion>,<authmode>,<ignoreltime>,<negotiatetime>,< ca_file>,<clientcert_file>,<clientkey_file> +CSSLCFG: 6,<sslversion>,<authmode>,<ignoreltime>,<negotiatetime>,< ca_file>,<clientcert_file>,<clientkey_file> +CSSLCFG: 7,<sslversion>,<authmode>,<ignoreltime>,<negotiatetime>,< ca_file>,<clientcert_file>,<clientkey_file> +CSSLCFG: 8,<sslversion>,<authmode>,<ignoreltime>,<negotiatetime>,< ca_file>,<clientcert_file>,<clientkey_file> +CSSLCFG: 9,<sslversion>,<authmode>,<ignoreltime>,<negotiatetime>,< ca_file>,<clientcert_file>,<clientkey_file> Response Write Command +CSSLCFG: <ssl_ctxindex>,<sslversion>,<authmode>,<ignoreltime>,<ne Query the configuration of the specified gotiatetime>,<ca_file>,<clientcert_file>,<clientkey_file> SSL context AT+CSSLCFG=<ssl_ctx_index> Write Command Response a)If successfully: Configure the version of the specified SSL...
  • Page 8 Smart Machine Smart Decision Configure the negotiate timeout value of the a)If successfully: specified SSL context AT+CSSLCFG="negotiatetime",<ssl_ctx b)If failed: _index>,<negotiatetime> ERROR Write Command Response a)If successfully: Configure the server root CA of the specified SSL context AT+CSSLCFG="cacert",<ssl_ctx_index> b)If failed: ,<ca_file> ERROR Write Command Response...
  • Page 9 Smart Machine Smart Decision When set the value to 0, it need to set the right current date and time by AT+CCLK when need SSL certification. <negotiatetime> The timeout value used in SSL negotiate stage. The range is 10-300 seconds. The default value is 300. <ca_file>...
  • Page 10: At+Ccertdown Download Certificate Into The Module

    Smart Machine Smart Decision 2. By FTPS or HTTPS commands. Please refer to: SIM7500_SIM7600_SIM7800 Series_FTPS_AT Command Manual and SIM7500_SIM7600_SIM7800 Series_HTTP_AT Command Manual 2.1.2 AT+CCERTDOWN Download certificate into the module AT+CCERTDOWN Download certificate into the module Response +CCERTDOWN: (5-128),(1-10240) Test Command AT+CCERTDOWN=? Response a)If it can be download:...
  • Page 11: At+Ccertdele Delete Certificates

    Smart Machine Smart Decision AT+CCERTLIST [+CCERTLIST:<file_name> [+CCERTLIST:<file_name>] … <CR><LF>] Defined Values <filename> The certificate/key files which has been downloaded to the module. If the filename contains non-ASCII characters, it will show the non-ASCII characters as UTF8 code. 2.1.4 AT+CCERTDELE Delete certificates AT+CCERTDELE Delete certificate from the module Response a)If delete successfully:...
  • Page 12: Mqtt Services At

    Smart Machine Smart Decision 2.2 MQTT Services AT 2.2.1 AT+CMQTTSTART Start MQTT service AT+CMQTTSTART is used to start MQTT service by activating PDP context. You must execute this command before any other MQTT related operations. AT+CMQTTSTART Start MQTT service Response a)If start MQTT service successfully: +CMQTTSTART: <err>...
  • Page 13: At+Cmqttaccq Acquire A Client

    Smart Machine Smart Decision +CMQTTSTOP: <err> c)If failed: ERROR Defined Values <err> The result code, please refer to chapter 2.3.1 2.2.3 AT+CMQTTACCQ Acquire a client AT+CMQTTACCQ is used to acquire a MQTT client . It must be called before all commands about MQTT connect and after AT+CMQTTSTART .
  • Page 14: At+Cmqttrel Release A Client

    Smart Machine Smart Decision 0 - MQTT server with TCP 1-MQTT server with SSL/TLS <err> The result code, please refer to chapter 2.3.1 2.2.4 AT+CMQTTREL Release a client AT+CMQTTREL is used to release a MQTT client . It must be called after AT+CMQTTDISC and before AT+CMQTTSTOP .
  • Page 15: At+Cmqttwilltopic Input The Topic Of Will Message

    Smart Machine Smart Decision AT+CCHSSLCFG Set the SSL context Response Test Command + CMQTTSSLCFG: (0,1),(0-9) AT+CMQTTSSLCFG=? Response +CMQTTSSLCFG: <session_id>,[<ssl_ctx_index >] Read Command +CMQTTSSLCFG: <session_id>,[<ssl_ctx_index >] AT+CMQTTSSLCFG? Response Write Command a)If successfully: AT+CMQTTSSLCFG=<session_id>,<ssl b)If failed: _ctx_index> ERROR Defined Values <session_id> The session_id to operate. It’s from 0 to 1 The SSL context ID which will be used in the SSL connection.
  • Page 16: At+Cmqttwillmsg Input The Will Message

    Smart Machine Smart Decision ERROR Defined Values <client_index> A numeric parameter that identifies a client. The range of permitted values is 0 to 1. <req_length> The length of input topic. The will topic should be UTF-encoded string. The range is from 1 to 1024 bytes. <err>...
  • Page 17: At+Cmqttconnect Connect To Mqtt Server

    Smart Machine Smart Decision 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.
  • Page 18: At+Cmqttdisc Disconnect From Server

    Smart Machine Smart Decision this “tcp://116.247.119.165:5141”, must begin with “tcp://”. If the <server_addr> not include the port, the default port is 1883. The time interval between two messages received from a client. The client will send a keep-alive packet when there is no <keepalive_time>...
  • Page 19: At+Cmqtttopic Input The Topic Of Publish Message

    Smart Machine Smart Decision Response a)If connect successfully: +CMQTTDISC: <client_index>,0 b)If connect successfully: +CMQTTDISC: <client_index>,0 Write Command AT+CMQTTDISC=<client_index>,<time If failed: out> +CMQTTDISC: <client_index>,<err> d)If failed: ERROR e)If failed: +CMQTTDISC: <client_index>,<err> ERROR Defined Values <client_index> A numeric parameter that identifies a client. The range of permitted values is 0 to 1.
  • Page 20: At+Cmqttpayload Input The Publish Message

    Smart Machine Smart Decision AT+CMQTTTOPIC=? Response a)If successfully: > <input data here> Write Command b)If failed: AT+CMQTTTOPIC=<client_index>,<re +CMQTTTOPIC: <client_index>,<err> q_length> ERROR c)If failed: ERROR Defined Values <client_index> A numeric parameter that identifies a client. The range of permitted values is 0 to 1. <req_length>...
  • Page 21: At+Cmqttpub Publish A Message To Server

    Smart Machine Smart Decision c)If failed: ERROR Defined Values <client_index> A numeric parameter that identifies a client. The range of permitted values is 0 to 1. <req_length> The length of input message data. The publish message should be UTF-encoded string. The range is from 1 to 10240 bytes. <err>...
  • Page 22: At+Cmqttsubtopic Input The Topic Of Subscribe Message

    Smart Machine Smart Decision 0 – at most once 1 – at least once 2 – exactly once <pub_timeout> The publishing timeout interval value. Since the client publish a message to server, it will report failed if the client receive no response from server after the timeout value seconds.
  • Page 23: At+Cmqttsub Subscribe A Message To Server

    Smart Machine Smart Decision <client_index> A numeric parameter that identifies a client. The range of permitted values is 0 to 1. <req_length> The length of input topic data. The publish message topic should be UTF-encoded string. The range is from 1 to 1024 bytes. <qos>...
  • Page 24: At+Cmqttunsubtopic Input The Topic Of Unsubscribe Message

    Smart Machine Smart Decision +CMQTTSUB: <client_index>,<err> b)If failed: +CMQTTSUB: <client_index>,<err> c)If failed: +CMQTTSUB: <client_index>,<err> ERROR d)If failed: ERROR Defined Values <client_index> A numeric parameter that identifies a client. The range of permitted values is 0 to 1. <req_length> The length of input topic data. The message topic should be UTF-encoded string.
  • Page 25: At+Cmqttunsub Unsubscribe A Message To Server

    Smart Machine Smart Decision ex>,<req_length> > <input data here> b)If failed: +CMQTTUNSUBTOPIC: <client_index>,<err> ERROR c)If failed: ERROR Defined Values <client_index> A numeric parameter that identifies a client. The range of permitted values is 0 to 1. <req_length> The length of input topic data. The publish message topic should be UTF-encoded string.
  • Page 26: At+Cmqttcfg Configure The Mqtt Context

    Smart Machine Smart Decision +CMQTTUNSUB: <client_index>,<err> ERROR d)If failed: ERROR Response a)If successfully: > <input data here> b)If failed: Write Command unsubscribe one topic +CMQTTUNSUB: <client_index>,<err> AT+CMQTTUNSUB=<client_index>,<re c)If failed: qLength>,<dup> +CMQTTUNSUB: <client_index>,<err> ERROR d)If failed: ERROR Defined Values <client_index> A numeric parameter that identifies a client. The range of permitted values is 0 to 1.
  • Page 27: Command Result Codes And Unsolicited Codes

    Smart Machine Smart Decision Response +CMQTTCFG: 0,<checkUTF8_flag> Read Command +CMQTTCFG: 1, <checkUTF8_flag> AT+CMQTTCFG? Response Write Command a)If successfully: Configure the check UTF8 flag of the specified MQTT client context AT+CMQTTCFG="checkUTF8",<index b)If failed: >,<checkUTF8_flag> ERROR Defined Values <index> The MQTT client index. The range is 0-1. <checkUTF8_flag>...
  • Page 28: Unsolicited Result Codes

    Smart Machine Smart Decision client index error no connection invalid parameter not supported operation client is busy require connection fail sock sending fail timeout topic is empty client is used client not acquired client not released length out of range network is opened packet fail DNS error...
  • Page 29 Smart Machine Smart Decision 1 – Socket is closed passively. 2 – Socket is reset. 3 – Network is closed. 2.3.2.2 Receive publish message from MQTT server If a client subscribes to one or more topics, any message published to those topics are sent by the server to the client.
  • Page 30: Example

    Smart Machine Smart Decision indicate the topic and payload have been transmitted completely. Defined Values <client_index> A numeric parameter that identifies a client. The range of permitted values is 0 to 1. <topic_total_len> The length of message topic received from MQTT server. The range is from 1 to 1024 bytes.
  • Page 31: Access To Mqtt Server Not Ssl/Tls

    Smart Machine Smart Decision // Specify the parameter value of the PDP context corresponding to cid AT+CGSOCKCONT=1,"IP","CMNET" AT+CGPADDR +CGPADDR: 1,10.49.14.68 //ensure the first PDP context get a IP address +CGPADDR: 4,0.0.0.0 Note: usually CSOCKAUTH and CSOCKSETPN parameter are kept default if not care about. 3.1 Access to MQTT server not SSL/TLS Following commands shows how to communicate with a MQTT server.
  • Page 32 Smart Machine Smart Decision Connect to a MQTT server AT+CMQTTCONNECT=0,"tcp://test.mosquitto.org:1883",60,1 +CMQTTCONNECT: 0,0 Subscribe one topic from the server AT+CMQTTSUB=0,9,1 >simcommsg +CMQTTSUB: 0,0 Set the topic for the PUBLISH message AT+CMQTTTOPIC=0,9 > simcommsg Set the payload for the PUBLISH message AT+CMQTTPAYLOAD=0,60 >...
  • Page 33: Connect To Ssl/Tls Mqtt Server (Not Verify Server)

    Smart Machine Smart Decision Unsubscribe one topic from the server AT+CMQTTUNSUB=0,9,0 >simcommsg +CMQTTUNSUB: 0,0 Disconnect from server AT+CMQTTDISC=0,120 +CMQTTDISC: 0,0 //Release the client AT+CMQTTREL=0 //stop MQTT Service AT+CMQTTSTOP +CMQTTSTOP: 0 3.2 Connect to SSL/TLS MQTT server (not verify server) Following commands shows how to access to a MQTT server without verifying the server. It needs to configure the authentication mode to 0, and then it will connect to the server successfully.
  • Page 34 Smart Machine Smart Decision Connect to a MQTT server AT+CMQTTCONNECT=0,"tcp://test.mosquitto.org:8883",60,1 +CMQTTCONNECT: 0,0 Set the topic for the PUBLISH message AT+CMQTTTOPIC=0,13 > dddrrrggghhhk Set the payload for the PUBLISH message AT+CMQTTPAYLOAD=0,60 > 012345678901234567890123456789012345678901234567890123456789 Publish a message AT+CMQTTPUB=0,1,60 +CMQTTPUB: 0,0 Set one topic for the SUBSCRIBE message AT+CMQTTSUBTOPIC=0,9,1 >123456789 Subscribe a message...
  • Page 35: Access To Ssl/Tls Mqtt Server (Only Verify The Server)

    Smart Machine Smart Decision Disconnect from server AT+CMQTTDISC=0,120 +CMQTTDISC: 0,0 //Release the client AT+CMQTTREL=0 //stop MQTT Service AT+CMQTTSTOP +CMQTTSTOP: 0 3.3 Access to SSL/TLS MQTT server (only verify the server) Following commands shows how to access to a SSL/TLS MQTT server with verifying the server. It needs to configure the authentication mode to 1 and the right server root CA, and then it will connect to the server successfully.
  • Page 36 Smart Machine Smart Decision Set the will topic for the CONNECT message AT+CMQTTWILLTOPIC=0,10 >0123456789 Set the will message for the CONNECT message AT+CMQTTWILLMSG=0,6,1 > qwerty Connect to a MQTT server, input the right server and port AT+CMQTTCONNECT=0,"tcp://mqtts_server:port",60,1 +CMQTTCONNECT: 0,0 Set the topic for the PUBLISH message AT+CMQTTTOPIC=0,13 >...
  • Page 37: Access To Ssl/Tls Mqtt Server (Verify Server And Client)

    Smart Machine Smart Decision +CMQTTSUB: 0,0 Unsubscribe one topic from the server AT+CMQTTUNSUB=0,9,0 >simcommsg +CMQTTUNSUB: 0,0 Disconnect from server AT+CMQTTDISC=0,120 +CMQTTDISC: 0,0 //Release the client AT+CMQTTREL=0 //stop MQTT Service AT+CMQTTSTOP +CMQTTSTOP: 0 3.4 Access to SSL/TLS MQTT server (verify server and client) Following commands shows how to access to a SSL/TLS MQTT server with verifying the server and client.
  • Page 38 Smart Machine Smart Decision // Set the client certificate of the first SSL context AT+CSSLCFG=”clientcert”,0,”cert.pem” // Set the client key of the first SSL context AT+CSSLCFG=”clientkey”,0,”key_cert.pem” // start MQTT service, activate PDP context AT+CMQTTSTART +CMQTTSTART: 0 Acquire one client which will connect to a SSL/TLS MQTT server AT+CMQTTACCQ=0,”client test0”,1 // Set the first SSL context to be used in the SSL connection...
  • Page 39 Smart Machine Smart Decision > 012345678901234567890123456789012345678901234567890123456789 Publish a message AT+CMQTTPUB=0,1,60 +CMQTTPUB: 0,0 Set one topic for the SUBSCRIBE message AT+CMQTTSUBTOPIC=0,9,1 >123456789 Subscribe a message AT+CMQTTSUB=0 +CMQTTSUB: 0,0 Subscribe one topic from the server AT+CMQTTSUB=0,9,1 >simcommsg +CMQTTSUB: 0,0 Unsubscribe one topic from the server AT+CMQTTUNSUB=0,9,0 >simcommsg +CMQTTUNSUB: 0,0...
  • Page 40: Access To Mqtt Server Without Checking Utf8 Coding

    Smart Machine Smart Decision 3.5 Access to MQTT server without checking UTF8 coding Following commands shows how to communicate with a MQTT server without checking UTF8 coding. // start MQTT service, activate PDP context AT+CMQTTSTART +CMQTTSTART: 0 Acquire one client which will connect to a MQTT server not SSL/TLS AT+CMQTTACCQ=0,”client test0”...
  • Page 41 Smart Machine Smart Decision >鼢鼢鼢鼢? Publish a message AT+CMQTTPUB=0,1,60 +CMQTTPUB: 0,0 //receive publish message from server +CMQTTRXSTART: 0,9,0 +CMQTTRXTOPIC: 0,9 鼢鼢鼢鼢? +CMQTTRXEND: 0 Disconnect from server AT+CMQTTDISC=0,120 +CMQTTDISC: 0,0 //Release the client AT+CMQTTREL=0 //stop MQTT Service AT+CMQTTSTOP +CMQTTSTOP: 0 SIM7500_SIM7600_SIM7800 Series_MQTT_AT Command Manual 40 / 41...

This manual is also suitable for:

Sim7800 seriesSim7600 series

Table of Contents