Python3.x based automated script to detect changes in MongoDB for incoming EPC documents, obtain IoT information based on meta-data and send relevant data to a Blockchain API.
- DocumentDB:
MongoDB 4.x - SensorDB:
InfluxDB 1.7.x - Blockchain API: Standard RESTful service to communicate with Blockchain
python3.x
DocumentDB:
- The MongoDB needs to be configured to be a Replica Set. A single instance of MongoDB can become the Primary instance. Reference
- Once the Replica Set is configured the script will use the Change Streams to detect incoming EPC documents. Reference
SensorDB:
-
For system setup refer to the following libraries:
- EPCIS-IoT-Arduino: Programming Sensor Nodes to send
BME280Environmental values to an MQTT broker - EPCIS-IoT-Parser: Parsing Script to provision the insertion of meta-data from EPC documents and IoT Data into SensorDB
- EPCIS-IoT-Arduino: Programming Sensor Nodes to send
Management:
In order to connect to the DocumentDB for combination of EPCIS-IoT Application use the following libraries:
- epcis-iot-backend: GraphQL CRUD Backend to associate EPC data with IoT Data
- ng-epcis-iot: Angular and Apollo Client based Frontend to connect to
epcis-iot-backend
Blockchain & Data Validation:
The solution is part of the NIMBLE-Project
-
Develop using as virtual environment
python -m venv venv -
Activate the Virtual Environment
Windows
/venv/Scripts/activate.ps1Linux
. venv/bin/activate -
Install the dependencies using:
pip install -r requirements.txt -
Adapt the
config.tomlfile with settings for all Databases -
Execute the app using:
python main.py
-
Update the image using:
docker build -t epcis-iot-detection .
-
Create a
config.production.tomlwith your production parameters in it. -
Execute the following in the Terminal where the
config.production.tomlfile exists:docker run --name="epcis-iot-detection" -v $(pwd)/config.production.toml:/app/config.toml:ro \ --net=host --restart=always shantanoodesai/epcis-iot-detection:latest -
Track the log files using:
docker logs -f epcis-iot-detection