- Python 45.3%
- JavaScript 28%
- HTML 26.7%
|
Troed Sångberg
be6fef83bc
Improve auto-refresh: add immediate refresh when tab becomes active after being inactive
- Enhanced visibility change handler to perform immediate data refresh when tab regains focus - After immediate refresh, resumes normal interval timing - Ensures users get fresh data immediately when returning to the app - Prevents waiting for next scheduled refresh after prolonged inactivity Example scenario fixed: 1. User sets 30-second refresh interval 2. User switches to another tab for 5 minutes 3. User returns to MeshNetMon tab 4. Before: Had to wait up to 30 seconds for next refresh 5. After: Gets immediate refresh + normal timing resumes This provides better user experience by ensuring data is always current when users return to the application, while maintaining all the benefits of the visibility-based pause/resume system. |
||
|---|---|---|
| app | Improve auto-refresh: add immediate refresh when tab becomes active after being inactive | |
| docs | Add heightmap documentation and screenshot to README | |
| scripts | Clean up root directory: Move analysis scripts to scripts/ directory | |
| test | Implement caching optimization to prevent redundant API calls for cached tiles | |
| .env.example | Remove frequency config from main branch: Fresnel calculations not present | |
| .gitignore | Final cleanup: Remove outdated files and organize project structure | |
| README.md | Fix repository name in installation instructions | |
| requirements.txt | Implement line-of-sight analysis with elevation data from STAC-hojd API | |
| VIBE_DISCLAIMER.md | Update VIBE_DISCLAIMER.md | |
Meshtastic Node Monitor - Web Application
Meshtastic Node Monitor Screenshot
A modern web-based interface for monitoring and analyzing Meshtastic mesh networks.
🛠️ Installation
Prerequisites
- Python 3.7+
- pip (Python package manager)
- Meshtastic device connected to your network
Setup
- Clone the repository:
git clone https://codeberg.org/troed/meshnetmon.git
cd meshnetmon
- Install dependencies:
pip install -r requirements.txt
- Configure the application:
Create a
.envfile from the example template:
cp .env.example .env
Then edit the .env file to configure your Meshtastic device connection:
# Meshtastic device connection settings
MESHTASTIC_HOST="localhost"
MESHTASTIC_PORT=44989
For elevation data (optional), add your API credentials:
# Elevation data API credentials
HEIGHT_API_USERNAME="your_username"
HEIGHT_API_PASSWORD="your_password"
Running the Application
Development mode (with auto-reload):
python app/main.py
Production mode:
uvicorn app.main:app --host 0.0.0.0 --port 8000
The application will be available at http://localhost:8000
📋 Features
Core Functionality
- Interactive Map View - Visualize your mesh network on OpenStreetMap with color-coded nodes based on hop count
- Node Tables - Detailed information about all nodes in your network
- Distance Calculations - Calculate distances between nodes
- Line-of-Sight Analysis - Advanced terrain analysis using elevation data from Swedish Land Survey (optional, Sweden only)
- Real-time Data - Connect to your Meshtastic device for live updates
- Statistics Dashboard - Network health metrics and insights
Heightmap Visualization (New!)
- Terrain Elevation Data - Download and display high-resolution elevation maps
- Automatic Caching - Elevation tiles are cached for offline use and better performance
- Smart Tile Management - Only downloads missing tiles, avoids redundant API calls
- Seamless Integration - Elevation data automatically enhances line-of-sight analysis
- Visual Terrain Analysis - Color-coded elevation maps with smooth gradient schemes
User Interface
- Three main views: Map View, All Nodes Table, Nodes with Coordinates Table
- Sortable columns with persistent sorting preferences
- Responsive design that works on desktop and mobile devices
- Auto-refresh functionality with tab-specific updates
- Last Seen filter to show only recently active nodes (6h, 1d, 3d, 1w, all)
🗻 Elevation Data & Heightmap Configuration
Note: Line-of-Sight analysis and heightmap visualization using elevation data is currently only available for coordinates within Sweden, as it uses data from the Swedish Land Survey (Lantmäteriet).
Heightmap Features
The heightmap visualization provides several powerful features:
- Automatic Tile Download: When you zoom into an area, elevation tiles are automatically downloaded and cached
- Intelligent Caching: Once downloaded, tiles are stored locally and reused, eliminating redundant API calls
- Visual Terrain Analysis: Elevation data is displayed using a smooth color gradient (dark blue → blue → green → yellow → red → black)
- Seamless Integration: Heightmap data enhances line-of-sight analysis with real terrain information
- Performance Optimized: Only missing tiles are downloaded; cached tiles are reused automatically
Setup Instructions
To enable elevation data and heightmap visualization:
-
Register for API Access:
- Visit https://www.lantmateriet.se/en/
- Register for an account and request API credentials
- You'll need access to the STAC-hojd API
-
Configure API Credentials:
- Add your credentials to the
.envfile:
# Elevation data API credentials (required for heightmap and line-of-sight analysis) HEIGHT_API_USERNAME="your_username" HEIGHT_API_PASSWORD="your_password" - Add your credentials to the
-
Usage:
- Navigate to the heightmap tab
- Zoom into your area of interest (zoom level 10+ recommended)
- Elevation data will automatically download and display
- Cached tiles are reused on subsequent visits
Technical Details
- Data Source: Swedish Land Survey (Lantmäteriet) STAC-hojd API
- Resolution: 1-meter elevation data
- Coverage: Entire Sweden
- Cache Location:
data/elevation_cache/directory - Tile Format: GeoTIFF files with automatic caching
Troubleshooting
If heightmaps don't appear:
- Check that API credentials are correctly configured in
.env - Verify you're zoomed in sufficiently (zoom level 10+)
- Ensure your coordinates are within Sweden
- Check browser console for any error messages
- Verify the height service is enabled (check application logs)
🎯 Use Cases
Network Monitoring
- Monitor node connectivity and health
- Track battery levels across your network
- Identify nodes with poor signal (low SNR)
Troubleshooting
- Visualize network topology on a map
- Identify nodes with incorrect positions
- Find the closest nodes to any reference point
Planning
- Plan new node placements based on coverage and terrain
- Analyze network reach, gaps, and line-of-sight obstacles
- Optimize node distribution considering terrain obstacles
Data Analysis
- Export node data via API
- Generate statistics and reports
- Integrate with other tools via REST API
🤝 Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin feature/your-feature) - Create a new Pull Request
📄 License
This project is open-source and available under the Creative Commons Zero license.
💬 Support
For any issues or questions, please:
- Open an issue in the repository
- Check the existing issues for similar problems
- Review the API documentation for usage examples
For more information about Meshtastic, visit: https://meshtastic.org