Skip to content

Commit

Permalink
Improvements for default configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
imbeacon committed Dec 27, 2019
1 parent d99f665 commit 6dab603
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 149 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ thingsboard_gateway/storage/data/
/.mypy_cache/
/thingsboard_gateway/storage/data_out/
*.gz
/logs/
/python3-thingsboard-gateway.deb
/python3-thingsboard-gateway.rpm
/thingsboard_gateway.egg-info/
/docker/python3-thingsboard-gateway.deb
/data/
68 changes: 33 additions & 35 deletions for_build/etc/thingsboard-gateway/config/mqtt.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,73 @@
{
"broker": {
"name":"Default Broker",
"host":"demo.thingsboard.io",
"name":"Default Local Broker",
"host":"127.0.0.1",
"port":1883,
"security": {
"type": "basic",
"username": "GIjr0vTtbOLwpouuBxL9",
"password": ""
"username": "user",
"password": "password"
}
},
"mapping": [
{
"topicFilter": "v1/devices/me/attributes",
"topicFilter": "/sensor/data",
"converter": {
"type": "json",
"filterExpression": "",
"deviceNameJsonExpression": "${SerialNumber}",
"deviceTypeJsonExpression": "${SensorType}",
"deviceNameJsonExpression": "${serialNumber}",
"deviceTypeJsonExpression": "${sensorType}",
"timeout": 60000,
"attributes": [
{
"type": "string",
"key": "test_key",
"value": "${SerialNumber}"
"key": "model",
"value": "${sensorModel}"
}
],
"timeseries": [
{
"type": "double",
"key": "temperature",
"value": "${temp}"
},
{
"type": "double",
"key": "humidity",
"value": "${hum}"
}
]
}
},
{
"topicFilter": "/temperature-sensors/+",
"topicFilter": "/sensor/+/data",
"converter": {
"type": "json",
"filterExpression": "",
"deviceNameJsonExpression": "${$.serialNumber}",
"deviceTypeJsonExpression": "${$.sensorType}",
"deviceNameTopicExpression": "(?<=sensor\/)(.*?)(?=\/data)",
"deviceTypeTopicExpression": "Thermometer",
"timeout": 60000,
"attributes": [
{
"type": "string",
"key": "model",
"value": "${$.model}"
"value": "${sensorModel}"
}
],
"timeseries": [
{
"type": "double",
"key": "temperature",
"value": "${$.temperature}"
}
]
}
},
{
"topicFilter": "/temperature-sensors/+",
"converter": {
"type": "json",
"filterExpression": "",
"deviceNameJsonExpression": "${$.sensorId}",
"deviceTypeJsonExpression": "${$.sensorType}",
"timeout": 60000,
"timeseries": [
"value": "${temp}"
},
{
"type": "double",
"key": "humidity",
"value": "${$.humidity}"
"value": "${hum}"
}
]
}
},
{
"topicFilter": "/custom-sensors/+",
"topicFilter": "/custom/sensors/+",
"converter": {
"type": "custom",
"extension": "CustomMqttUplinkConverter",
Expand All @@ -83,8 +81,8 @@
],
"connectRequests": [
{
"topicFilter": "sensors/connect",
"deviceNameJsonExpression": "${$.SerialNumber}"
"topicFilter": "sensor/connect",
"deviceNameJsonExpression": "${SerialNumber}"
},
{
"topicFilter": "sensor/+/connect",
Expand All @@ -93,8 +91,8 @@
],
"disconnectRequests": [
{
"topicFilter": "sensors/disconnect",
"deviceNameJsonExpression": "${$.SerialNumber}"
"topicFilter": "sensor/disconnect",
"deviceNameJsonExpression": "${SerialNumber}"
},
{
"topicFilter": "sensor/+/disconnect",
Expand Down
23 changes: 14 additions & 9 deletions for_build/etc/thingsboard-gateway/config/tb_gateway.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
thingsboard:
host: 127.0.0.1
host: demo.thingsboard.io
port: 1883
security:
accessToken: FUH2Fonov6eajSHi0Zyw
accessToken: PUT_YOUR_GW_ACCESS_TOKEN_HERE
storage:
type: memory
read_records_count: 10
max_records_count: 1000
read_records_count: 100
max_records_count: 100000
# type: file
# data_folder_path: ./data/
# max_file_count: 10
# max_read_records_count: 10
# max_records_per_file: 10000
connectors:

-
Expand All @@ -25,15 +30,15 @@ connectors:
# configuration: modbus_serial.json
#
# -
# name: BLE Connector
# type: ble
# configuration: ble.json
#
# -
# name: OPC-UA Connector
# type: opcua
# configuration: opcua.json
#
# -
# name: BLE Connector
# type: ble
# configuration: ble.json

# -
# name: Custom Serial Connector
# type: serial
Expand Down
100 changes: 0 additions & 100 deletions gateway.iml

This file was deleted.

2 changes: 1 addition & 1 deletion make_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if [ "$1" != "only_clean" ] ; then
tar -zcvf extensions.tar.gz extensions/*
mv configs.tar.gz ../../../
mv extensions.tar.gz /home/$CURRENT_USER/rpmbuild/SOURCES/extensions.tar.gz
cd ../
cd ../../../
rm /home/$CURRENT_USER/rpmbuild/SOURCES/configs.tar.gz
cp configs.tar.gz /home/$CURRENT_USER/rpmbuild/SOURCES/
# Bulding RPM Package
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = thingsboard-gateway
version = 2.0.18
version = 2.0
description = Thingsboard Gateway for IoT devices.
long_description = The Thingsboard IoT Gateway is an open-source solution that allows you to integrate devices connected to legacy and third-party systems with Thingsboard.
license = Apache Software License (Apache Software License 2.0)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'simplejson',
'pyrsistent'
],
download_url='https://github.com/thingsboard/thingsboard-gateway/archive/2.0.18rc-python.tar.gz',
download_url='https://github.com/thingsboard/thingsboard-gateway/archive/2.0.tar.gz',
entry_points={
'console_scripts': [
'thingsboard-gateway = thingsboard_gateway.tb_gateway:daemon'
Expand Down
4 changes: 2 additions & 2 deletions thingsboard-gateway.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%define name thingsboard-gateway
%define version 2.0.18
%define unmangled_version 2.0.18
%define version 2.0
%define unmangled_version 2.0
%define release 1

Summary: Thingsboard Gateway for IoT devices.
Expand Down

0 comments on commit 6dab603

Please sign in to comment.