title: Use a variety of modules MQTT protocol summary
tags: summary of the work
date: 2019-02-19 13:45:00
Preface:
As companies build things IOT platform is based on MQTT agreement, coupled with our equipment to support various types of modules
- WIFI module (using the most common EMC modules can)
- 4G module (micro snow SIM7600CE module)
- NB-IOT module (IOT module emerging high ME3616)
Problems encountered:
- The first is the COAP protocol compatibility problems, we wanted to start with NB module, COAP protocol, after all, more fire, however, the effect of the test is not very good, especially in Shandong has modular character networking platform, their COAP protocol does not support build their own server, which is not in line with my whole route, then there is the use of micro snow NB module, I found his COAP is not perfect. The first is the COAP protocol compatibility problems, we wanted to start with NB module, COAP protocol, after all, more fire, however, the effect of the test is not very good, especially in Shandong has modular character networking platform, their COAP protocol does not support build their own server, which is not in line with my whole route, then there is the use of micro snow NB module, I found his COAP is not perfect.
- Second is to build MQTT server, because of his universality, it is relatively simple to build server.
- Later, we used a higher compatibility MQTT protocol, this protocol uses relatively common, so relatively speaking with a relatively simple, especially in WIFI module to interface MQTT agreement, it's easy to make out products, but we also to other the type of communication module was selection, finally found a suitable MQTT protocol module, and up and running relatively stable, such as the emerging high things together as a master of NB module, we have to be installed to run on the device.
- Android development MQTT agreement, Andrews has some firmware package can be used directly for MQTT protocol, so this is also soon be able to get in.
Here is a variety of debugging module AT command notes:
First snow of micro 4G module SIM7600CE
Here it must be Tucao about, to official documents are wrong, a lot of places are wrong
website: http://www.simcom.com/product/showproduct.php?lang=cn&id=48
micro snow URL: HTTP: / /www.waveshare.net/wiki/SIM7600CE_4G_HAT
the MQTT Description (many mistakes): http://www.waveshare.net/w/upload/6/65/SIM7500_SIM7600_Series_MQTT_ATC_V1.01.pdf
instruction | Features |
---|---|
AT+CRESET | Reset Module |
AT+CMQTTSTART | Start connecting MQTT |
AT+CMQTTACCQ=0,“client c” | Set id |
AT+CMQTTCONNECT=0,“tcp://60.205.203.64”,60,1,“root”,“citc2018” | Connecting to the server (default port 1883) |
AT+CMQTTTOPIC=0,5 | Settings topic (sent directly behind the characters, to correspond to the length) |
AT+CMQTTPAYLOAD=0,5 | Message content is provided (sent directly behind the characters, to correspond to the length of |
AT+CMQTTPUB=0,1,60 | make an announcement |
AT+CMQTTDISC=0, 120 | Disconnect |
High on the emerging IOT module ME3616
Buy a development board, the Knights electronic high version with GPS
instruction | Features |
---|---|
AT+ZRST | Reset Module |
AT+ZCONTLED=1 | Open indicator (off by default) |
at+ipr=9600 | Serial port baud rate setting |
AT+EMQNEW=“47.105.157.158”,“1883”,12000,100 | Set the domain name |
AT+EMQCON=0,3,“wenzheng”,60000,1,0,“root”,“citc2018” | Connection MQTT |
AT + eMQS = 0, 1, "qishiNB" | Subscribe theme |
AT + EMQPUB = 0, "qishiNB" 1,0,0,4, "31323334" | Dissemination of information (message type to ASCII code) |
GPS instruction set
instruction | Features |
---|---|
AT+ZGRUN=0 | Stop positioning |
AT+ZGRUN=1 | Start Single Location |
AT+ZGRUN=2 | Start tracking and positioning |
Mobile M5311
MQTT
instruction | Features |
---|---|
AT+IPR=9600 | Set the baud rate |
AT+CMSYSCTRL=0,2 | Open Indicator |
AT+CSQ | Signal quality |
AT + MQTTCFG = "Domain", 1883, "zyNBiot", 120, "75829", "IIOu0oFUg1guk20ornTK1uzAcnM =", 1 | MQTT Configuration |
AT+MQTTOPEN=1,1,1,1,1,“mywill”,“001bye” | Connection MQTT |
AT+MQTTPUB=“device/nb/citc”,1,1,0,0,“hello” | make an announcement |
HTTP
instruction | Features |
---|---|
AT+HTTPCREATE=“http://47.105.157.158:9094/” | HTTP settings |
AT+HTTPHEADER=0,“User-Agent: Unkown\r\nConnection: close\r\n” | Setting protocol headers |
AT+HTTPSEND=0,1,"/topic/123" | Sending a post request |
AT+HTTPCLOSE=0 | Close HTTP |