当前位置:网站首页>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

边栏推荐
猜你喜欢

MySql数据库索引优化

Rabbit and Falcon are all covered, Go lang1.18 introductory and refined tutorial, from Bai Ding to Hongru, the whole platform (Sublime 4) Go lang development environment to build EP00

go版本升级

深度学习之 10 卷积神经网络2

MySQL——几种常见的嵌套查询

索引(三)

Redis和Mysql数据同步的两种方案

cmd(命令行)操作或连接mysql数据库,以及创建数据库与表

二叉查找树的综合应用

播放量暴涨2000w+,单日狂揽24w粉,内卷的搞笑赛道还有机会
随机推荐
For heavy two-dimensional arrays in PHP
milvus
Let‘s Encrypt 使用
简述设计的意义是什么_定义和概念的最大区别
redis实现分布式锁的原理
CRT command keys
Mysql 主从复制 作用和原理
2022最新整理软件测试常见面试题附答案
C language two-dimensional array is called with one-dimensional array
2022.8.2-----leetcode.622
Recursive training
mysql的union和union all
Redis和MySQL如何保持数据一致性
面试突击71:GET 和 POST 有什么区别?
Redis的基础与django使用redis
索引(三)
Scrapy + Selenium implements simulated login and obtains dynamic page loading data
Flink Yarn Per Job - 创建启动Dispatcher RM JobManager
Automated test browser driver download version
ClickHouse 数据插入、更新与删除操作 SQL


