Add packet capture service documentation to README

This commit is contained in:
agessaman committed 2025-12-21 18:58:44 -08:00
1 parent d6aec8ce29
commit a2d207b0c5
1 file changed
+83
+83
View File
@@ -345,7 +345,90 @@ class MyCommand(BaseCommand):
This project is licensed under the MIT License.
## Packet Capture Service
The bot includes an integrated packet capture service that can capture packets from the MeshCore network and publish them to MQTT brokers. This service is based on the standalone [meshcore-packet-capture](https://github.com/agessaman/meshcore-packet-capture) project.
### Features
- **Packet Capture**: Captures all incoming packets from the MeshCore network
- **MQTT Publishing**: Publishes packets to one or more MQTT brokers
- **Multiple Brokers**: Support for multiple MQTT brokers with individual configuration
- **JWT Authentication**: Supports JWT-based authentication with on-device or Python signing
- **Status Publishing**: Periodically publishes device status and statistics
- **File Output**: Optional file output for packet logging
### Configuration
Enable the packet capture service in `config.ini`:
```ini
[PacketCapture]
enabled = true
output_file = packets.json # Optional: save packets to file
verbose = false # Enable verbose packet output
debug = false # Enable debug logging
# Owner information (for JWT authentication)
owner_public_key = YOUR_OWNER_PUBLIC_KEY
owner_email = your.email@example.com
# Private key (optional if using on-device signing)
private_key_path = /path/to/private_key.txt
auth_token_method = device # device or python
# IATA airport code for topic templating
iata = LOC
# MQTT Broker Configuration (mqttN_* format)
# Multiple brokers can be configured (mqtt1_*, mqtt2_*, etc.)
# Broker 1 (Let's Mesh Analyzer - EU)
mqtt1_server = mqtt-eu-v1.letsmesh.net
mqtt1_port = 443
mqtt1_transport = websockets
mqtt1_use_tls = true
mqtt1_use_auth_token = true
mqtt1_token_audience = mqtt-eu-v1.letsmesh.net
mqtt1_topic_status = meshcore/{IATA}/{PUBLIC_KEY}/status
mqtt1_topic_packets = meshcore/{IATA}/{PUBLIC_KEY}/packets
mqtt1_websocket_path = /mqtt
# Broker 2 (Let's Mesh Analyzer - US)
mqtt2_server = mqtt-us-v1.letsmesh.net
mqtt2_port = 443
mqtt2_transport = websockets
mqtt2_use_tls = true
mqtt2_use_auth_token = true
mqtt2_token_audience = mqtt-us-v1.letsmesh.net
mqtt2_topic_status = meshcore/{IATA}/{PUBLIC_KEY}/status
mqtt2_topic_packets = meshcore/{IATA}/{PUBLIC_KEY}/packets
mqtt2_websocket_path = /mqtt
# Stats and status publishing
stats_in_status_enabled = true
stats_refresh_interval = 300 # Publish status every 5 minutes
# JWT renewal interval (seconds, 0 = disabled)
jwt_renewal_interval = 3600
# Health check interval (seconds, 0 = disabled)
health_check_interval = 30
health_check_grace_period = 2
```
### MQTT Topic Templates
Topic templates support placeholders:
- `{IATA}` - Replaced with the configured IATA code
- `{PUBLIC_KEY}` - Replaced with the device's public key
### Standalone Version
For a standalone packet capture solution that doesn't require the full bot, see the [meshcore-packet-capture](https://github.com/agessaman/meshcore-packet-capture) project.
## Acknowledgments
- [MeshCore Project](https://github.com/meshcore-dev/MeshCore) for the mesh networking protocol
- Some commands adapted from MeshingAround bot by K7MHI Kelly Keeton 2024
- Packet capture service based on [meshcore-packet-capture](https://github.com/agessaman/meshcore-packet-capture) by agessaman