mirror of
https://github.com/eddieoz/LoRa-Mesh-Analyzer.git
synced 2026-03-28 17:42:59 +01:00
2.6 KiB
2.6 KiB
Architecture Overview
The LoRa Mesh Analyzer is structured as a modular Python application. This document outlines the key components and their responsibilities.
Directory Structure
LoRa-Mesh-Analyzer/
├── mesh_analyzer/ # Core package
│ ├── monitor.py # Main application loop and orchestration
│ ├── analyzer.py # Passive health check logic
│ ├── active_tests.py # Active testing logic (Traceroute, etc.)
│ ├── reporter.py # Report generation (Markdown/HTML)
│ ├── route_analyzer.py# Route analysis and topology mapping
│ ├── config_validator.py # Configuration validation
│ └── utils.py # Shared utility functions
├── scripts/ # Standalone scripts and tools
│ ├── report_generate.py # Tool to regenerate reports from JSON
│ └── ...
├── reports/ # Generated reports and data
├── tests/ # Unit tests
├── config.yaml # User configuration
└── main.py # Entry point
Core Components
monitor.py
The central coordinator. It:
- Initializes the Meshtastic interface.
- Loads configuration.
- Runs the main loop:
- Collects node data.
- Triggers auto-discovery or priority node selection.
- Orchestrates active tests.
- Invokes the analyzer and reporter.
analyzer.py
Responsible for passive analysis of the mesh. It checks for:
- Congestion: High Channel Utilization.
- Spam: High Airtime usage.
- Placement: Routers without GPS, redundant routers.
- Configuration: Deprecated roles, bad hop limits.
active_tests.py
Handles active network probing. It:
- Sends traceroute requests.
- Parses responses.
- Manages timeouts and rate limiting.
reporter.py
Generates human-readable reports. It:
- Takes analysis results and test data.
- Formats them into Markdown or HTML.
- Saves raw data to JSON for persistence.
route_analyzer.py
Analyzes the topology based on traceroute data. It:
- Identifies common relays (backbone nodes).
- Detects bottlenecks (single points of failure).
- Calculates link quality metrics.
Data Flow
- Collection:
monitor.pycollects raw node data from the Meshtastic interface. - Testing:
active_tests.pyprobes specific nodes and adds results to the dataset. - Analysis:
analyzer.pyandroute_analyzer.pyprocess the raw data and test results to identify issues and patterns. - Reporting:
reporter.pyformats the findings into a report and saves the state to JSON.