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.
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. :)
The software uses the standard pythong logging framework.
Default is DEBUG, to override set the environment variable like this:
export LOGLEVEL=INFO
There are two ways to run this software, as a python script or as a docker container.
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.
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
.