Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
doc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
胡高建
doc
Commits
023c1b2d
Commit
023c1b2d
authored
Apr 21, 2021
by
胡高建
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
0dc62b84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
README.md
README.md
+16
-13
No files found.
README.md
View file @
023c1b2d
### 自定义MQTT交互接口
### 自定义MQTT交互接口
####
Change Log
####
修改日志
-
2021-04-21:
-
2021-04-21:
-
xxx
-
xxx
...
@@ -9,14 +9,13 @@
...
@@ -9,14 +9,13 @@
```
javascript
```
javascript
{
{
"version"
:
{
version
},
"device_name"
:
{
device_name
},
"device_name"
:
{
device_name
},
"lan_ip"
:
{
lan_ip
},
"lan_ip"
:
{
lan_ip
},
"timestamp"
:
{
timestamp
}
"timestamp"
:
{
timestamp
}
}
}
```
```
version、
device_name、lan_ip都是字符型,timestamp是整型,为10位数的时间戳
device_name、lan_ip都是字符型,timestamp是整型,为10位数的时间戳
...
@@ -24,12 +23,18 @@ version、device_name、lan_ip都是字符型,timestamp是整型,为10位数
...
@@ -24,12 +23,18 @@ version、device_name、lan_ip都是字符型,timestamp是整型,为10位数
| Function | Topic | Payload | Remark |
| Function | Topic | Payload | Remark |
| ---------------- | -------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------- |
| ---------------- | -------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------- |
| 关机上报 | /{productID}/{deviceName}/up/device_state_changed | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"state": "off", "auto": true}} | 自动关机时auto传true,手动传false |
| 关机上报 | /{productID}/{deviceName}/up/device_state_changed | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"state": "off", "auto": true}} | 自动关机时auto传true,手动传false |
| 开机上报 | /{productID}/{deviceName}/up/device_state_changed | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"state": "on"}} | |
| 开机上报 | /{productID}/{deviceName}/up/device_state_changed | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"state": "on"}} | |
| 指令执行完成上报 | /{productID}/{deviceName}/up/commands_execution_finished | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"success": true}} | 成功传true,失败传false |
| 指令执行完成上报 | /{productID}/{deviceName}/up/commands_execution_finished | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"success": true}} | 成功传true,失败传false |
| 资源更新完成 | /{productID}/{deviceName}/up/resource_updated | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"resource_id": "1"} | |
| 缓存数据超时 | /{productID}/{deviceName}/up/cache_timed_out | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"cache_id": "1"} | |
| 资源更新进度上报 | /{productID}/{deviceName}/up/resource_updating_progress | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"resource_id": "1", "progress": 0.8} | progress为当前进度,取值0<=progress<=1 |
| 设备上报当前版本号 | /{productID}/{deviceName}/up/ota | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"type": "report_version", "version": "0.1"}} | |
| 缓存数据超时 | /{productID}/{deviceName}/up/cache_timed_out | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"cache_id": "1"} | |
| 设备上报下载进度 | /{productID}/{deviceName}/up/ota | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"type": "report_progress", "version": "0.1", "state": "downloading", "percent":"10"}} | |
| 设备开始升级 | /{productID}/{deviceName}/up/ota | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"type": "report_progress", "version": "0.1", "state": "burning"}} | |
| 上报升级成功 | /{productID}/{deviceName}/up/ota | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"type": "report_progress", "version": "0.1", "state": "done"}} | |
| 上报升级失败 | /{productID}/{deviceName}/up/ota | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"type": "report_progress", "version": "0.1", "state": "fail", "reason": "timeout"}} | |
| 发起指令序列上传任务 | /{productID}/{deviceName}/up/commands_upload | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"type": "request_upload}} | |
| 上报指令序列上传成功 | /{productID}/{deviceName}/up/commands_upload | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"type": "report_state", "success": true, "url": "xxx"}} | |
| 上报指令序列上传失败 | /{productID}/{deviceName}/up/commands_upload | {"device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"type": "report_state", "success": false, "url": "xxx"}} | |
...
@@ -37,8 +42,6 @@ version、device_name、lan_ip都是字符型,timestamp是整型,为10位数
...
@@ -37,8 +42,6 @@ version、device_name、lan_ip都是字符型,timestamp是整型,为10位数
| Function | Topic | Payload | Remark |
| Function | Topic | Payload | Remark |
| ------------------- | ---------------------------------------------------- | -------------------------------- | ------------------- |
| ------------------- | ---------------------------------------------------- | -------------------------------- | ------------------- |
| 资源下载地址 | /{productID}/{deviceName}/down/resource_download_url | {"resource_url": "https://xxx.yyy.zzz"} | |
| 下发指令序列上传地址 | /{productID}/{deviceName}/down/commands_upload | {"url": "https://xxx.yyy.zzz"} | |
| 资源上传id | /{productID}/{deviceName}/down/resource_upload_id | {"resource_id": "xxx"} | resource_id为字符型 |
| 下发升级包链接| /{productID}/{deviceName}/down/ota | {"version": "0.2", "packages":
[
{"url": "xxx", "file_size": "xxx", "md5sum": "xxx"}, {"url": "xxx", "file_size": "xxx", "md5sum": "xxx"}
]
} | |
| 资源上传地址 | /{productID}/{deviceName}/down/resource_upload_url | {"resource_url": "https://xxx.yyy.zzz"} | |
| 心跳间隔最大周期(s) | /{productID}/{deviceName}/down/heartbeat_max_seconds | {"seconds": 300} | seconds为整型 |
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment