什么是 ThingsBoard 网关?
ThingsBoard 网关是一种中间件组件,用于将本地设备(如 Modbus、OPC-UA、MQTT 客户端等)的数据转发至 ThingsBoard IoT 平台。 它支持多种协议,并可在边缘侧进行数据预处理,适用于无法直接连接云平台的设备。
主要功能
- 支持 Modbus、OPC-UA、BLE、CAN、REST 等协议
- 设备自动注册与属性同步
- 数据过滤与转换
- 离线缓存与断点续传
- 基于 YAML 的配置文件
快速开始
安装 ThingsBoard Gateway(以 Python 版本为例):
pip install thingsboard-gateway
配置 tb_gateway.yaml 文件:
thingsboard:
host: your-thingsboard-host.com
port: 1883
security:
accessToken: YOUR_ACCESS_TOKEN
storage:
type: memory
read_records_count: 100
max_records_count: 100000
connectors:
- name: Modbus Connector
type: modbus
configuration: modbus.json