devfire / iot-middleware

Project to ingest IoT sensor data and route it to multiple destinations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Cloud Build Status

iot-middleware

Overview

The purpose of this project is to accept sensor data from multiple sources and route them to multiple destinations.

At the moment, the only way to get data into the router is via UDP unicast.

For a detailed overview, please see the diagram below.

Architecture

Configuration

The main configuration file is settings.ini.

It contains a list of MAC addresses and their blynk.io virtual pins.

Technically, this file is needed for blynk only but if you are not using blynk, then this doesn't do a whole lot more at the moment. :)

Logging

The software uses the standard pythong logging framework.

Default is DEBUG, to override set the environment variable like this:

export LOGLEVEL=INFO

Running

There are two ways to run this software, as a python script or as a docker container.

Python script

The project uses pipenv to manage dependencies.

If you would like to run this as a python script, first initialize pipenv

pipenv shell

and then run it as usual

python3 processor.py

just make sure you set the environment variables first.

Docker container

If you would like to run this as a docker container (preferred way), execute the following

docker run --env-file=env.list -p 3333:3333/udp devfire/iot-middleware:latest

Note the env.list passed as an --env-file parameter. It contains the environment variables required to run the container, like so

BLYNK_AUTH=asdflkj23049
BLYNK_URL=http://blynk-cloud.com

The UDP port is exposed with -p 3333:3333/udp.

About

Project to ingest IoT sensor data and route it to multiple destinations


Languages

Language:Python 97.3%Language:Dockerfile 1.8%Language:Shell 1.0%