Skip to main content

Duplicate data received over MQTT to InfluxDB

Project description

dooblr logo

dooblr - The Data Doubler

Build Status

Utility for duplicating data received over MQTT to InfluxDB.

Installation

In the very near future, dooblr will be able to be installed via pypi/pip. Until then, or if you want the latest, bleeding-edge version, you can install it by cloning or downloading the repo and running pip install inside the root directory:

pip install ./

You should then be able to run dooblr:

dooblr

Docker

dooblr has also been conveniently Dockerized!

You will want to mount or copy your configs into the container at the `/root/.dooblr` directory. An example of how Makers Local 256 uses dooblr can be found in the [makerslocal/dooblr-prod](https://github.com/makerslocal/dooblr-prod) repo.

Example:

docker run -v $(pwd)/config:/root/.dooblr makerslocal/dooblr:latest

Configuration

dooblr is configured using YAML files, and these files are stored in the user’s home directory. On Linux-based systems they’ll need to be in a directory like:

/home/<username>/.dooblr/

On Windows they’re loaded from somewhere like:

C:\Users\<username>\.dooblr\

After the first run of dooblr, this directory will be created, and some default configuration files will be there. dooblr requires a main dooblr.yml that defines MQTT and InfluxDB connections, and one or more measurement configs.

A default-settings dooblr.yml config file will look like:

# dooblr.yaml
global:
    config-dir: /home/<username>/.dooblr/measurements  # Directory that contains dooblr's measurement configs

mqtt:
    host: localhost  # Host, domain name, or IP address of the MQTT broker
    port: 1883       # Port number of the MQTT broker

influxdb:
    host: localhost   # Host, domain name, or IP address of the InfluxDB instance
    port: 8086        # Port number of the InfluxDB instance
    username: root    # Username for the InfluxDB instance
    password: root    # Password for the InfluxDB instance
    database: dooblr  # Database to use in InfluxDB (will be created if it doesn't exist already)

By default, dooblr looks for *.yml measurement configs in the .dooblr/measurements/ directory. Measurement configs are used to tell dooblr which topics and pieces of data need to be pulled from MQTT and pushed to InfluxDB. dooblr expects the MQTT message to contain simple JSON data in its payload.

Let’s say you have a device that publishes to the home/kitchen/fridge/temperature and home/kitchen/freezer/temperature topics with the data:

{"temperature": 40.1, "units":"F", "humidity": 0.12, "label": "blue"}

You would probably want to create a measurement config called temperature.yml that looks like:

# temperature.yml
temperature:
    topics:
    - home/kitchen/fridge/temperature
    - home/kitchen/freezer/temperature
    - home/kitchen/+/temperature  # Standard MQTT wildcards also apply here
    fields:
    - temperature
    - humidity
    tags:
    - units
    optional_tags:
    - label  # Maybe not every message on these topics have a "label" property!

Notice that there can be multiple topics, fields, and tags. Tags and fields refer to the tags and fields used in InfluxDB. Optional tags will not raise an error if they weren’t defined in the MQTT message, while regular tags will.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dooblr-2.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

dooblr-2.1.0-py2-none-any.whl (10.4 kB view details)

Uploaded Python 2

File details

Details for the file dooblr-2.1.0.tar.gz.

File metadata

  • Download URL: dooblr-2.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dooblr-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f51ae6bb99a7872d83c6e0b73dbc21d25e9a27acfc0d1de4ca0ecf5c020e140d
MD5 b4886f669b30e56ed37e99c3c17a3651
BLAKE2b-256 6444c77513aa0f3fdc2b5caddad18f9e334d43cdf1b73311421157b3e0f6cf22

See more details on using hashes here.

File details

Details for the file dooblr-2.1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for dooblr-2.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 cb30a2262cd167ace6ba205eaea6b5650a6f9b39e16b3ddfc9a55e2fca5c8a20
MD5 a7b4b9985d750eeed5bcc7ef736aa3f4
BLAKE2b-256 d3d94810ffce0627c7d23c77ae289c8df3450a57f662a560600742573bc4d5e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page