1.URL
http://124.223.60.234:8080/system/asset/command/sendCommand2Device
or Server in US
https://cloud.aovx.com/prod/system/asset/command/sendCommand2Device
2.Request parameters
2.1.Request headers
Add token in Headers: After successful login verification, the corresponding tokenId in user login response data
2.2.Parameters example
{
"terminalId":"1957EE0C69614AB3B3AF2755103B0AB6",
"terminalNum":"344050190425",
"msgId":33027,
"msgFlowId":1,
"encryptType":0,
"params":"{\"1\":\"10\"}",
"offline":0
}
2.3.Parameters description
Field | Data type | description | required |
---|---|---|---|
terminalId | String | Unique identification of device in the system | Y |
terminalNum | String | Device number | Y |
msgId | int | The message ID varies depending on the device. Currently, we only have (0x8103, 0x8104, 0x8105, 0x8900, 0x8A00), which is converted to a decimal value when send. For example, 0x8103=33027 | Y |
msgFlowId | int | Message serial number, in the range of (1~65534), can be randomly generated | Y |
encryptType | int | Whether to encrypt (0: not encrypted; 1: encrypted), default not encrypted | Y |
params | String | Command parameters, assembled according to different messages, converted into JSON strings and passed in | Y |
offline | int | Whether to send commands offline (0: real-time; 1: offline (if the current device is not online, the system will automatically send this command after the device goes online) | Y |
params description
For different message IDs, the corresponding fields for sending are different
0x8103:Device parameter settings
When sending 0x8103, you can select multiple parameter IDs to be send simultaneously
For example, if the device heartbeat interval is set, key corresponds to the command parameter ID, and value corresponds to setting the device heartbeat interval to 10 seconds, then the corresponding params are.
{"1":"10"}
For example, if I select multiple parameters and send them simultaneously, the corresponding params are:
{"16":"test","17":"test","18":"123456","19":"47.112.122.222","24":"6608"}
Where key is the parameter ID and value is the corresponding parameter content
0x8104:Query device parameters
This message does not require parameters, params is””.
0x8105:Device control
When issuing the 0x8105 command, only one parameter ID can be selected separately
For example:
1. Parameter ID=4, device restarted, no other parameters params=”{4:” “}”
2. Parameter ID=5,Restore factory settings, no other parameters params=”{5:””}”
3. Parameter ID=32,OTA upgrade; The passed in parameter params:
{32:{"PROTOCOL":"0","VERSION":"xxxxxxxxxxxxx","MODE":"0","TYPE":"0","URL":"http://47.112.122.222:8080/xxxxx.bin"}}
Where key: 32 represents the parameter ID
Value is a Map, where
PROTOCOL:Upgrade protocol:0:FTP;1:HTTP
VERSION:Upgrade version number
MODE:Upgrade mode: 0: Whole package upgrade; 1: Differential upgrade
TYPE:Upgrade type: 0: App upgrade; 1: Code upgrade
URL:Upgrade Package url
4. Parameter ID=33,Oil circuit control; The passed in parameter params:
{"33":1}
Where key: 33 represents the parameter ID, value: (0: on; 1: off)
5. Parameter ID=34,Power control; The passed in parameter params:
{"34":0}
Where key: 34 represents the parameter ID, value: (0: off; 1: on)
6. Parameter ID=35,GPIO output control; The input parameter params:
{"35":{"CHANNEL":"1","MODE":"0"}}
Where key: 35 represents the parameter ID, and value is a Map
CHANNEL:channel number(0~15)
MODE:0: Off 1: On
7. Parameter ID=36,Transparent AT, with parameter params:
{"36":"xxxxxxxxxxxxx"}
Where key: 36 represents the parameter ID, and value is the string that needs to be passed through
3.Response content
3.1.Response example
{
"code": 200,
"message": "Operation succeeded",
"data": null
}
3.2.Response description
Field | Data type | description |
---|---|---|
code | int | Return code |
message | String | Return message |
data | object | Response data |
最后编辑:admin 更新时间:2024-12-27 19:48