Commit graph

175 commits

Author SHA1 Message Date
agessaman
b9d2f95f27 Enhance packet_capture.py with state management and event handling improvements
- Added functionality to persist and load the last advertisement timestamp using a JSON state file.
- Introduced methods for saving and loading advertisement state, ensuring reliability across application restarts.
- Enhanced the BinaryCommandProxy class with detailed event buffering and response timing for improved command handling.
- Updated response handling to accommodate new statistics tracking for command execution, including success, timeout, and error rates.
- Improved logging for command processing and event handling to facilitate better debugging and monitoring.
2026-01-25 13:16:12 -08:00
Adam Gessaman
0819a5669c WIP: Add binary command proxy and response handling in packet_capture.py
- Introduced a BinaryCommandProxy class to manage TCP connections for binary command communication.
- Defined binary command and response codes for improved command handling.
- Implemented event handlers to forward responses to binary interface clients.
- Integrated binary interface proxy setup and teardown in the PacketCapture class.
- Enhanced logging for better debugging and monitoring of command responses.
2026-01-09 14:56:03 -08:00
Adam Gessaman
ac3fe44ba6 Update MQTT configuration in Docker setup
- Revised MQTT settings for Let'sMesh Analyzer to include US and EU server configurations.
- Updated server addresses, ports, and transport methods for improved connectivity.
- Enabled authentication tokens and keepalive settings for both MQTT brokers.
- Added comments for optional custom MQTT broker configuration.
2026-01-09 10:26:38 -08:00
Adam Gessaman
057593762b Update Docker configuration for serial connection support
- Changed default connection type from BLE to serial in docker-compose.yml and Dockerfile.
- Updated privileged mode settings for improved security and flexibility.
- Enhanced device mounting instructions to recommend using persistent device IDs.
- Added comments for optional environment variables and MQTT settings for better clarity.
- Removed unnecessary default environment variables related to BLE connections.
2026-01-09 10:17:11 -08:00
Adam Gessaman
b6bf6e7b4c
Merge pull request #9 from samm-git/patch-1
Add device listing for FreeBSD
2026-01-09 07:09:57 -08:00
Alex Samorukov
34d66f3e05
Add device listing for FreeBSD
Fix serial selection for the FreeBSD
2025-12-26 21:57:02 +01:00
Adam Gessaman
9e580bee4a
Merge pull request #8 from agessaman/dev/dialout-fix
Improve BLE timeout and disconnect handling.
Refactor auth token generation to use the radio to sign JWTs, with fallbacks to a python implementation (typically unnecessary unless then firmware is 6+ months old). Removes dependency on meshcore-decoder.
Fixes pairing process in pairing_helper.py
2025-12-20 14:47:30 -08:00
agessaman
b6a1d1d072 Fix reconnection setup. 2025-12-18 10:36:45 -08:00
agessaman
a5faeb75e7 Add retry limits and connection handling improvements in PacketCapture
- Introduced configurable retry limits for various device commands, including BLE, TCP, health checks, stats, and device info queries.
- Enhanced the retryable_device_command method to utilize connection-specific defaults when max_retries is not specified.
- Implemented connection state management methods to streamline connection checks and state resets after reconnections.
- Improved health check logic to incorporate connection-specific timeout and retry configurations, enhancing reliability and error handling.
2025-12-18 09:46:59 -08:00
agessaman
a83bc27eec Enhance health check logic for BLE connections
- Introduced a grace period for health checks on BLE connections, allowing for a limited number of consecutive failures before considering the connection degraded.
- Adjusted health check timeout and retry logic for BLE and TCP connections to improve reliability.
- Reset health check failure count upon successful connection and health check, ensuring accurate tracking of connection status.
- Improved logging for health check failures and timeouts to aid in debugging and monitoring connection health.
2025-12-18 08:48:32 -08:00
agessaman
6d030af555 Add retry logic for device commands in auth_token and packet_capture modules
- Introduced `_retryable_device_sign` in `auth_token.py` to handle transient errors during device signing operations with exponential backoff.
- Implemented `retryable_device_command` in `packet_capture.py` for executing device commands with timeout and retry logic, enhancing robustness against communication issues.
- Updated various device command calls in `packet_capture.py` to utilize the new retry logic, improving error handling and reliability in device interactions.
2025-12-18 08:04:02 -08:00
agessaman
d825d2860d Update installation scripts to version 1.2 and improve logging
- Bump version in install.ps1 and install.sh to 1.2.
- Remove unnecessary debug logging in Bluetooth pairing functions.
- Enhance error handling in connection health checks for TCP with SDK auto-reconnect.
- Streamline MQTT configuration checks in install.sh.
2025-12-17 16:34:08 -08:00
agessaman
6725fc0a5e Fixed logic in device signing to python signing fallback 2025-12-17 14:20:55 -08:00
agessaman
ca96c21dc9 Fix pairing on MacOS, update installer to remove dependency on meshcore-decoder 2025-12-17 14:10:06 -08:00
agessaman
e174cfc21f Refactor auth token generation and improve signing methods
- Introduced on-device signing as the default method for JWT token generation, with fallback options to Python signing and meshcore-decoder CLI.
- Enhanced error handling and logging for token generation processes.
- Updated installation scripts to reflect changes in authentication methods, removing the requirement for meshcore-decoder.
- Added async support for token creation to improve performance in asynchronous contexts.
- Updated requirements to ensure compatibility with the latest meshcore package for on-device signing support.
2025-12-17 13:40:23 -08:00
agessaman
a7c8a3bf39 More meaningful error logging in health check process 2025-12-14 18:42:54 -08:00
agessaman
049c844f02 Improve BLE disconnection handling
- Capture BLE address before disconnecting to ensure proper cleanup.
- Implement forced disconnection via bluetoothctl on Linux systems for BLE devices.
2025-12-14 18:38:06 -08:00
agessaman
4cb24a72c6 Add dialout group check for serial connections and fix device name fallback
- Add check_dialout_group() function in install.sh to prompt users to add themselves to dialout group when using serial connections
- Fix device name retrieval: wait for self_info to populate and add fallback to PACKETCAPTURE_ORIGIN
- Prevents 'Cannot connect to MQTT without device name' errors when device info is delayed or unavailable
- Fixes indentation errors in packet_capture.py
2025-12-05 10:07:53 -08:00
agessaman
9b62512f87 Update install.sh to ensure Python dependencies are upgraded during installation and remove local package installation for meshcore. 2025-11-25 14:22:46 -08:00
Adam Gessaman
b80e3e5472
Update install.ps1
Bump with the release of stats feature
2025-11-25 06:18:26 -08:00
Adam Gessaman
9716b019d4
Update install.sh
Bump install version with stats release
2025-11-25 06:17:49 -08:00
Adam Gessaman
3a94cadfe3
Merge pull request #6 from agessaman/dev/stats-integration
Tested via BLE and TCP.
2025-11-25 06:09:37 -08:00
agessaman
0132af9ea9 Update README and requirements.txt to reflect meshcore package version requirement 2025-11-25 06:07:19 -08:00
agessaman
8407eeec70 Add status telemetry stats support to PacketCapture. 2025-11-24 09:49:03 -08:00
agessaman
83904e9a47 Update install.sh to build a comprehensive PATH for LaunchAgents, including Node.js and meshcore-decoder paths regardless of installation method. 2025-11-16 09:59:41 -08:00
agessaman
3a6ef2859a I gave NixOS support my best shot. I don't use it, so please feel free to send a PR if it doesn't work for you. 2025-11-09 19:59:06 -08:00
agessaman
8b3bf8f7e2 I think the NixOS flake is okay. If it isn't, send a PR. I gave it my best shot. 2025-11-09 19:59:06 -08:00
agessaman
517659035f another dockerfile fix 2025-11-09 19:42:56 -08:00
agessaman
998d78e3d3 fixed Dockerfile 2025-11-09 19:41:42 -08:00
agessaman
1c425959be I really don't like NixOS, but I'm going to add support if it kills me. 2025-11-09 19:38:54 -08:00
agessaman
988924bcfd make more flexible when running from a flake 2025-11-09 15:56:54 -08:00
agessaman
669838f40b updates to make nixos module work correctly 2025-11-09 15:52:05 -08:00
agessaman
3e79699326 updated documentation, added support for missing config fields 2025-11-09 12:54:04 -08:00
agessaman
5af80334b4 resolve path issue 2025-11-09 12:44:44 -08:00
agessaman
df5e95af13 added don't unpack 2025-11-09 12:43:18 -08:00
agessaman
a16691b28d Refactor source handling in meshcore-packet-capture derivation 2025-11-09 12:40:42 -08:00
agessaman
82af01c8ea add hatching to nix build, update test to use the flake-parts structure 2025-11-09 12:38:18 -08:00
agessaman
baaeeb92f5 - Modified the GitHub Actions workflow to limit the build matrix to only x86_64-linux, commenting out aarch64-linux due to slower cross-compilation requirements.
- Updated the `sha256` hash for the Python package fetching in `packages.nix` to a specific value for consistency.
2025-11-09 12:36:00 -08:00
agessaman
588eb674b7 update nixos config 2025-11-09 12:32:53 -08:00
agessaman
e41be84753 initial nixos support 2025-11-09 12:29:04 -08:00
agessaman
3920fed88d updated installers to include PACKETCAPTURE_UPLOAD_PACKET_TYPES line, commented out for later user configuration 2025-11-09 12:02:17 -08:00
agessaman
aaa0cac188 Add packet type filtering for MQTT uploads
- Introduced a new environment variable `PACKETCAPTURE_UPLOAD_PACKET_TYPES` to specify which packet types to upload to MQTT.
- Updated `packet_capture.py` to filter packets based on the allowed types, ensuring only specified types are uploaded while still capturing all packets.
- Updated documentation in README.md to explain the new filtering feature and provide usage examples.
2025-11-09 11:56:23 -08:00
agessaman
bf411ebe68 removed non-working python JWT generator fallback, added logging to clarify need for meshcore-decoder 2025-11-09 08:22:21 -08:00
agessaman
70bb0498b6 fixed iata handling in reconfiguration-enabled installer script 2025-11-06 19:12:03 -08:00
agessaman
6f39aecd38 updated installer to read previous configuration as defaults when reconfiguring 2025-11-06 16:28:59 -08:00
agessaman
29d98f791b Enhance JWT token configuration to include optional owner email
- Updated `install.ps1` and `install.sh` to prompt for an optional owner email address during JWT configuration.
- Added email validation and storage in the environment configuration.
- Modified `packet_capture.py` to include the owner email in JWT claims if configured.
2025-11-06 16:09:55 -08:00
agessaman
210edcee6e Add JWT token configuration options to install scripts
- Introduced `Configure-JwtOptions` in `install.ps1` and `configure_jwt_options` in `install.sh` to allow optional configuration of an owner public key for JWT tokens.
- Updated the MQTT broker configuration to prompt for JWT options if not already set.
- Enhanced `packet_capture.py` to include the owner public key and client agent in JWT claims if configured.
2025-11-06 15:59:35 -08:00
agessaman
aedd883a61 update installer script version, change systemctl memorylimit ot memorymax. 2025-11-02 16:19:41 -08:00
agessaman
73bbc674d5 improved pairing by asking for a pin more quickly 2025-11-02 16:13:25 -08:00
agessaman
76ffcc6f6a Enhance BLE pairing process in install.sh 2025-11-02 16:08:49 -08:00