工业物联网网关开源(开源物联网平台ThingsBoard之gateway网关配置空调控制实例)
近期,笔者发布了有关我们改造开源物联网平台Thingsborad的几篇文章,总体来讲CE版本还是很棒的,提供了物联网平台该有的基础能力。Thingsboard CE版本提供了Gateway网关能力,实现了物联平台和设备之间互联的功能。还是和往常一样,我们在研究的过程中,通过“物联网平台Thingsboard之Gateway使用实例”,尝试“接入bacnet/ip协议数据实现空调控制”,以此达到我们所改造平台和设备的协调一致。下面就将这个小小的使用示例或实例,分享给大家,感兴趣的朋友可以搭建平台并运行体验,或者私信联系我们体验。
1、基本介绍Thingsboard gateway 目前只能接入bacnet/ip 协议的数据,非ip协议的bacnet的模块还不能直接接入;因此,在测试bacnet网关功能要主要购买带有bacnet/ip网关的产品;
2、硬件产品采购的产品为海思Igate400网关和两个温控器,温控器与网关的通讯是走标准modbus RTU。
3、ip网关配置ip网关配置好网络后,可以得到ip地址和port端口; 例如:ip=192.168.254.88 port=47808
4、打开海思Igate400网关的扫描工具!5、thingsboard gateway的bacnet配置
{
"devices": [
{
"address": "192.168.254.88:47808",
"attributeUpdates": [
{
"key": "brightness",
"objectId": "analogOutput:1",
"propertyId": "presentValue",
"requestType": "writeProperty"
}
],
"attributes": [
{
"key": "temperature",
"objectId": "analogOutput:1",
"propertyId": "presentValue",
"type": "string"
}
],
"deviceName": "BACnet Device ${objectName}",
"deviceType": "default",
"pollPeriod": 10000,
"serverSideRpc": [
{
"method": "set_state",
"objectId": "binaryOutput:1",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "writeProperty"
},
{
"method": "get_state",
"objectId": "binaryOutput:1",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "readProperty"
},
{
"method": "set_ok",
"objectId": "analogOutput:1",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "writeProperty"
},
{
"method": "get_ok",
"objectId": "analogOutput:1",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "readProperty"
},
{
"method": "set_fan",
"objectId": "analogOutput:3",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "writeProperty"
},
{
"method": "get_fan",
"objectId": "analogOutput:3",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "readProperty"
},
{
"method": "set_backlight",
"objectId": "analogOutput:25",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "writeProperty"
},
{
"method": "get_backlight",
"objectId": "analogOutput:25",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "readProperty"
},
{
"method": "set_state1",
"objectId": "binaryOutput:3",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "writeProperty"
},
{
"method": "get_state1",
"objectId": "binaryOutput:3",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "readProperty"
},
{
"method": "set_ok1",
"objectId": "analogOutput:96",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "writeProperty"
},
{
"method": "get_ok1",
"objectId": "analogOutput:96",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "readProperty"
},
{
"method": "set_fan1",
"objectId": "analogOutput:98",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "writeProperty"
},
{
"method": "get_fan1",
"objectId": "analogOutput:98",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "readProperty"
},
{
"method": "set_backlight1",
"objectId": "analogOutput:120",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "writeProperty"
},
{
"method": "get_backlight1",
"objectId": "analogOutput:120",
"propertyId": "presentValue",
"requestTimeout": 10000,
"requestType": "readProperty"
}
],
"timeseries": [
{
"key": "temperature",
"objectId": "analogOutput:1",
"propertyId": "presentValue"
},
{
"key": "backlight",
"objectId": "analogOutput:25",
"propertyId": "presentValue"
},
{
"key": "backlight1",
"objectId": "analogOutput:120",
"propertyId": "presentValue"
},
{
"key": "temperature1",
"objectId": "analogOutput:96",
"propertyId": "presentValue"
}
]
}
],
"general": {
"address": "192.168.254.201/24",
"maxApduLengthAccepted": 1024,
"objectIdentifier": 599,
"objectName": "TB_gateway",
"segmentationSupported": "segmentedBoth",
"vendorIdentifier": 15
},
"name": "BACnet"
}
7、配置dashboard,增加卡片部件和控制部件
8、测试:通过温度旋钮发送数据到温控器,实现温度调节
(1)调节前
(2)调节后
可以看出,通过温控器按钮调节温度是有了变化的。
时间仓促,也没写多少文字,只是大概写了几个实例的执行思路,通过这些步骤基本实现了对空调温度的控制,当然里面的细节有时还是需要大家认真对待哦。
,免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com