当前位置:网站首页>This article understands the process from RS485 sensor to IoT gateway to cloud platform
This article understands the process from RS485 sensor to IoT gateway to cloud platform
2022-08-03 10:03:00 【Barium Rhenium Technology IoT Gateway】
一、概述
There is a need for equipment support at the industrial siteRS485通信,Various collections are possiblePLC、流量计、温湿度、液位等.应用特别广泛,Try to do it in a simpler way here,Let everyone understand the entire data collection process,For more details, please read the relevant manual.
钡铼技术:Focus on industrial IoT gateways,It can collect the vast majority of data standard instruments in the world、PLC、Building equipment, etc,Its selection here is itsBL110Multifunctional protocol IoT gateway.
ThingsPanel:开源物联网平台,免费、快速部署
二、实现功能
A、采集
数值类型:温度、湿度
Switch type:Power outage alarm status、烟感状态
B、控制
开关类型:水泵开关、风机启停
Controls the numeric type:Inverter frequency、Greenhouse shutter opening and closing
三、方案概述
用Modbus slaveSimulate various sensors,Barium Rhenium Industrial GatewayBL110通过Modbus RTU采集、Control various instruments/设备,并通过4G、Internet access via Ethernet,MQTTThe protocol is connected to the open source IoT cloud platformThingsPanel.如下图:

Sensor data point parameters
四、设置Modbus slave(模拟传感器)
电脑安装Modbus slave,并根据前面“Sensor data point parameters”,设置Modbus slave,Simulate various types of sensors.如下图:
Connection:选择"SerialPort"
Serial Settings:根据实际选择
Mode:选择“RTU”(这里采集的RS485设备,是标准Modbus RTU协议)
串口参数
注意:Modbus slave(模拟传感器)串口参数 need and industrial smart gatewayBL110The serial port parameters are the same
这里设置如下:
五、工业网关BL110配置参数
1、接线
①接电源(支持宽电压:9-36v)
②WANThe port network cable is connected to the local area network(可自动分配ip,Other network environment reference manuals)
③RS485接COM2,A接A,B接B

2、登录配置软件
打开配置软件→点击“设备搜索”→双击“IP地址”→输入密码,默认123456
注意:Device power on approx30sIt can be searched aroundip


3、设置串口参数
双击COM2,设置串口参数
注意:Here the serial port parameters and the previous settingsModbus slave(模拟传感器)参数一致
模式选择:采集
设备品牌:Modbus设备型号:Modbus_RTU
串口参数
4、Set the sensor address
5、Add device data point parameters
添加“温度”Take data points as an example:

添加其他数据,并保存
And so on for other data points,然后点“写入配置”,然后重新进入

保存后,设备会自动重启,Log back into the configuration software
注意:Device power on approx30sIt can be searched aroundip

6、View gateway and sensor communication
点击型号,查看基本信息.See the image below to the right“COM2”,The barium rhenium gateway is andModbus slave(模拟传感器)通信上,“绿色”on behalf of communications.

7、Industrial gateways view sensor data
点击“监视”,即可查看到,工业网关BL110The current value of the sensor is collected.如下图,has been collected.跟Modbus slave的一致.
If no data is collected,Please check whether the relevant parameters are set incorrectly and whether the current network environment is normal.



8、Connect to the open source IoT cloud platformThingsPanel
对接ThingsPanel平台是通过MQTT协议,设置如下:

前面“写入配置”后,点击型号,可以看到“MQTT Client”和“COM2”Online status has turned green,即BL110The gateway is connected to the cloud platform and the sensor is in communication.

9、BL110Smart Gateway Subscription、发布信息格式---KingPigeon模板
发布
{
"sensorDatas": [
{
"flag": "GPS",
"lat": "0.000000",
"lng": "0.000000"
},
{
"flag": "signal_strength",
"value": 0
},
{
"flag": "temperature",
"value": 30
},
{
"flag": "humidity",
"value": 68
},
{
"flag": "powerfailure",
"switcher": 1
},
{
"flag": "smoke",
"switcher": 0
},
{
"flag": "waterpump",
"switcher": 1
},
{
"flag": "fan",
"switcher": 0
},
{
"flag": "frequency",
"value": 33
},
{
"flag": "rollershutter",
"value": 55
}
],
"gateway_indentify": "BeiLai",
"time": "1658216760",
"addTime": "2022-07-19 07:46:00",
"seq": "0.4405.0.0"
}订阅
A、开关类型.用“switcher”,值
1表示开,true
0表示关.false
{
"sensorDatas": [
{
"switcher": 0,
"flag": "waterpump"
}
],
"down": "down"
}BNumeric type type.用“value”,值
注意:这个数值,需要加双引号
{
"sensorDatas": [
{
"value": "998",
"flag": "frequency"
}
],
"down": "down"
}六、用EMQX的客户端订阅、发布消息
1、Set up the connection to the open source cloud platformThingsPanel的MQTT参数
前面已经设置:工业智能网关BL110Set up the connected open source cloud platformThingsPanel(ip、端口、订阅主题、发布主题)

则EMQXThe client is also set as follows:

2、订阅主题:
Subscribe to IoT GatewayBL110data collected from the sensor

3、发布主题:
Turn on the water pump

边栏推荐
- array of function pointers
- bihash总结
- MySQL中tinytext、text、mediumtext和longtext等各个类型详解[通俗易懂]
- For heavy two-dimensional arrays in PHP
- 015-Balanced binary tree (1)
- GO开发环境配置
- When deleting a folder, the error "Error ox80070091: The directory is not empty" is reported. How to solve it?
- C语言二维数组用一维数组进行调用
- 分区分表(一)
- mysql 事务原理详解
猜你喜欢
随机推荐
分辨率_分辨率越高越好?手机屏幕分辨率多少才合适?现在终于搞清楚了[通俗易懂]
播放量暴涨2000w+,单日狂揽24w粉,内卷的搞笑赛道还有机会
报告:想学AI的学生数量已涨200%,老师都不够用了
慢 SQL 分析与优化
go中select语句
mysql 事务原理详解
MySQL 免安装版的下载与配置教程
梯度消失和梯度爆炸
进入 SQL Client 创建 table 后,在另外一个节点进入 SQL Client 查询不到
015-Balanced binary tree (1)
go泛型使用方法
Mysql OCP 74题
决策树和随机森林
Scrapy + Selenium implements simulated login and obtains dynamic page loading data
Mysql OCP 72题
Mysql OCP 75题
013-Binary tree
Redis和Mysql数据同步的两种方案
面试突击71:GET 和 POST 有什么区别?
Flink Yarn Per Job - 提交应用












