|
|
6 hónapja | |
|---|---|---|
| .. | ||
| logs | 8 hónapja | |
| src | 6 hónapja | |
| .env.example | 8 hónapja | |
| README.md | 8 hónapja | |
| config.py | 8 hónapja | |
| requirements.txt | 8 hónapja | |
| run.py | 8 hónapja | |
A small Python web-based control (dashboard) center for the Fischertechnik Lernfabrik 9V.
requirements.txtTo 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
logsdirectory and create a.jsonlfile 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