Digital twin of the Fischertechnik Training Factory 9V with real-time dashboard and DEVS-based simulator

anfeny 4fbce04f88 Change repo url hace 3 meses
.github 23f681895b Update CI: tests were running entire standard library hace 3 meses
dashboard 4df17eeeec Delete useless logs hace 3 meses
simulator e75bb3ffe8 Add origin attribute to mqtt messages hace 3 meses
.gitignore ad5395c31c Initial commit with license and attribution hace 3 meses
LICENSE ad5395c31c Initial commit with license and attribution hace 3 meses
NOTICE.txt ad5395c31c Initial commit with license and attribution hace 3 meses
README.md 4fbce04f88 Change repo url hace 3 meses
run_dashboard.sh 892d271027 Initial commit with previous projects hace 3 meses
run_sim.sh 892d271027 Initial commit with previous projects hace 3 meses

README.md

fischertechnik-factory-twin

Python License MQTT

This project provides a digital twin of the Fischertechnik Training Factory 9V, consisting of two interconnected components:

  1. Simulator (simulator/)
    A DEVS-based simulation engine that models the behavior of the factory and publishes MQTT messages. It can operate standalone or in hybrid mode alongside real factory data.

  2. Dashboard (dashboard/)
    A Flask-based web application that serves as a real-time control center. It visualizes data from the real factory, the simulator, or both. It includes WebSocket integration, an MQTT bridge, and dynamic dashboard modes (monitor, simulation, hybrid).

Each sub-project has its own Python virtual environment and set of dependencies.


Requirements

  • Python 3.10 (required)
  • Mosquitto MQTT broker running on localhost:1883

⚠️ This project was developed and tested using Python 3.10.
It may not work correctly on older versions due to features like ordered dictionaries and recent library versions.


Getting Started

1. Clone the Repository

git clone https://msdl.uantwerpen.be/git/anthony/fischertechnik-factory-twin.git
cd fischertechnik-factory-twin

2. Start the MQTT Broker (Mosquitto)

Make sure a Mosquitto MQTT broker is running on your machine. The simulator expects it to be available at localhost (127.0.0.1) on the default port (1883).

If you have Mosquitto installed locally, you can start it using:

# On most Linux systems:
sudo systemctl start mosquitto

# Or manually:
mosquitto

You can verify it's running by checking localhost:1883 or using an MQTT client like MQTT Explorer.

3: Run the dashboard

./run_dashboard.sh

This will:

  • Create a virtual environment in dashboard/venv/ if it doesn't exist

  • Install Flask and other required packages

  • Start the dashboard web server (accessible locally in your browser on https://localhost:5000)

4. Run the simulator

./run_sim.sh

This will:

  • Create a virtual environment in simulator/venv/ if it doesn't exist

  • Install dependencies from requirements.txt

  • Launch the DEVS simulator in realtime-mode

Project Structure

fischertechnik-factory-twin/
├── simulator/        # DEVS simulation engine
├── dashboard/        # Flask web dashboard
├── run_sim.sh        # Root-level launcher for the simulator
├── run_dashboard.sh  # Root-level launcher for the dashboard
├── LICENSE
├── NOTICE.txt
└── README.md

License

This project is licensed under the Apache License 2.0.

It includes third-party resources licensed under:

See NOTICE.txt for attribution.