smartboot 开源组织 smartboot 开源组织
首页
  • smart-socket
  • smart-http
  • smart-servlet
  • smart-mqtt
  • smart-license
  • feat
❤️开源捐赠
💰付费服务
🏠加入社区
  • Gitee (opens new window)
  • Github (opens new window)
首页
  • smart-socket
  • smart-http
  • smart-servlet
  • smart-mqtt
  • smart-license
  • feat
❤️开源捐赠
💰付费服务
🏠加入社区
  • Gitee (opens new window)
  • Github (opens new window)
  • 产品手册
    • 1. 简介
    • 配置说明
      • 物模型配置
      • 设备点表配置
      • 设备列表配置
      • 连接配置
    • 通讯插件
      • Modbus
      • modbus连接配置
      • 扩展点表配置
      • Bacnet
      • bacnet连接配置
      • 扩展点表配置
    • Export
    • 驱动库
目录

产品手册

# 1. 简介

# 配置说明

config.json 是 driver-box 用于实现设备接入的描述文件。通常情况下用户只需完成该文件的编写,便可实现设备接入。

该文件的主体结构如下所示:

{
  "deviceModels": [
    {
      "name": "circuit_breaker-2",
      "modelId": "65a641ce06a7d4709b5b31b9",
      "description": "",
      "devicePoints": [
      
      ],
      "devices": [
      
      ]
    }
    ],
  "connections": {
    
  },
  "protocolName": "modbus"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
参数名 类型 必填 说明
deviceModels array 必填 物模型配置。用于定义特定通讯协议类型protocolName的物模型及其接入设备列表
connections object 必填 连接配置,不同类型的插件配置各不相同
protocolName string 必填 协议插件名称,有效范围:
  • modbus
  • bacnet
  • mqtt

# 物模型配置

参数名 类型 必填 说明
name string 必填 设备模型名称,又可称为物模型名称
modelId string 必填 物模型 ID
description string 可选 设备模型描述
devicePoints array 必填 设备点表配置
devices array 必填 设备列表

# 设备点表配置

参数名 类型 必填 说明
name string 必填 点位名
description string 可选 点位描述
valueType string 必填 点位值类型,有效范围:int、float
readWrite string 必填 点位读写类型,有效范围:
  • R : 只读
  • W : 只写
  • RW : 读写
unit string 可选 点位单位,例如:℃、m、s、m³
reportMode string 必填 点位上报模式,有效范围:
  • realTime: 实时上报
  • change: 变化上报
scale float 可选 点位值系数换算。
读操作时,会将从设备读取到的值乘以 scale 得到最终值。例如:scale=0.1,则从设备读取到的值为10,则最终值为1。
写操作时,将设定值除以 scale 得到设备可写入的值。例如:scale=0.1,设置点位写入值为1,则最终值为10。
decimals float 可选 保留小数位数,仅针对valueType=float的点位有效。例如:decimals=2,则最终值为1.00。
当decimals=0时,表示不保留小数。
当decimals=1时,表示保留一位小数。
当decimals=2时,表示保留两位小数。
当decimals=3时,表示保留三位小数。
当decimals=4时,
- - 可选 插件扩展点表配置。不同类型的插件会在上述配置的基础上额外添加新的配置项。例如:Modbus插件在配置中添加了slaveId、timeout等配置项。
  • modbus
  • bacnet

# 设备列表配置

参数名 类型 必填 说明
sn string 必填 设备序列号
description string 选填 设备描述
ttl string 选填 设备离线阈值,超过该时长没有收到数据视为离线。
示例:
  • 1m: 1分钟
  • 1h: 1小时
  • 1d: 1天
默认:24h
connectionKey string 必填 设备连接标识
properties object 选填 设备属性。通常用于配置设备的保留属性或连接相关信息。

保留属性
保留属性是 driver-box 为设备提供的扩展信息配置能力。这类属性的业务逻辑交由用户实现,driver-box 只作配置的持久化。

目前开放的保留属性如下:

  • _area:设备所处的区域信息
  • _parent_sn:父级设备 SN
  • _system_id:设备所属的系统 ID

# 连接配置

# 通讯插件

# Modbus

# modbus连接配置

配置项 必填 类型 参数说明
address 必填 string 连接地址:例如:127.0.0.1:502 、/dev/ttyUSB0
mode 必填 string 通讯方式,支持类型:rtu、rtuovertcp、rtuoverudp、tcp、tcp+tls、udp
baudRate 选填 int 波特率,仅当 mode 为rtu时需要设置,默认:19200
dataBits 选填 int 数据位 ,仅当 mode 为rtu时需要设置,默认:8
stopBits 选填 int 停止位 ,仅当 mode 为rtu时需要设置。有效范围:0、1、2`
parity 选填 int 奇偶性校验 ,仅当 mode 为rtu时需要设置 。有效范围:0:None ,1:EVEN ,2:ODD
duration 选填 string 当前连接采集任务的执行周期,默认:1s。例如:1s、1m、1h、1d
maxLen 选填 int 最长连续读个数。相邻点位间隔若低于maxLen,将会一次性读出,默认:32
retry 选填 int 执行写操作出现失败时的重试次数,默认:3

# 扩展点表配置

# Bacnet

# bacnet连接配置

配置项 必填 类型 参数说明
address 必填 string 连接地址:例如:127.0.0.1:502 、/dev/ttyUSB0

# 扩展点表配置

# Export

# 驱动库

Theme by Vdoing | Copyright © 2017-2025 三刀
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式