2.UDP Data sending and receiving
3.OneNET Data sending and receiving
Note: There should be a time interval between each AT command
M5310 | indicates |
---|---|
OK | //Starting up information. |
AT | //After starting up, AT is sent in a loop until it returns OK, which proves that the module initialization is normal. |
OK | - |
AT+COPS=1,2,"46000" | //Set up manual registration for mobile operationsMNC |
OK | - |
AT+NEARFCN=0,3555 | //The locked frequency point is 3555. The locked frequency can effectively reduce the Internet search time, but the wrong frequency point setting will lead to the Internet search failure, so it is recommended not to set the locked frequency under normal circumstances. |
OK | - |
AT+CSCON=1 | //Turn on automatic reporting of signal prompt. |
OK | - |
AT+CEREG=1 | Turn on automatic reporting of registration information |
OK | - |
+CSCON:1 | Automatically reported network signal prompt——Connected |
+CEREG:1,19E6,94,7 | //Automatically reported network registration information: 1-The local network has been registered online; 5-Roaming has been registered; Other cases are registration exceptions, please refer to the AT command manual for details; In case automatic reporting is not enabled, the users need to use AT+CEREG? to query the registration status. |
AT+CGDCONT? | - |
+CGDCONT:0,"IP", "nbiot.MNC002.MCC460.GPRS",,0,0 | //Query the current APN. This step can be omitted. |
OK | - |
Note: It is necessary to confirm that the network is in registered status before the subsequent data sending and receiving operation. In case the automatic reporting function is not used,
AT+CEREG? The command can be used to query the current registration status until it becomes registered. The current test starting up registration time ranges from 20s to 120s 。
AT+NSOCR=`<type>`,`<protocol>`,`<listen prt>`[,`<receive control>`]
For example:
AT+NSOCR="DGRAM",17,2334,1 | //Create a local UDP listening port, and turn on the automatic reporting of data arrival |
---|---|
0 | //Successful create the return socket number, with a value of 0-6. A maximum of 7 ports can be monitored |
OK | //Successfully create UDP |
Send a command that AT+NSOST or AT+NSOSTF can be used by data to the destination UDP address as below,
AT+NSOST=`<socket>`,`<remote_addr>`,`<remote_port>`,`<length>`,`<data>`
AT+NSOSTF=`<socket>`,`<remote_addr>`,`<remote_port>`,`<flag>`,`<length>`,`<data>`
For example:
AT+NSOST=0,183.230.40.150, 36000,10,30313233343536373839 |
--- |
---|---|
0,10 | //Socket No. 0 successfully sends 10 Byte UDP data |
OK | |
+NSONMI:0,30 | //Socket No.0 receives 30 Bytes data |
When UDP data is received, AT+NSORF can be used to read it, and when the read length is greater than the actual received length, the actual data length received by the buffer will be returned
AT+NSORF=<socket> ,<req_length> |
--- |
---|---|
+NSONMI:0,30 | //Prompt that Socket 0 receives 30 Bytes data |
AT+NSORF=0,30 | //Read the received 30Bytes data, |
0,183.230.40.150,36000,30, 5B3131372E3136392E33362E 31353A323137395D30313233343536373839,0 |
//Read the 30Bytes data sent by 183.230.40.150:36000 |
Note: The test server of this instance, which is the internal test server of China Mobile Internet of Things Company, can automatically reply “[Remote IP: Port] Receive data”. It is only used for test purposes, and the function of the server is not guaranteed.
AT+NSOCL=<socket> |
//<socket> is the id that has been assigned to the system when 2.1 is created |
---|---|
OK | - |
Visit the OneNET portal website: http://open.iot.10086.cn/ , and create NB-IOT products and devices.
The authentication information, imei, and imsi, used to create the device should be recorded and used in terminal registration. The returned device_id is the device access identification created on the platform side.
In case it is necessary to query the device information, the device id is required to be provided
AT+MIPLVER? |
---|
+MIPLVER: Version No. |
OK |
This command verifies whether the basic communication suite version of the terminal conforms to the statement of sending test, directly reads the communication suite version information at the client side, and compares the read version information with the declared version at the time of sending test. |
AT+MIPLCREATE |
+MIPLCREATE:ref value (usually 0) |
OK |
Add objects and instances to the base communication suite and send the registration process from the terminal side to the OneNet platform side. In case the registration is successful, the communication suite will be judged to be created successfully. |
AT+MIPLADDOBJ=0,3303,2,"11",6,1 |
---|
OK |
AT+MIPLADDOBJ=0,3306,1,"1",5,0 |
OK |
The LwM2M specification defines that each specific functional entity object and instance of the client to which the object corresponds represent different instances of the object.
A specified object instance can be confirmed by objectid and Instanceid; but there can be multiple resource attribute data under each object.
For example, in case the value of a device with a chip temperature sensor an external temperature sensor must be reported, the temperature sensor is a kind of object,
But instanceid is required to discern specific temperature sensors; the unit, temperature, and other values corresponding to the temperature sensor can be regarded as its resource attribute
For specific coding specifications, refer to the IPSO Specification or the OMA Model Specification http://www.openmobilealliance.org/wp/OMNA/LwM2M/LwM2MRegistry.html .
The terminal side is registered on the OneNet platform side, check the discover request sent on the OneNet platform side. In case the discover request contains 3303 and 3306, it will be judged that the addition is successful.
The device sends a registration request to the platform side. After receiving the registration information sent by the device, the platform side will check the device registration situation.
AT+MIPLOPEN=0,3600,30
OK
+MIPLEVENT: 0,6
+MIPLDISCOVER:0,msgid,3303
+MIPLDISCOVER:0,msgid,3306
+MIPLOBSERVE:0,msgid,1,3303,0,-1
+MIPLOBSERVE:0,msgid,1,3303,1,-1
+MIPLOBSERVE:0,msgid,1,3306,0,-1
Check the online status of the terminal (the icon is green) on the OneNet platform side (http://api.heclouds.com). In case the terminal is online, the device will be judged to be registered successfully.
GET http://api.heclouds.com/devices/status?imei=$IMEI&devIds=$DEVICE_ID HTTP/1.1
Host: api.heclouds.com/
api-key: api-key assigned by OneNet
Content-Length: 0
Expected reply of the terminal side: online : true
AT+MIPLUPDATE=0,0,0
OK
+MIPLEVENT:0,11
The terminal side sends the updated registration information without parameters to the platform side within this lifetime period,
The platform side responds to the updated registration information to confirm and check whether the terminal side has received the response from the platform side.
AT+MIPLUPDATE=0,3600,1
OK
+MIPLEVENT:0,11
The terminal side sends the updated registration information with parameters to the platform side within this lifetime period,
The platform side responds to and confirms the updated registration information and checks whether the terminal side has received the response from the platform side.
Under the condition that the device has been initialized, the basic communication suite (the configuration information contains the Bootstrap server address coap://183.230.40.39:5683) has been successfully created, the object and instance (3303, 3306) have been added to the basic communication suite, and the Bootstrap server is ready,
The client side sends a registration to the platform side to trigger the Bootstrap process and check whether the Bootstrap process is successful.
AT+MIPLOPEN=0,3600,30
OK
+MIPLEVENT: 0,1
+MIPLEVENT: 0,2
+MIPLEVENT: 0,6
+MIPLDISCOVER:0,msgid,3303
+MIPLDISCOVER:0,msgid,3306
+MIPLOBSERVE:0,msgid,1,3303,0,-1
+MIPLOBSERVE:0,msgid,1,3303,1,-1
+MIPLOBSERVE:0,msgid,1,3306,0,-1
The online status of the terminal is checked on the OneNet platform side (http://api.heclouds.com) (the icon is green). In case the terminal is online, the Bootstrap process will be judged to be successful.
GET http://api.heclouds.com/devices/status?imei=$IMEI&devIds=$DEVICE_ID HTTP/1.1
Host: api.heclouds.com/
api-key: api-key assigned by OneNet
Content-Length: 0
Expected reply of the terminal side: online : true
6 operations are provided by the current version of device management:discover、read、write、execute、write-attributes、observe、
MCU should report the corresponding operation result within a few seconds after executing the specified operation sent by the platform (3s is recommended), otherwise, the transmission information may be lost.
(1) discover operation
The device sends a registration request to the platform side, checks Discover request information on the platform side information received by the device, replies to the Discover request, and checks the device resources situation on the platform side.
AT+MIPLOPEN=0,3600,30
OK
+MIPLEVENT: 0,6
+MIPLDISCOVER:0,msgid1,3303
+MIPLDISCOVER:0,msgid2,3306
+MIPLOBSERVE:0,msgid3,1,3303,0,-1
+MIPLOBSERVE:0,msgid4,1,3303,1,-1
+MIPLOBSERVE:0,msgid5,1,3306,0,-1
AT+MIPLDISCOVERRSP=0,msgid1,1,34,"5700;5701;5601;5602;5603;5604;5605"
AT+MIPLDISCOVERRSP=0,msgid2,1,24,"5850;5851;5852;5853;5750"
OK
Check the terminal resources list on the OneNet platform side. In case the instance and resource information of the terminal device is fully displayed, it will be judged successful
GET http://api.heclouds.com/nbiot/resources?imei=$IMEI&obj_id=3303&obj_inst_id=0 HTTP/1.1
Host: api.heclouds.com/
api-key: Api-key assigned by OneNet
Content-Length: 0
Expected result:
Complete object, instance, resource list information of the terminal device.
The platform side device sends a Read operation request of the specified resource. After the device receives the message, the terminal communication suite obtains the resource value information of the device and returns it to the platform side for checking the read results.
AT+MIPLREADRSP=0,msgid,1,3303,0,5700,4,4,20.123,0,0
OK
Expected results of the OneNet platform side:
{"errno":0,"data":[{"res":[{"val":20.123,"res_id":5700}],"obj_inst_id":0}],"error":"succ"}
GET http://api.heclouds.com/nbiot?imei=$IMEI&obj_id=3303&obj_inst_id=0&res_id=5700 HTTP/1.1
Host: api.heclouds.com/
api-key: Api-key assigned by OneNet
Content-Length: 0
Expected reply of the terminal side:
+MIPLREAD:0,msgid,3303,0,5700
The platform side device sends a Read operation request of the specified instance. After the device receives the message, the terminal communication suite obtains the instance resource information of the device and returns it to the platform side for checking the read results.
AT+MIPLREADRSP=0,msgid,1,3303,0,5700,4,4,20.123,5,0
AT+MIPLREADRSP=0,msgid,1,3303,0,5701,1,3, "Cel",4,0
AT+MIPLREADRSP=0,msgid,1,3303,0,5601,4,4,10.123,3,0
AT+MIPLREADRSP=0,msgid,1,3303,0,5602,4,4,60.2,2,0
AT+MIPLREADRSP=0,msgid,1,3303,0,5603,4,4,0.0,1,0
AT+MIPLREADRSP=0,msgid,1,3303,0,5604,4,4,99.0,0,0
OK
OK
Expected reply of the terminal side:
{ "errno":0,
"data":[
{
"res":[
{"val":20.123,"res_id":5700},
{"val":"Cel","res_id":5701},
{"val":10.123,"res_id":5601},
{"val":60.2,"res_id":5602},
{"val":0.0,"res_id":5603},
{"val":99.0,"res_id":5604}
],
"obj_inst_id":0}
],
"error":"succ"
}
GET http://api.heclouds.com/nbiot?imei=$IMEI&obj_id=3303&obj_inst_id=0 HTTP/1.1
Host: api.heclouds.com/
api-key: Api-key assigned by OneNet
Content-Length: 0
Expected reply of the terminal side:
+MIPLREAD:0,msgid,3303,0,-1
The platform side device sends a Read operation request of the specified object. After the device receives the message, the terminal communication suite obtains the object and instance resource information of the device and returns it to the platform side for checking the read results.
AT+MIPLREADRSP=0,msgid,1,3303,0,5701,1,3, "Cel",3,0
AT+MIPLREADRSP=0,msgid,1,3303,0,5602,4,4,50.123,2,0
AT+MIPLREADRSP=0,msgid,1,3303,1,5701,1,3, "Cel",1,0
AT+MIPLREADRSP=0,msgid,1,3303,1,5602,4,4,55.123,0,0
OK
OK
OK
OK
Expected reply of the terminal side:
{
"errno":0,
"data":[
{
"res":[
{"val":"Cel","res_id":5701},
{"val":50.123,"res_id":5602}],
"obj_inst_id":0
},
{"res":[
{"val":"Cel","res_id":5701},
{"val":55.123,"res_id":5602}
],
"obj_inst_id":1}
],
"error":"succ"
}
GET http://api.heclouds.com/nbiot?imei=$IMEI&obj_id=3303 HTTP/1.1
Host: api.heclouds.com/
api-key: Api-key assigned by OneNet
Content-Length: 0
Expected reply of the terminal side:
+MIPLREAD:0,msgid,3303,-1,-1
Operation | Read(Resource read) |
---|---|
lwm2m-URI | address /{Object ID}/{Object Instance ID}/{Resource ID} |
Parameter description | { Object ID }:Required, such as the type of sensor on the device; { Object Instance ID }:Optional, the number of this type of sensor; {Resource ID}:Optional, data of some type of the sensor, such as current value and maximum value of the temperature, etc. |
CoAP-Method | GET |
CoAP-Option Option | 1:Uri-Path(11):{Object ID} Option 2:Uri-Path(11):{Object Instance ID} Option 3:Uri-Path(11):{Resource ID} Option 4:Accept(17): The types in the Content Format table in Section 1, such as the parameter application/vnd.oma.lwm2m+tlv refers to the format in which data is read. |
CoAP-payload | - |
Success | 2.05 Content |
Failure | 4.00 Bad Request, 4.01 Unauthorized, 4.04 Not Found, 4.05 Method Not Allowed |
Note: After each read operation, the length of the COAP message reported by the module response should be less than 512Bytes.
The platform side device sends a Write operation request of the specified resource. After the device receives the message, the terminal communication suite writes the specified value to the specified resource and checks the write result on the terminal side.
AT+MIPLWRITERSP=0,msgid,2
OK
Expected reply of the terminal side:
{"errno":0,"error":"succ"}
POST http://api.heclouds.com/nbiot?imei=$IMEI&obj_id=3306&obj_inst_id=0&mode=2 HTTP/1.1
Host: api.heclouds.com/
api-key: Api-key assigned by OneNet
Content-Length: 47 //The value is modified based on the actual body size of the HTTP message
Content-Type:application/json
HTTP content:{"data":[{"res_id":5850,"val":1}]}
Expected reply of the terminal side:
+MIPLWRITE:0,msgid,3306,0,5850,2,1,01,0,0
The platform side device sends a Write operation request of the specified instance. After the device receives the message, the terminal communication suite writes the specified value to the resource under the specified instance and checks the write result on the terminal side.
AT+MIPLWRITERSP=0,msgid,2
OK
Expected reply of the terminal side:
{"errno":0,"error":"succ"}
POST http://api.heclouds.com/nbiot?imei=$IMEI&obj_id=3306&obj_inst_id=0&mode=2 HTTP/1.1
Host: api.heclouds.com/
api-key: Api-key assigned by OneNet
Content-Length: 47 //The value is modified based on the actual body size of the HTTP message
Content-Type:application/json
HTTP content:{"data":[{"res_id":5850,"val":1},{"res_id":5851,"val":22}]}
Expected reply of the terminal side:
+MIPLWRITE:0,msgid,3306,0,5850,2,1,01,0,1
+MIPLWRITE:0,msgid,3306,0,5851,2,1,16,0,0
API message protocol of resource write-in is as follows:
Operation | Write(Resource write-in) |
---|---|
lwm2m-URI | address /{Object ID}/{Object Instance ID}/{Resource ID}/{NewValue} |
Parameter description { Object ID }:Required, such as the type of sensor on the device; | { Object Instance ID }:Required, the number of this type of sensor; {Resource ID}:Required, data of some type of the sensor, such as current value and maximum value of the temperature, etc.; {NewValue}:Required, write the value of the resource property. |
CoAP-Method PUT/POST | CoAP-Option Option 1:Uri-Path(11):{Object ID} Option 2:Uri-Path(11):{Object Instance ID} Option 3:Uri-Path(11):{Resource ID} Option 4:Content-Format(12):The format is those in the Content Format table, 如application/vnd.oma.lwm2m+tlv |
CoAP-payload | {NewValue},the data format is that specified in Option4 |
Success | 2.04 Changed |
Failure | 4.00 Bad Request, 4.01 Unauthorized, 4.04 Not Found, 4.05 Method Not Allowed |
Note: The length of COAP message sent for each write operation should be less than 512Bytes, so the maximum length of the data segment should be 480Bytes.
The platform side device sends an Exec operation request of the specified resource. After the device receives the message, the terminal communication suite writes the operation value to the specified resource and checks the execution result on the terminal side.
AT+MIPLEXECUTERSP=0,msgid,2
OK
Expected reply of the terminal side:
{"errno":0,"error":"succ"}
POST http://api.heclouds.com/nbiot/execute?imei=$IMEI&obj_id=3303&obj_inst_id=0&res_id=5605 HTTP/1.1
api-key:Api-key assigned by OneNet
Host: api.heclouds.com
Content-Length: 21 //The value is modified based on the actual body size of the HTTP message
Content-Type:application/json
HTTP content:{"args":"reset"}
Expected reply of the terminal side:
+MIPLEXECUTE:0,msgid,3303,0,5605,5, "reset"
Operation | Execute(Resource execution) |
---|---|
lwm2m-URI | address /{Object ID}/{Object Instance ID}/{Resource ID}/{Arguments} |
Parameter description | { Object ID }:Required, such as the type of sensor on the device; { Object Instance ID }: Required, the number of this type of sensor; {Resource ID}:Required, data of some type of the sensor, such as current value and maximum value of the temperature, etc.; {Arguments}:Optional, commands to be executed, such as restart, shutdown, etc. |
CoAP-Method | POST |
CoAP-Option | Option 1:Uri-Path(11):{Object ID} Option 2:Uri-Path(11):{Object Instance ID} Option 3:Uri-Path(11):{Resource ID} |
CoAP-payload | {Arguments},the format is the text/plain format in the Content Format table |
Success | 2.05 Changed |
Failure | 4.00 Bad Request, 4.01 Unauthorized, 4.04 Not Found, 4.05 Method Not Allowed |
Note: The length of COAP message sent by each execute operation should be less than 512Bytes, so the maximum length of the data segment should be 480Bytes.
The platform side device sends a Write-Attributes operation request of the specified resource. After the device receives the message, the terminal communication suite writes the attribute value to the specified resource and checks the execution result on the terminal side.
AT+MIPLPARAMETERRSP=0,msgid1,2
AT+MIPLPARAMETERRSP=0,msgid2,2
OK
OK
Expected reply of the terminal side:
{"errno":0,"error":"succ"} {"errno":0,"error":"succ"}
POST http://api.heclouds.com/nbiot/observe?imei=$IMEI&cancel=false&obj_id=3303&obj_inst_id=0
&res_id=5700&pmin=15&pmax=60>=50<=0&st=2 HTTP/1.1
POST http://api.heclouds.com/nbiot/observe?imei=$IMEI&cancel=false&obj_id=3303&obj_inst_id=0
&res_id=5601&pmin=18&pmax=90>=60<=0&st=2 HTTP/1.1
api-key:Api-key assigned by OneNet
Host: api.heclouds.com
Content-Length: 21 //The value is modified based on the actual body size of the HTTP message
Content-Type:application/json
{"args": " reset "}
Expected reply of the terminal side:
+MIPLPARAMETER:0,msgid1,3303,0,5700,37,"pmin=15;pmax=60;lt=0.0;gt=50.0;st=2.0"
+MIPLPARAMETER:0,msgid2,3303,0,5601,37,"pmin=18;pmax=90;lt=0.0;gt=60.0;st=2.0"
The platform side device sends an Observe operation request of the specified resource. After the device receives the message, the terminal communication suite subscribes to the specified resource and checks the execution result on the terminal side.
AT+MIPLPARAMETERRSP=0,msgid1,2
AT+MIPLPARAMETERRSP=0,msgid2,2
OK
OK
+MIPLOBSERVE:0,msgid3,1,3303,0,5700
+MIPLOBSERVE:0,msgid4,1,3303,0,5601
AT+MIPLOBSERVERSP=0,msgid3,1
AT+MIPLOBSERVERSP=0,msgid4,1
OK
OK
Expected reply of the terminal side:
{"errno":0,"error":"succ"}
{"errno":0,"error":"succ"}
GET http://api.heclouds.com/nbiot/observe?imei=$IMEI&cancel=false&obj_id=3303&obj_inst_id=0
&res_id=5700&pmin=15&pmax=60>=50<=0&st=2 HTTP/1.1
GET http://api.heclouds.com/nbiot/observe?imei=$IMEI&cancel=false&obj_id=3303&obj_inst_id=0
&res_id=5601&pmin=18&pmax=90>=60<=0&st=2 HTTP/1.1
api-key:Api-key assigned by OneNet
Host: api.heclouds.com
Content-Length: 21 //The value is modified based on the actual body size of the HTTP message
Content-Type:application/json
Expected reply of the terminal side:
+MIPLPARAMETER:0,msgid1,3303,0,5700,37,"pmin=15;pmax=60;lt=0.0;gt=50.0;st=2.0"
+MIPLPARAMETER:0,msgid2,3303,0,5601,37,"pmin=18;pmax=90;lt=0.0;gt=60.0;st=2.0"
The platform side device sends an Observe operation request of the specified instance. After the device receives the message, the terminal communication suite subscribes to the specified instance and checks the execution result on the terminal side.
AT+MIPLOBSERVERSP=0,msgid,1
OK
Expected reply of the terminal side:
{"errno":0,"error":"succ"}
API message instance for observing operations on the control platform:
GET http://api.heclouds.com/nbiot/observe?imei=$IMEI&cancel=false&obj_id=3303&obj_inst_id=0 HTTP/1.1
api-key:Api-key assigned by OneNet
Host: api.heclouds.com
Content-Length: 21 //The value is modified based on the actual body size of the HTTP message
Content-Type:application/json
Expected reply of the terminal side:
+MIPLOBSERVE:0,msgid,1,3303,0,-1
The platform side device sends an Observe operation request of the specified object. After the device receives the message, the terminal communication suite subscribes to the specified object and checks the execution result on the terminal side.
AT+MIPLOBSERVERSP=0,msgid,1
OK
Expected reply of the terminal side:
{"errno":0,"error":"succ"}
GET http://api.heclouds.com/nbiot/observe?imei=$IMEI&cancel=false&obj_id=3303 HTTP/1.1
api-key:Api-key assigned by OneNet
Host: api.heclouds.com
Content-Length: 21 //The value is modified based on the actual body size of the HTTP message
Content-Type:application/json
Expected reply of the terminal side:
+MIPLOBSERVE:0,msgid,1,3303,-1,-1
The platform side device sends an operation request to cancel the observation of a specified resource. After the device receives the message, the terminal communication suite cancels to subscribe to the specified resource and checks the execution result on the terminal side.
AT+MIPLOBSERVERSP=0,msgid,1
OK
Expected reply of the terminal side:
{"errno":0,"error":"succ"}
GET http://api.heclouds.com/nbiot/observe?imei=$IMEI&cancel=true&obj_id=3303&obj_inst_id=0&res_id=5700 HTTP/1.1
api-key:Api-key assigned by OneNet
Host: api.heclouds.com
Content-Length: 21 //The value is modified based on the actual body size of the HTTP message
Content-Type:application/json
Expected reply of the terminal side:
+MIPLOBSERVE:0,msgid,0,3303,0,5700
The platform side device sends an operation request to cancel the observation of a specified instance. After the device receives the message, the terminal communication suite cancels to subscribe to the specified instance and checks the execution result on the terminal side.
AT+MIPLOBSERVERSP=0,msgid,1
OK
Expected reply of the terminal side:
{"errno":0,"error":"succ"}
GET http://api.heclouds.com/nbiot/observe?imei=$IMEI&cancel=true&obj_id=3303&obj_inst_id=0 HTTP/1.1
api-key:Api-key assigned by OneNet
Host: api.heclouds.com
Content-Length: 21 //The value is modified based on the actual body size of the HTTP message
Content-Type:application/json
Expected reply of the terminal side:
+MIPLOBSERVE:0,msgid,0,3303,0,-1
The platform side device sends an operation request to cancel the observation of a specified object. After the device receives the message, the terminal communication suite cancels to subscribe to the specified object and checks the execution result on the terminal side.
AT+MIPLOBSERVERSP=0,msgid,1
OK
Expected reply of the terminal side:
{"errno":0,"error":"succ"}
GET http://api.heclouds.com/nbiot/observe?imei=$IMEI&cancel=true&obj_id=3303 HTTP/1.1
api-key:Api-key assigned by OneNet
Host: api.heclouds.com
Content-Length: 21 //The value is modified based on the actual body size of the HTTP message
Content-Type:application/json
Expected reply of the terminal side:
+MIPLOBSERVE:0,msgid,0,3303,-1,-1
AT+MIPLCLOSE=0
OK
Check the offline status of the terminal on the OneNet platform side (the icon is gray). In case the terminal is offline, the logout will be judged to be successful.
AT+MIPLDELETE=0(the ref value is usually 0)
OK
The terminal side sends the registration process to the OneNet platform side. In case the registration fails, the communication suite will be registered to be deleted successfully.
AT+MIPLDELOBJ=0,3306
OK
The terminal side is re-registered after it is logged out on the OneNet platform side. Check the discover request sent on the OneNet platform side. In case the discover request does not contain 3306, it will be judged that the object 3306 has been deleted successfully
GET http://api.heclouds.com/devices/status?imei=$IMEI&devIds=DEVICE_ID HTTP/1.1
Host: api.heclouds.com/
api-key: Api-key assigned by OneNet
Content-Length: 0
Expected reply of the terminal side:
online : false
Note: Users can also execute the destroy instance after sending a logout request to the platform when the module will automatically delete all objects.
Users can also directly execute the destroy instance when the module will delete the object after making a logout request to the platform and then destroy the object and communication instance.