请在下面查看默认目录结构。
/etc/thingsboard-gateway/config - Configuration folder.
tb_gateway.yaml - Main configuration file for Gateway.
logs.conf - Configuration file for logging.
modbus.json - Modbus connector configuration.
mqtt.json - MQTT connector configuration.
ble.json - BLE connector configuration.
opcua.json - OPC-UA connector configuration.
request.json - Request connector configuration.
can.json - CAN connector configuration.
...
/var/lib/thingsboard_gateway/extensions - Folder for custom connectors/converters.
modbus - Folder for Modbus custom connectors/converters.
mqtt - Folder for MQTT custom connectors/converters.
__init__.py - Default python package file, needed for correct imports.
custom_uplink_mqtt_converter.py - Custom Mqtt converter example.
...
opcua - Folder for OPC-UA custom connectors/converters.
ble - Folder for BLE custom connectors/converters.
request - Folder for Request custom connectors/converters.
can - Folder for CAN custom connectors/converters.
/var/log/thingsboard-gateway - Logs folder
connector.log - Connector logs.
service.log - Main gateway service logs.
storage.log - Storage logs.
tb_connection.log - Logs for connection to the ThingsBoard instance.
用于连接到ThingsBoard平台实例和启用/禁用连接器的主要配置文件。
该配置指向ThingsBoard实例demo.thingsboard.io并使用
内存文件存储配置为最多存储100,000条记录。有4个不同的活动连接器。
如果您只想使用其中之一-只需移除所有其他连接器即可。
thingsboard:
host: demo.thingsboard.io
port: 1883
security:
accessToken: PUT_YOUR_ACCESS_TOKEN_HERE
storage:
type: memory
read_records_count: 100
max_records_count: 100000
connectors:
-
name: MQTT Broker Connector
type: mqtt
configuration: mqtt.json
-
name: Modbus Connector
type: modbus
configuration: modbus.json
-
name: Modbus Connector
type: modbus
configuration: modbus_serial.json
-
name: OPC-UA Connector
type: opcua
configuration: opcua.json
-
name: BLE Connector
type: ble
configuration: ble.json
-
name: CAN Connector
type: can
configuration: can.json
-
name: Custom Serial Connector
type: serial
configuration: custom_serial.json
class: CustomSerialConnector
参数 | 默认值 | 描述 |
---|---|---|
thingsboard | Configuration for connection to server. | |
host | 127.0.0.1 | Hostname or ip address of ThingsBoard server. |
port | 1883 | Port of mqtt service on ThingsBoard server. |
支持3种安全类型:
accessToken是一种安全配置要获得它,您应该登录ThingsBoard平台并转到DEVICE标签,按加号图标填写值并选中”Is gateway”选项打开此设备,然后按“COPY ACCESS TOKEN”按钮,然后将默认值替换为您的值。
配置文件中的“安全性”节点如下所示:
|
下表描述了在ThingsBoard平台上配置网关授权的相关参数。
配置文件中的安全节点如下所示:
|
下表描述了在ThingsBoard平台上配置网关授权的相关参数。
配置文件中的安全节点如下所示:
|
storage节点的配置提供了用于在将传入数据发送到ThingsBoard平台之前保存传入数据的配置。
支持两种保存方式:
* – 如果已计算存储空间(如该参数所述)时接收数据,则新数据将丢失。 配置文件的存储部分将如下所示:
|
* – 如果已计算存储空间(如该参数所述)时接收数据,则新数据将丢失。 配置文件的“存储”部分将如下所示:
|
连接器部分配置中的配置,用于通过已实现的协议连接到设备。
本节中每个连接器的配置必须具有下表中的参数:
参数 | 默认值 | 描述 |
---|---|---|
name | MQTT Broker Connector | Name of connector to broker. |
type | mqtt | Type of connector, must be like a name of folder, contained configuration file. |
configuration | mqtt.json | Name of the file with configuration in config folder.* |
* – 带有此配置文件的文件夹。
配置文件中的节连接器可能与下面显示的有所不同,但是它们应具有以下结构:
connectors:
-
name: MQTT Broker Connector
type: mqtt
configuration: mqtt.json
-
name: Modbus Connector
type: modbus
configuration: modbus.json
-
name: Modbus Connector
type: modbus
configuration: modbus_serial.json
-
name: OPC-UA Connector
type: opcua
configuration: opcua.json
-
name: BLE Connector
type: ble
configuration: ble.json
-
name: CAN Connector
type: can
configuration: can.json
-
name: Custom Serial Connector
type: serial
configuration: custom_serial.json
class: CustomSerialConnector
注意:您可以同时使用多个相同的连接器,但应为其提供不同的名称和配置文件。
如果您需要其他类型的连接器,则可以使用自定义指南或通过电子邮件给我们:info@thingsboard.io。