mirror of
https://github.com/thingsboard/thingsboard-gateway
synced 2025-10-26 22:31:42 +08:00
For release 2.7
This commit is contained in:
65
for_build/etc/thingsboard-gateway/config/ftp.json
Normal file
65
for_build/etc/thingsboard-gateway/config/ftp.json
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"host": "0.0.0.0",
|
||||
"port": 21,
|
||||
"TLSSupport": false,
|
||||
"security": {
|
||||
"type": "basic",
|
||||
"username": "admin",
|
||||
"password": "admin"
|
||||
},
|
||||
"paths": [
|
||||
{
|
||||
"devicePatternName": "asd",
|
||||
"devicePatternType": "Device",
|
||||
"delimiter": ",",
|
||||
"path": "fol/*_hello*.txt",
|
||||
"readMode": "FULL",
|
||||
"maxFileSize": 5,
|
||||
"pollPeriod": 500,
|
||||
"txtFileDataView": "SLICED",
|
||||
"withSortingFiles": true,
|
||||
"attributes": [
|
||||
{
|
||||
"key": "temp",
|
||||
"value": "[1:]"
|
||||
},
|
||||
{
|
||||
"key": "tmp",
|
||||
"value": "[0:1]"
|
||||
}
|
||||
],
|
||||
"timeseries": [
|
||||
{
|
||||
"type": "int",
|
||||
"key": "[0:1]",
|
||||
"value": "[0:1]"
|
||||
},
|
||||
{
|
||||
"type": "int",
|
||||
"key": "temp",
|
||||
"value": "[1:]"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"attributeUpdates": [
|
||||
{
|
||||
"path": "fol/hello.json",
|
||||
"deviceNameFilter": ".*",
|
||||
"writingMode": "WRITE",
|
||||
"valueExpression": "{'${attributeKey}':'${attributeValue}'}"
|
||||
}
|
||||
],
|
||||
"serverSideRpc": [
|
||||
{
|
||||
"deviceNameFilter": ".*",
|
||||
"methodFilter": "read",
|
||||
"valueExpression": "${params}"
|
||||
},
|
||||
{
|
||||
"deviceNameFilter": ".*",
|
||||
"methodFilter": "write",
|
||||
"valueExpression": "${params}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -13,6 +13,9 @@
|
||||
"attributesPollPeriod": 5000,
|
||||
"timeseriesPollPeriod": 5000,
|
||||
"sendDataOnlyOnChange": true,
|
||||
"connectAttemptTimeMs": 5000,
|
||||
"connectAttemptCount": 5,
|
||||
"waitAfterFailedAttemptsMs": 300000,
|
||||
"attributes": [
|
||||
{
|
||||
"tag": "string_read",
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
thingsboard:
|
||||
host: demo.thingsboard.io
|
||||
host: thingsboard.cloud
|
||||
port: 1883
|
||||
remoteShell: false
|
||||
remoteConfiguration: false
|
||||
statsSendPeriodInSeconds: 3600
|
||||
checkConnectorsConfigurationInSeconds: 60
|
||||
security:
|
||||
accessToken: PUT_YOUR_GW_ACCESS_TOKEN_HERE
|
||||
qos: 1
|
||||
@@ -16,8 +18,7 @@ storage:
|
||||
# max_read_records_count: 10
|
||||
# max_records_per_file: 10000
|
||||
connectors:
|
||||
-
|
||||
name: MQTT Broker Connector
|
||||
- name: MQTT Broker Connector
|
||||
type: mqtt
|
||||
configuration: mqtt.json
|
||||
|
||||
@@ -70,9 +71,13 @@ connectors:
|
||||
# name: SNMP Connector
|
||||
# type: snmp
|
||||
# configuration: snmp.json
|
||||
# -
|
||||
# name: FTP Connector
|
||||
# type: ftp
|
||||
# configuration: ftp.json
|
||||
#
|
||||
# -
|
||||
# name: Custom Serial Connector
|
||||
# type: serial
|
||||
# configuration: custom_serial.json
|
||||
# class: CustomSerialConnector
|
||||
# class: CustomSerialConnector
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import struct
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Copyright 2021. ThingsBoard
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -22,6 +22,7 @@ from string import ascii_lowercase
|
||||
import serial
|
||||
|
||||
from thingsboard_gateway.connectors.connector import Connector, log # Import base class for connector and logger
|
||||
from thingsboard_gateway.tb_utility.tb_loader import TBModuleLoader
|
||||
from thingsboard_gateway.tb_utility.tb_utility import TBUtility
|
||||
|
||||
|
||||
@@ -94,7 +95,7 @@ class CustomSerialConnector(Thread, Connector): # Define a connector class, i
|
||||
if devices_config is not None:
|
||||
for device_config in devices_config:
|
||||
if device_config.get('converter') is not None:
|
||||
converter = TBUtility.check_and_import(connector_type, device_config['converter'])
|
||||
converter = TBModuleLoader.import_module(connector_type, device_config['converter'])
|
||||
self.__devices[device_config['name']] = {'converter': converter(device_config),
|
||||
'device_config': device_config}
|
||||
else:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
# Copyright 2020. ThingsBoard
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# Copyright 2021. ThingsBoard
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
Reference in New Issue
Block a user