The Python script _`interactiveSim.py`_ uses the [Linux native application of Meshtastic](https://meshtastic.org/docs/software/linux-native) to simulate multiple instances of the device software. These instances communicate using TCP via the script, simulating the LoRa chip. The simulator forwards messages from the sender to all nodes within range, based on their simulated positions and the selected pathloss model (see [Pathloss Model](#pathloss-model)). **Note:** Packet collisions are not yet simulated.
1. Clone or download the repository and navigate to the Meshtasticator folder.
2. (Optional) Create a virtual environment.
3. Install dependencies:
```bash
pip install -r requirements.txt
```
The simulator runs the Linux native application of Meshtastic firmware. You can use either [PlatformIO](https://meshtastic.org/docs/development/firmware/build) or [Docker](https://meshtastic.org/docs/software/linux-native#usage-with-docker) to run the firmware:
- **`nrNodes`** (optional): Number of instances to launch. Each instance opens a terminal and a TCP port (starting at 4403).
- If you provide the number of nodes, they will be randomly placed; otherwise, you can manually place nodes on a plot.
- After placing nodes, you can configure their [role](https://meshtastic.org/docs/settings/config/device#role), `hopLimit`, height (elevation), and antenna gain. Configurations are saved automatically.
Once the simulation starts, you can issue commands (or use a predefined [script](#usage-with-script)) to send messages between nodes. Use `plot` to visualize message routes and airtime statistics:
- Enter a message ID to see its route.
- Hover over arcs for information and click to remove the overlay.
- Two graphs display channel utilization (one-minute window) and airtime usage (hourly window) for each node.
The simulator estimates signal propagation using a pathloss model. This is an approximation of the physical environment, so it may not be 100% accurate. The available models are:
- **0**: Log-distance model
- **1**: Okumura-Hata model (small/medium cities)
- **2**: Okumura-Hata model (metropolitan areas)
- **3**: Okumura-Hata model (suburban environments)
- **4**: Okumura-Hata model (rural areas)
- **5**: 3GPP model (suburban macro-cell)
- **6**: 3GPP model (metropolitan macro-cell)
You can modify the pathloss model and area configuration in `_lib/config.py_`. LoRa settings remain at their Meshtastic defaults unless customized during node placement.