|
3 bulan lalu | |
---|---|---|
.. | ||
logs | 3 bulan lalu | |
src | 3 bulan lalu | |
.env.example | 3 bulan lalu | |
README.md | 3 bulan lalu | |
config.py | 3 bulan lalu | |
requirements.txt | 3 bulan lalu | |
run.py | 3 bulan lalu |
A small Python web-based control (dashboard) center for the Fischertechnik Lernfabrik 9V.
requirements.txt
To configure the MQTT brokers to which the dashboard listens you can edit config.py
in the root directory.
class Config:
MQTT_REAL_HOST = '192.168.0.10' # MQTT broker IP of real system (which you want to monitor)
MQTT_REAL_PORT = 1883
MQTT_SIM_HOST = '127.0.0.1' # MQTT broker IP of simulated system
MQTT_SIM_PORT = 1883
LOGGING = False # Enable logging mqtt messages to a file
If logging is enabled, logs will be written to the
logs
directory and create a.jsonl
file with the start timestamp as a filename
You can run the flask server which runs the main program using the included script run.sh
.
This project uses a .env
file for runtime configuration.
To set it up, copy the example file:
cp .env.example .env
You can edit the broker addresses or logging settings inside.
For a full explanation of the variables, see the see the main project README
To test I recommend you set up a local MQTT broker, then test incoming MQTT messages with that. Below are instructions for installing and running a mosquitto mqtt broker on a linux system.
sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients
sudo systemctl start mosquitto
from here the MQTT broker is running on mqtt://127.0.0.1 on port 1883 (default). You can try this connection out with a tool like MQTT explorer.
sudo systemctl stop mosquitto