|
@@ -126,7 +126,52 @@ LOGGING=0
|
|
|
|
|
|
|
|
> **Reminder**: The .env file is duplicated across both dashboard/ and simulator/ — keep them in >sync if you make changes.
|
|
> **Reminder**: The .env file is duplicated across both dashboard/ and simulator/ — keep them in >sync if you make changes.
|
|
|
|
|
|
|
|
|
|
+## Testing Without the Real Factory
|
|
|
|
|
|
|
|
|
|
+If the physical Fischertechnik factory is offline, you can still run a full end-to-end demo by spinning up a **second Mosquitto broker** that pretends to be the “real” system.
|
|
|
|
|
+
|
|
|
|
|
+### 1 Start an additional broker on port 1884
|
|
|
|
|
+
|
|
|
|
|
+```bash
|
|
|
|
|
+# Start a second Mosquitto instance (on Linux/macOS)
|
|
|
|
|
+mosquitto -p 1884 -v &
|
|
|
|
|
+```
|
|
|
|
|
+Or use a separate terminal window. This lets you simulate real factory messages independently from the simulation broker (which runs on 1883).
|
|
|
|
|
+
|
|
|
|
|
+### 2 Configure both brokers via `.env`
|
|
|
|
|
+
|
|
|
|
|
+Edit the `.env` file in **both** `dashboard/` and `simulator/`:
|
|
|
|
|
+
|
|
|
|
|
+```ini
|
|
|
|
|
+# Simulated MQTT broker (used for internal DEVS comms + dashboard visualizations)
|
|
|
|
|
+MQTT_SIM_HOST=127.0.0.1
|
|
|
|
|
+MQTT_SIM_PORT=1883
|
|
|
|
|
+
|
|
|
|
|
+# Real factory MQTT broker (used to inject real-world-like events)
|
|
|
|
|
+MQTT_REAL_HOST=127.0.0.1
|
|
|
|
|
+MQTT_REAL_PORT=1884
|
|
|
|
|
+
|
|
|
|
|
+# Optional logging toggle
|
|
|
|
|
+LOGGING=0
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+### 3 Run the components as usual
|
|
|
|
|
+
|
|
|
|
|
+```bash
|
|
|
|
|
+./run_sim.sh # Connects to both brokers (1883 + 1884)
|
|
|
|
|
+./run_dashboard.sh # Connects to both brokers (1883 + 1884)
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+This setup gives you:
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+| Port | Role | Used by |
|
|
|
|
|
+| -------- | -------------------------- | ----------------------------------------------------------------------------- |
|
|
|
|
|
+| **1883** | Simulation broker | Simulator ✅ (internal messages)<br>Dashboard ✅ (monitoring + visualization) |
|
|
|
|
|
+| **1884** | “Fake real factory” broker | Simulator ✅ (real events injection)<br>Dashboard ✅ (monitoring) |
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+The simulator uses **1883** for simulation-specific MQTT commands (like `simulation/ctrl/...`, visualization output, etc.), and **1884** to receive simulated “real factory” messages like new workpiece arrivals or workpiece orders.
|
|
|
|
|
|
|
|
## Project Structure
|
|
## Project Structure
|
|
|
|
|
|