logo资料库

SIM82XX_SIM83XX Series_MQTT(S)_Application Note_V1.01.pdf

第1页 / 共18页
第2页 / 共18页
第3页 / 共18页
第4页 / 共18页
第5页 / 共18页
第6页 / 共18页
第7页 / 共18页
第8页 / 共18页
资料共18页,剩余部分请下载后查看
About Document
Version History
Scope
Contents
1Introduction
1.1Purpose of the document
1.2Related documents
1.3Conventions and abbreviations
2MQTT Introduction
2.1Characteristic
2.2Request Method
3AT Commands for MQTT(S)
4Bearer Configuration
4.1PDN Auto-activation
5MQTT(S) Examples
5.1MQTT Function
5.1.1Access to MQTT server without SSL/TLS
5.1.2Access to MQTT server without checking UTF8 coding
5.2MQTTS Function
5.2.1Connect to SSL/TLS MQTT server (not verify server)
5.2.2Access to SSL/TLS MQTT server (only verify the ser
5.2.3Access to SSL/TLS MQTT server (verify server and c
SIM82XX_SIM83XX Series _MQTT(S)_Application Note 5G Module SIMCom Wireless Solutions Limited SIMCom Headquarters Building, Building 3, No. 289 Linhong Road, Changning District, Shanghai P.R. China Tel: 86-21-31575100 support@simcom.com www.simcom.com
SIM82XX_SIM83XX Series_MQTT(S)_Application Note_V1.01 SIM82XX_SIM83XX Series_MQTT(S)_Application Note 1.01 2021.11.25 Released Document Title: Version: Date: Status: 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. FURTHERMORE, SYSTEM VALIDATION OF THIS PRODUCT DESIGNED BY SIMCOM WITHIN A LARGER ELECTRONIC SYSTEM REMAINS THE RESPONSIBILITY OF THE CUSTOMER OR THE CUSTOMER’S SYSTEM INTEGRATOR. ALL SPECIFICATIONS SUPPLIED HEREIN ARE SUBJECT TO CHANGE. COPYRIGHT THIS DOCUMENT CONTAINS PROPRIETARY TECHNICAL INFORMATION WHICH IS THE PROPERTY OF SIMCOM WIRELESS SOLUTIONS LIMITED COPYING, TO OTHERS AND USING THIS DOCUMENT, ARE FORBIDDEN WITHOUT EXPRESS AUTHORITY BY SIMCOM. OFFENDERS ARE LIABLE TO THE PAYMENT OF INDEMNIFICATIONS. ALL RIGHTS RESERVED BY SIMCOM IN THE PROPRIETARY TECHNICAL INFORMATION, INCLUDING BUT NOT LIMITED TO REGISTRATION GRANTING OF A PATENT , A UTILITY MODEL OR DESIGN. ALL SPECIFICATION SUPPLIED HEREIN ARE SUBJECT TO CHANGE WITHOUT NOTICE AT ANY TIME. SIMCom Wireless Solutions Limited SIMCom Headquarters Building, Building 3, No. 289 Linhong Road, Changning District, Shanghai P.R. China Tel: +86 21 31575100 Email: simcom@simcom.com For more information, please visit: https://www.simcom.com/download/list-863-en.html For technical support, or to report documentation errors, please visit: https://www.simcom.com/ask/ or email to: support@simcom.com Copyright © 2021 SIMCom Wireless Solutions Limited All Rights Reserved. www.simcom.com 2 / 18
SIM82XX_SIM83XX Series_MQTT(S)_Application Note_V1.01 About Document Version History Version V1.00 V1.01 Date 2020.3.23 2021.11.25 Owner Ning.Lv Xianxiang.Ma What is new First Release Update format Scope This document applies to the SIMCom SIM820X series, SIM821X series, SIM826X series and SIM83XX series. www.simcom.com 3 / 18
SIM82XX_SIM83XX Series_MQTT(S)_Application Note_V1.01 Contents About Document............................................................................................................ 3 Version History.........................................................................................................................................................3 Scope........................................................................................................................................................................ 3 Contents........................................................................................................................... 4 1 Introduction............................................................................................................... 5 Purpose of the document.......................................................................................................................5 Related documents.................................................................................................................................5 Conventions and abbreviations............................................................................................................ 5 1.1 1.2 1.3 2 MQTT Introduction...................................................................................................6 Characteristic...........................................................................................................................................6 Request Method......................................................................................................................................6 2.1 2.2 3 AT Commands for MQTT(S)..................................................................................8 4 Bearer Configuration.............................................................................................. 9 PDN Auto-activation................................................................................................................................9 4.1 5.1 5.2 5.1.1 5.1.2 5 MQTT(S) Examples................................................................................................11 MQTT Function......................................................................................................................................11 Access to MQTT server without SSL/TLS................................................................................ 11 Access to MQTT server without checking UTF8 coding........................................................12 MQTTS Function...................................................................................................................................13 Connect to SSL/TLS MQTT server (not verify server)........................................................... 13 Access to SSL/TLS MQTT server (only verify the server).....................................................15 Access to SSL/TLS MQTT server (verify server and client)..................................................16 5.2.1 5.2.2 5.2.3 www.simcom.com 4 / 18
SIM82XX_SIM83XX Series_MQTT(S)_Application Note_V1.01 1 Introduction 1.1 Purpose of the document Based on module AT command manual, this document will introduce MQTT(S) application process. Developers could understand and develop application quickly and efficiently based on this document. 1.2 Related documents [1] SIM82XX_SIM83XX Series_AT Command Manual 1.3 Conventions and abbreviations In this document, the GSM engines are referred to as following term:  ME (Mobile Equipment);  MS (Mobile Station);  TA (Terminal Adapter);  DCE (Data Communication Equipment) or facsimile DCE (FAX modem, FAX board); In application, controlling device controls the GSM engine by sending AT Command via its serial interface. The controlling device at the other end of the serial line is referred to as following term:  TE (Terminal Equipment);  DTE (Data Terminal Equipment) or plainly "the application" which is running on an embedded system; www.simcom.com 5 / 18
SIM82XX_SIM83XX Series_MQTT(S)_Application Note_V1.01 2 MQTT Introduction MQTT (Message Queuing Telemetry Transport) is a lightweight broker-based publish/subscribe messaging protocol. It is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium. is useful It 2.1 Characteristic  Support client/server mode;  The publish/subscribe message pattern to provide one-to-many message distribution and decoupling of applications  A messaging transport that is agnostic to the content of the payload  The use of TCP/IP to provide basic network connectivity  Three qualities of service for message delivery  A small transport overhead (the fixed-length header is just 2 bytes), and protocol exchanges minimised to reduce network traffic  A mechanism to notify interested parties to an abnormal disconnection of a client using the Last Will and Testament feature 2.2 Request Method According to the MQTT standard, MQTT provides a variety of request methods. CONNECT, SUBSCRIBE, PUBLISH, UNSUBSCRIBE, DISCONNECT, PINGREQ No Method 1 CONNECT www.simcom.com Description When a TCP/IP socket connection is established from a client to a server, a protocol level session must be created using a CONNECT flow. 6 / 18
SIM82XX_SIM83XX Series_MQTT(S)_Application Note_V1.01 2 SUBSCRIBE 3 4 5 6 PUBLISH UNSUBSCRIBE DISCONNECT PINGREQ The SUBSCRIBE message allows a client to register an interest in one or more topic names with the server. Messages published to these topics are delivered from the server to the client as PUBLISH messages. The SUBSCRIBE message also specifies the QoS level at which the subscriber wants to receive published messages. A PUBLISH message is sent by a client to a server for distribution to interested subscribers. Each PUBLISH message is associated with a topic name (also known as the Subject or Channel). This is a hierarchical name space that defines taxonomy of information sources for which subscribers can register an interest. A message that is published to a specific topic name is delivered to connected subscribers for that topic. An UNSUBSCRIBE message is sent by the client unsubscribe from named topics. The DISCONNECT message is sent to the server to indicate that it is about to close its TCP/IP connection. This allows for a clean disconnection, rather than just dropping the line. The PINGREQ message is an "are you alive?" message that is sent from a connected client to the server. from the client to the server to www.simcom.com 7 / 18
SIM82XX_SIM83XX Series_MQTT(S)_Application Note_V1.01 3 AT Commands for MQTT(S) Description Command AT+CMQTTSTART AT+CMQTTSTOP AT+CMQTTACCQ AT+CMQTTREL AT+CMQTTSSLCFG AT+CMQTTWILLTOPIC AT+CMQTTWILLMSG AT+CMQTTCONNECT AT+CMQTTDISC AT+CMQTTTOPIC AT+CMQTTPAYLOAD AT+CMQTTPUB AT+CMQTTSUBTOPIC AT+CMQTTSUB AT+CMQTTUNSUBTOPIC AT+CMQTTUNSUB AT+CMQTTCFG Start MQTT service Stop MQTT service Acquire a MQTT client Release a MQTT client Set the SSL context Input the topic of will message Input the will message Connect to a MQTT server Disconnect from server Input the publish message topic Input the publish message body Publish a message to server Input a subscribe message topic Subscribe a message to server Input a unsubscribe message topic Unsubscribe a message to server Configure the MQTT Context For detail information, please refer to “SIM82XX_SIM83XX Series_AT Command Manual“. www.simcom.com 8 / 18
分享到:
收藏