Giter VIP home page Giter VIP logo

mqtt-extractor's Introduction

mqtt-extractor

Pushing data points and time series to CDF from a MQTT service.

See the config directory for sample configuration.

Development

Install poetry:

python -m pip install --upgrade pip && pip install poetry

Install dependencies:

poetry install

Run unit tests (use -s to show print() debug output):

poetry run pytest -s

Run a local MQTT service:

docker run --name mqtt --rm -d -p 1883:1883 eclipse-mosquitto:1.6

Run the simulation publishing messages to the local MQTT service:

poetry run publish_cdf

Configure and run the extractor using the default CDF payload handler:

poetry run main config/config.yaml

The module tests.custom can be used to handle a custom payload format with the following config:

subscriptions:
    - topic: cdf
        qos: 1
        handler:
            module: mqtt_extractor.cdf
    - topic: custom
        handler:
            module: tests.custom

poetry run publish_custom
poetry run main config/config.yaml

Docker

Build docker image locally:

docker build . -t mqtt-extractor

Test the docker image locally:

docker run --rm --name mqtt-extractor -v $PWD/config:/cognite/config mqtt-extractor

Run docker container from local build mounting the local config file:

docker run -d --restart unless-stopped --name mqtt-extractor --log-driver json-file --log-opt max-size=10m -v $HOME/config:/cognite/config mqtt-extractor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.