anfeny c2d20cc1da Add hybrid chart-compare tool for activity states преди 3 месеца
..
logs 4df17eeeec Delete useless logs преди 3 месеца
src c2d20cc1da Add hybrid chart-compare tool for activity states преди 3 месеца
.env.example 636bbb1578 Add configuration based on .env files преди 3 месеца
README.md 636bbb1578 Add configuration based on .env files преди 3 месеца
config.py 636bbb1578 Add configuration based on .env files преди 3 месеца
requirements.txt 636bbb1578 Add configuration based on .env files преди 3 месеца
run.py 892d271027 Initial commit with previous projects преди 3 месеца

README.md

Fischertechnik-control-center (Dashboard)

A small Python web-based control (dashboard) center for the Fischertechnik Lernfabrik 9V.

Requirements:

  • Python 3.10+
  • Required packages listed in requirements.txt

Getting Started

Configuration

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

Running

You can run the flask server which runs the main program using the included script run.sh.

Configuration

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

Testing

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.

Install mosquitto

sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients

Start mosquitto

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.

Stop mosquitto

sudo systemctl stop mosquitto