接入案例
当前以设施云自研的Modbus数采插件为例来配置设备点位通过数采方式接入,如果是伙伴自己开发的数采插件,流程也是类似,只是数采模板和对应应用的镜像地址这些容器配置会不同。
安装边缘网关
步骤一:注册网关设备
首先获取设施云链接及账号密码,登录设施云界面,打开【设备管理】 -> 【设备】,单击“注册设备”,各参数配置如下:
设备类型:网关设备;
自定义目录信息:打开;
数据存储根目录:/mnt/external_storage0/IoTEdge/db/;
配置根目录:/mnt/external_storage0/IoTEdge/config/;
日志根目录:/mnt/external_storage0/IoTEdge/log/;
网关名称:据实填写,建议按照安装位置简写;
网关ID:参考网关名称;
所属空间:【空间管理】-【空间管理】中配置的空间,其余按照默认填写,单击“确定”;
其余参数默认即可。
步骤二:获取安装命令
打开【边缘管理】-【边缘设备】,存在网关信息;
在对应网关设备行,单击右侧“安装”;
弹出新页面“选择架构”下拉,根据网关CPU架构类型,选择"x86_64"或"arm64",安装目录根据磁盘使用情况,通常使用默认值"/opt/IoTEdge"即可,部分厂商(如:微能)网关,需使用扩展闪存磁盘目录:/mnt/external_storage0/IoTEdge
3、执行安装指令
步骤一:网关是否与华为云网络互通
在执行安装前,安装xshell/mobxterm软件,通过软件登录到网关后台,在终端命令行验证下网关是否与华为云网络互通。
网关后台命令行输入:ping ioe-installer-cn-north-4.obs.cn-north-4.myhuaweicloud.com,若网络能通,则执行步骤二;
步骤二:网关执行安装命令
切换root权限:命令行输入su,回车,输入root密码,回车;
将第二点中得到的安装命令复制到终端命令行后,回车;
安装过程中可以使用
$ docker ps
查看agent容器运行状态;
查看网关的状态是在线说明网关就安装成功了;
添加数采模板
- 保存以下模板保存到本地,文件名为Modbus-Tcp.json
{ "tpl_id": "iotfm_general_modbustcp_V3", "name": "智能设施云平台自研ModbusTcp数采模板V3", "description": "智能设施云平台自研ModbusTcp数采模板V3", "datasource_meta": { "config_tabs": [ { "key": "connection_info", "name": "连接信息", "description": "连接信息", "type": "object", "quantity": 10, "config_items": [ { "key": "connection_ext_info", "name": "连接扩展信息", "description": "连接扩展信息,协议应用上线后模板增删字段需重建数采连接,新增扩展信息容纳后续新增的字段。", "data_type": "string", "required": false, "crypted": false, "max_length": 65535, "example": "{\"xxx\": \"xxx\"}" } ] }, { "key": "array_info", "name": "连接信息", "description": "连接信息", "type": "array", "quantity": 10, "config_items": [ { "key": "endpoint", "name": "服务端点信息", "description": "服务端点信息,为json字符串数组格式", "data_type": "string", "required": true, "crypted": false, "max_length": 128, "example": "{\"endpoint_id\":\"1\", \"endpoint_url\": \"127.0.0.1:123\"}" } ] } ], "default_values": { "drivername": "ModbusTcp" } }, "point_meta": { "data_type_enums": [ "bool", "short", "ushort", "int", "uint", "long", "ulong", "float", "double" ], "config_items": [ { "key": "endpoint_id", "name": "终端节点ID", "description": "Modbus终端节点ID,来源于数采连接配置,如配置失败,则将被丢弃。", "data_type": "int", "required": true, "crypted": false, "max_length": 256, "example": 1 }, { "key": "slave_id", "name": "从站号", "description": "modbus传感器从站号", "data_type": "int", "required": true, "crypted": false, "max_length": 256, "example": 1 }, { "key": "register_type", "name": "寄存器类型", "description": "寄存器类型", "data_type": "string", "required": true, "crypted": false, "max_length": 256, "enum_value": "Coil_Status|Input_Status|Holding_Registers|Input_Registers", "example": "Coil_Status" }, { "key": "register_address", "name": "起始地址", "description": "寄存器起始地址", "data_type": "string", "required": true, "crypted": false, "max_length": 256, "example": "0x0" }, { "key": "cycle", "name": "采集周期", "description": "点位采集周期", "data_type": "int", "required": true, "crypted": false, "max_length": 65535, "example": 10000 }, { "key": "byte_swap", "name": "寄存器高低位交换", "description": "寄存器高低位交换", "data_type": "bool", "required": false, "crypted": false, "max_length": 256, "default": false, "example": true }, { "key": "register_swap", "name": "寄存器顺序交换", "description": "寄存器顺序交换", "data_type": "bool", "required": false, "crypted": false, "max_length": 256, "default": false, "example": true }, { "key": "point_ext_info", "name": "点位扩展信息", "description": "点位扩展信息,协议应用上线后模板增删字段需全量调整点位,新增扩展信息容纳后续新增的点位字段。", "data_type": "string", "required": false, "crypted": false, "max_length": 65535, "example": "{\"field_a\": \"valueA\", \"field_b\": 123}" }, { "crypted": false, "data_type": "string", "description": "该物理点位枚举值和物模型点位枚举值的映射关系", "example": "物理点位枚举值1:物模型点位枚举值1|物理点位枚举值2:物模型点位枚举值2", "key": "enum_map", "max_length": 256, "name": "枚举值映射表", "required": false } ] } } - 导入上面文件到数采模板


添加数采应用



添加应用版本
须知:该步骤将会为上述业务应用添加一个可用版本
【边缘管理】->【应用管理】->【驱动应用】->【操作--详情】->【添加版本】


- 基本配置,容器镜像地址可以使用:swr.cn-north-4.myhuaweicloud.com/huawei-iot-facility/iotfm-edge-app-plugins-modbus-tcp:2025.0113.1944.37
- 配置镜像地址
- 配置容器规格
- 高级配置

数据存储

本地卷名称
类型
主机目录
容器目录
权限
config
CONFIG
/config
/opt/iot/iotfm-edge-app-plugins-modbus-tcp/config
读写
logs
LOG
/tmp/iotfm-edge-app-plugins-modbus-tcp/logs
/opt/iot/iotfm-edge-app-plugins-modbus-tcp/logs
读写


- 端点无需配置
- 部署配置
网络类型:端口映射

- 确认信息,立即发布
插件部署
部署Modbus应用模块















