Skip to content
A service which subscribes to TTN MQTT streams and forwards data to a database or API. Currently used to power our luftdaten.info LoRa project.
Branch: master
Clone or download
Matthias Schneider
Matthias Schneider fixed typo
Latest commit bcdbc24 Jul 12, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
certs added certs for upcoming tls support Jul 10, 2017
schema
tasks always cast to float of numeric. only keep strings Jul 7, 2017
.gitignore
README.md better readme Jul 12, 2017
agpl-3.0.txt
config.py added influxdb credentials to config Jun 8, 2017
database.py
logger.py switched to local time Jan 26, 2017
muecke-ctl.py
requirements.txt better readme Jul 12, 2017
server.py some small fixes and changes Jul 3, 2017
subscriber.py

README.md

Muecke

A server that subscribes to many MQTT streams (or applications) on the TTN network and saves the (sensor) data into a MySQL or InfluxDB database. If enabled, it can redirect the sensor data to another HTTP API, example included.

Supports hot reloading. When an app was added or removed from the database, the service will subscribe to or unsubscribe from this MQTT stream.

Main dependencies

  • paho-mqtt
  • PyMySQL
  • influxdb
  • requests

It's only tested with Python 3. Could work on Python 2, but I don't know :)

Install

  • Install MySQL/MariaDB and/or InfluxDB, according to the docs of these services.
  • For MySQL: Run the 'CREATE TABLE' commands in schema/database.sql
  • For InfluxDB: Just install and create a database. Credentials and database name can be set in config.py.
  • Edit the config and insert your database credentials

Usage

Create a virtual environment, enter it and install all dependencies:

virtualenv <custom-path-to-virtual-env>
source <custom-path-to-virtual-env>/bin/activate

Install all dependencies:

pip install -r requirements.txt

Run the server:

python3 server.py

...or create a systemd service for a more stable service.

License

AGPL 3.0

See agpl-3.0.txt.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.