A Python GUI application for optimizing router placement in Meshtastic mesh networks. This tool helps identify which nodes should be routers and which should be clients to maximize network efficiency while maintaining redundancy.
- Real-time Network Visualization: Interactive graph visualization showing nodes and their connections
- Router Optimization: Automatically identify redundant routers and suggest optimizations
- Scoring System: Customizable scoring algorithms for evaluating node importance
- Redundancy Control: Configurable redundancy levels (2-3 connections per node)
- Hop Count Analysis: Ensures all nodes can reach each other within 5 hops
- Interactive GUI: Sliders and controls for real-time network adjustments
- Color-coded Visualization: Visual indicators for node types and connection quality
- Performance Optimization: Multi-threaded processing for large networks
- Live Data Fetching: Can download and analyze data from meshview.bayme.sh
- Clone this repository
- Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
Run the main application:
python mesh_optimizer.py
- Redundancy Slider: Set the desired redundancy level (2-3 connections)
- Max Hops Slider: Maximum allowed hops between any two nodes (default: 5)
- Coverage Weight: Importance of node coverage in scoring
- Centrality Weight: Importance of network centrality
- Redundancy Weight: Importance of connection redundancy
- Load Data: Fetch latest data from meshview.bayme.sh
- Optimize: Run the optimization algorithm
- Export: Save optimization results
- Blue: Router nodes
- Green: Client nodes
- Yellow: Nodes with single connection (vulnerable)
- Red: Disconnected nodes or problematic links
- Orange: Suggested router promotions
- Purple: Suggested router demotions
The application consists of several modules:
mesh_optimizer.py
: Main application entry point and GUInetwork_analyzer_optimized.py
: Optimized network analysis algorithms with parallel processingdata_fetcher.py
: Handles data retrieval from Meshtastic sourcesinteractive_visualization.py
: Advanced interactive network visualizationvisualization.py
: Network visualization componentsoptimization_worker.py
: Background workers for optimization tasks
Nodes are scored based on:
- Coverage: Number of unique nodes reachable
- Centrality: Betweenness centrality in the network
- Redundancy: Connection redundancy provided
- Hop Reduction: Impact on average hop count
- Critical Path: Presence in critical network paths
- Identify redundant routers with overlapping coverage
- Find clients that would improve network connectivity as routers
- Ensure minimum redundancy requirements are met
- Minimize hop count while reducing router count
- Maintain network connectivity for all nodes
- Python 3.8+
- PyQt6 for GUI
- NetworkX for graph algorithms
- Matplotlib/Plotly for visualization
- See
requirements.txt
for full list