The shift M5311 and onenet data summary

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/switch_love_case/article/details/89684919

title: the shift M5311 and onenet data summarized
Tags: NBIOT
DATE: 2019-4-29 23:32:00


The shift onenet re-learning


Today a friend asked me NB module M5311 server connection onenet problem, he has successfully connected, is issued by the data when there is a problem, in fact, are small problems, I see at a glance that he was working with buttons when issued logical addition to the problem, I soon help him, but at the same time I have found a new problem. Let me onenet understood why! !


First, take advantage of this opportunity to summarize the M5311's onenet instruction set again:

System-related settings:

instruction Features Remark
AT+CMRB Reset Module
AT+CMSYSCTRL=0,2 Open Indicator
AT+CEREG? Scan IP It can be used for power-ready
AT+CSQ Command signal
AT+SM=LOCK_FOREVER Close Sleep

MQTT general instructions:

instruction Features Remark
AT+MQTTCFG=“60.205.203.64”,1883,“zyNot”,120,“759”,“IIOuz”,1 MQTT Configuration
AT+MQTTOPEN=1,1,1,1,1,“mywill”,“001bye” And connection setting, will (optional)
AT+MQTTPUB=“device/nb/citc”,1,1,0,0,“hello” make an announcement You can post messages on any topic
AT+MQTTSUB=“/device/NB/zx11111111111111_back”,1 Subscribe to news Receiving data return

For onenet MQTT instructions:

instruction Features Remark
AT + MQTTCFG = "183.230.40.39", 6002, "device ID", 120, "product ID", "APIKEY", 1 MQTT Configuration
AT+MQTTOPEN=1,1,0,0,0,"","" Connection and set up, intestate
AT+MQTTPUB=$dp,0,1,0,28,0300197b2231223a312c2232223a312c2233223a312c2234223a357d
Wherein the length of the transmitted data 28, 03 for the third json data format, the data packet length 0019 Data packet is: { "1": 1, "2": 1, "3": 1, "4": 1}

The data on Onenet issued:


As shown, because the time to send data at Onenet button has a default value, so a lot of people all the time to send the button motor 0 and 1, so many people more confused, how to distinguish between instruction issued multiple buttons, in fact, this very well resolved, onenet is to support custom data points, different buttons on and off can be set to different data command, so it is easier to handle, right!

  • onenet of NB quick connection method, instead of using LWM2M! But still use MQTT wifi scheme! !
  • Formatting issues when developing onenet Android has multiple ways, first using the SDK and API onenet official, the other a more simple and crude is to use Android mqtt agreement (the cause of many failures before finally found) is announced , and ordinary MQTT client platforms are supported, such as sending strings ,, publish ( "T", "20"), but onenet is not allowed, but you are forced to send it, send weapons will make you dropped! That is the question I have for a long time before the encounter, today saw a blog suddenly realized: see end of the article reference links.
  • onenet support MQTT data streams are in hexadecimal. And he issued the data does not require a subscription, but does not support the beginning of the subscription system $ topics.

OK first summarize here, there are questions please leave a message below or contact: QQ group: 476 840 321

Reference links:
1, OneNet use and development of logic MQTT protocol
2, does not support the NB MQTT modules using TCP communications forced mqtt
3, high notes emerging ME3616 debugging Onenet

Guess you like

Origin blog.csdn.net/switch_love_case/article/details/89684919