Reads MQTT data pushed from IoT device for topics specified inside vault.py
.
vault = {
"user": "mqtt_user",
"password": "mqtt_password",
"host": "localhost",
"port": 1883,
"topics": ["sensor/temp", "sensor/humidity"],
"s_keys": ["temp", "humidity"]
}
Save this as vault.py
inside the app root.
# Start and activate virtualenv
python -m venv env
source env/bin/activate
# Install packages
pip install flask paho-mqtt prometheus_client
# Run
python3 app.py