当前位置:网站首页>Onenet Internet of things platform - mqtt product equipment upload data points
Onenet Internet of things platform - mqtt product equipment upload data points
2022-07-01 12:05:00 【Rain cloud 21】
| System topic | purpose |
|---|---|
$sys/{pid}/{device-name}/dp/post/json | The device uploads data points |
$sys/{pid}/{device-name}/dp/post/json/accepted | System notification " The device uploads data points successfully " |
$sys/{pid}/{device-name}/dp/post/json/rejected | System notification " The device failed to upload data points " |
Subscribe to upload result notification
Devices can subscribe to the system topic Get upload data point result message
open MQTT.fx, Connecting device , choice Subscribe term , Enter subscription topic name
topic The naming rules are as follows (
+The wildcard ):$sys/{ pid}/{ device-name}/dp/post/json/+
For example, mine is $sys/480701/yuyun-test/dp/post/json/+, You can receive the notification sent back by the platform
The two commands in the figure below can obtain the commands sent by the platform to the device :

Device data point upload
choice Publish term , Enter publish topic , The naming rules are as follows :
$sys/{
pid}/{
device-name}/dp/post/json
The data content is as follows :
{
"id": 123,
"dp": {
"temperatrue": [{
"v": 30,
"t": 1552289676
}],
"power": [{
"v": 4.5,
"t": 1552289676
}],
"status": [{
"v": {
"color": "blue"
},
"t": 1552289677
},
{
"v": {
"color": "red"
},
"t": 1552289678
}
]
}
}
Parameter description :
| Parameters | type | If required | explain |
|---|---|---|---|
| id | int | yes | news ID, Greater than 0 The integer of , The range of values is ,4 The value range of signed number of bytes |
| dp | object | yes | Data point content ,key-value Format ,key Is the name of the data stream ,value by list One or more data point values in the format In the above example, I want to temperatrue、power、status Upload time stamped data in three data streams |
| v | - | yes | Data point value , It can be for int/float/string/object Multiple formats |
| t | init | no | Data point timestamp ,unix Time , The unit is in seconds , If you don't carry , Then the system will take the data arrival time as its data time |

Click on Publish Then upload data points to the platform , stay Subscribe You can see the information returned by the platform

The console looks at the data
Get into onenet View device data flow on the console , Here's the picture : Just use MQTT.fx Data uploaded by simulated devices

Upload more data , Then click on the data flow of the console , You can see the historical data of the data stream

It can also be refreshed in real time ( If the device has been uploading data , Then the data can be displayed in real time )
边栏推荐
- Extended tree (I) - concept and C implementation
- Computer graduation project asp Net hotel room management system VS development SQLSERVER database web structure c programming computer web page source code project
- redis中value/set
- [Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 4
- Istio, ebpf and rsocket Broker: in depth study of service grid
- Software project management 9.2 Software project configuration management process
- Custom grpc plug-in
- How to set decimal places in CAD
- 241. 为运算表达式设计优先级 : DFS 运用题
- Dataset partitioning script for classification tasks
猜你喜欢

C knowledge point form summary 2

CAD如何设置标注小数位

Joint Time-Frequency and Time Domain Learning for Speech Enhancement

uniapp 使用 uni-upgrade-center

Chen Gong: Micro service, is it still so pure?

消息队列之监控退款任务批处理过程

Istio, ebpf and rsocket Broker: in depth study of service grid

Exploration and practice of inress in kubernetes

Software project management 9.2 Software project configuration management process

ABBIRB120工业机器人机械零点位置
随机推荐
Learning summary on June 29, 2022
Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
Use of easyexcel
迅为i.MX8Mmini开发板离线构建Yocto系统
epoll介绍
Golang introduces the implementation method of the corresponding configuration file according to the parameters
华为HMS Core携手超图为三维GIS注入新动能
Theoretical basis of graph
对于mvvm和mvc的理解
图的理论基础
深入理解 grpc part1
Is it safe for Huatai Securities to open an account online?
Virtualenv+pipenv virtual environment management
Summary of JFrame knowledge points 2
【单片机】【数码管】数码管显示
构建外部模块(Building External Modules)
Abbirb120 industrial robot mechanical zero position
Interpretation of R & D effectiveness measurement framework
S7-1500PLC仿真
leetcode 406. Queue Reconstruction by Height(按身高重建队列)