Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rroemhild/tts-thingsboard-connector
The Things Stack to ThingsBoard Community Edition connector
https://github.com/rroemhild/tts-thingsboard-connector
lorawan thethingsnetwork thingsboard
Last synced: 2 days ago
JSON representation
The Things Stack to ThingsBoard Community Edition connector
- Host: GitHub
- URL: https://github.com/rroemhild/tts-thingsboard-connector
- Owner: rroemhild
- License: mit
- Created: 2023-01-02T23:13:22.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-02T23:18:47.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T01:19:18.880Z (24 days ago)
- Topics: lorawan, thethingsnetwork, thingsboard
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-thingsboard - The Things Stack to ThingsBoard Community Edition connector
README
# The Things Stack to ThingsBoard Community Edition connector
Publish uplinks from The Things Stack LoRaWAN Network Server to ThingsBoard Community Edition.
The ThingsBoard integration feature, where you can directly connect to TTS and consume uplinks, is only available for the ThingsBoard Professional Edition. For the ThingsBoard Community Edition we need a connector to convert uplinks to ThingsBoard data structure.
This python script connects with MQTT to The Things Stack applications and publishes uplinks to ThingsBoard HTTP API.
## Setup
Clone this repository and install the requieremnts:
```
# Git clone
git clone https://github.com/rroemhild/tts-thingsboard-connector.git# Install python requirements as user or use a python virtualenv
pip install --user -r requirements.txt
```## Configuration
Copy the configuration example file `config-example.yaml` to `config.yaml` and open it with your preferred editor.
```yaml
tb_url: "http://127.0.0.1:8080" # Full URL to the ThingsBoard installation.
tb_secrets_db: "secrets.db" # Name or path to the SQLite DB file to store ThingsBoard device access keys.tts_default_mqtt_broker: "eu1.cloud.thethings.network" # The Things Stack MQTT hostname for all applications.
tts_default_mqtt_port: 8883 # The Things Stack MQTT port. 8883 is for SSL.
tts_reconnect_interval: 5 # Time in seconds to reconnect to The Things Stack MQTT broker after the connection was reset.# List with The Things Stack applications linked to ThingsBoard device profiles.
tts_applications:
# Default TTS MQTT broker address will be used.
- tts_username: "TTS_MQTT_USERNAME" # TTS application name and tanent: my-app@ttn
tts_apikey: "TTS_MQTT_PASSWORD" # TTS application api key for MQTT integration.
tb_provision_device_key: "PROVISION_DEVICE_KEY" # ThingsBoard device profile provision key.
tb_provision_device_secret: "PROVISION_DEVICE_SECRET" # ThingsBoard device profile provision secret.
# Set different mqtt broker address.
- tts_username: "TTS_MQTT_USERNAME"
tts_apikey: "TTS_MQTT_PASSWORD"
tts_mqtt_broker: "eu1.cloud.thethings.industries" # Different MQTT broker for this TTS application, optinal.
tb_provision_device_key: "PROVISION_DEVICE_KEY"
tb_provision_device_secret: "PROVISION_DEVICE_SECRET"
```## Run
Try a quick run by execute the `main.py` script:
```bash
python main.py
```For production, use a process controll system like systemd or supervisor, etc.
### Systemd service file example
```
[Unit]
Description=The Things Stack ThingsBoard Connector
After=multi-user.target[Service]
Type=simple
User=
WorkingDirectory=/home//tts-thingsboard-connector
ExecStart=/usr/bin/python3 /home//tts-thingsboard-connector/main.py
Restart=always
RestartSec=3[Install]
WantedBy=multi-user.target
```