Commit Graph

463 Commits

Author SHA1 Message Date
dmduran12 2b4012eeb6 feat: add /ws/companion_frame WebSocket proxy
Dumb byte pipe between browser WebSocket and companion TCP frame server.
Allows browser clients to speak the MeshCore companion frame protocol
directly — all parsing lives client-side.

New file: repeater/web/companion_ws_proxy.py
- ws4py handler with JWT auth (same pattern as PacketWebSocket)
- Resolves companion_name → TCP port from config
- Bidirectional byte forwarding: WS ↔ TCP

http_server.py: mount at /ws/companion_frame alongside /ws/packets

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-03-12 17:50:20 -07:00
Lloyd bc19c0fd9b update UI for web updater 2026-03-11 15:54:45 +00:00
Lloyd 596c96d1f4 Extend test to: serialization/deserialization with multi-byte paths
- Functionality of Packet.apply_path_hash_mode and get_path_hashes
- Engine flood_forward and direct_forward with real multi-byte encoded packets
- PacketBuilder.create_trace payload structure and TraceHandler parsing
- Enforcement of max-hop boundaries per hash size
2026-03-11 14:23:29 +00:00
Lloyd 155575865a trace packet path handling to support multi-byte hash mode 2026-03-11 11:19:03 +00:00
Lloyd 362a477cdd exted multibyte to ping api 2026-03-11 11:00:49 +00:00
Lloyd d701342951 add error handling for service file update and migrate service unit to fix PYTHONPATH and WorkingDirectory 2026-03-11 10:27:20 +00:00
Lloyd e6fed7bea1 Add --ignore-installed flag to pip install commands to prevent conflicts with system-managed packages 2026-03-10 21:54:13 +00:00
Lloyd 23463b606d Fix WorkingDirectory in service files to prevent shadowing of pip-installed package 2026-03-10 16:46:13 +00:00
Lloyd f96d64a813 Refactor version retrieval and remove legacy PYTHONPATH from service unit 2026-03-10 15:37:12 +00:00
Lloyd 6c3252e51c fix letmesh logging typo 2026-03-10 13:55:35 +00:00
Lloyd 5e7cf3f315 Refactor setuptools configuration to use package finding options 2026-03-10 13:21:29 +00:00
Lloyd e5e2006bbe update ui to include Github ratelimit warn 2026-03-10 12:50:51 +00:00
Lloyd da3dd470ae Add rate limit handling for GitHub API requests 2026-03-10 12:49:57 +00:00
Lloyd c53e8034e6 update UI update process to attend restart 2026-03-10 12:33:30 +00:00
Lloyd 95e86b5150 Enhance pymc-do-upgrade script to accept an optional pretend-version argument and update version retrieval logic to strip PEP 440 local identifiers from version strings. 2026-03-10 12:08:55 +00:00
Lloyd bf3b4b5b1b Enhance version retrieval logic and add fallback mechanisms in _get_installed_version function 2026-03-10 11:33:49 +00:00
Lloyd cd1c88e9c6 Refactor update version retrieval and cleanup stale dist-info directories 2026-03-10 11:11:01 +00:00
Lloyd 632f1d2d1a Merge pull request #132 from agessaman/dev-companion-v2-cleanup
Update OTA repeater stats to return correct uptime, airtime, packet counts, etc.
2026-03-10 09:32:43 +00:00
agessaman 25c2a14a81 Update OTA repeater stats to return correct uptime, airtime, packet counts, etc.
- Introduced `total_rx_airtime_ms` in `AirtimeManager` to track received packet airtime.
- Added `record_rx` method to log received airtime in `AirtimeManager`.
- Updated `RepeaterHandler` to count received packets and log RX airtime using the new method.
- Enhanced statistics reporting in `get_stats` to include total received airtime.
- Updated `ProtocolRequestHelper` to include total RX airtime in the RepeaterStats structure for better monitoring.
2026-03-09 17:27:51 -07:00
Lloyd 664f061bb9 update type check on web version state 2026-03-09 15:02:11 +00:00
Lloyd bf04439357 update UI with web installer 2026-03-09 14:57:58 +00:00
Lloyd 97bfb0ebaa Merge pull request #119 from migillett/feature/updated-docker-readme
feat: updated readme plus docker usb support
2026-03-09 13:46:58 +00:00
Lloyd a88dc596d4 Merge branch 'feat/companion' into feature/updated-docker-readme 2026-03-09 13:46:13 +00:00
Lloyd 6bf252f58b Improve version retrieval by bypassing importlib.metadata cache 2026-03-09 12:10:19 +00:00
Lloyd c0e625fdeb Add changelog endpoint to fetch new commits since installed version 2026-03-09 12:04:14 +00:00
Lloyd dc2c785f89 Enhance version comparison and fetching logic for updates by integrating packaging.version and reading from pyproject.toml 2026-03-09 11:39:48 +00:00
Lloyd 1fdb7edc49 Allow bypassing cache in update check endpoint with optional force parameter 1.0.7 2026-03-09 11:09:30 +00:00
Lloyd 0ed78a2eed Update pip install command format for hardware dependencies in management scripts 2026-03-09 11:03:49 +00:00
Lloyd ce8cdfd48d Refactor version handling in update endpoints to use importlib.metadata for installed version retrieval 2026-03-09 10:47:52 +00:00
Lloyd 437d526085 Add OTA update functionality with new API endpoints and upgrade script 2026-03-09 10:31:36 +00:00
Lloyd 95537cd158 Merge pull request #130 from agessaman/dev-companion-v2-cleanup
Enhance packet recording and refactor handling in RepeaterHandler and PacketRouter
2026-03-09 08:54:13 +00:00
agessaman ee97ff736a Remove obsolete documentation on DIRECT packet handling
- Deleted the `DIRECT_packets_not_forwarded.md` file, which outlined the behavior of certain packet types in the router and their forwarding status. This change reflects the removal of outdated information that is no longer relevant to the current implementation.
2026-03-08 19:47:09 -07:00
agessaman f2a5eab726 Refactor packet handling in PacketRouter and RepeaterHandler
- Removed redundant original_path assignment in `RepeaterHandler` to streamline packet processing.
- Introduced `_is_direct_final_hop` helper method in `PacketRouter` to determine if a packet is the final destination for direct routes with an empty path.
- Updated comments in `PacketRouter` to clarify the handling of packets during routing, especially for direct forwarding scenarios.
- Adjusted logic to ensure packets are correctly processed or delivered based on their routing status, enhancing overall packet management.
2026-03-08 19:39:49 -07:00
agessaman 1002ba3194 Refactor packet handling in RepeaterHandler and PacketRouter
- Introduced helper methods `_path_hash_display` and `_packet_record_src_dst` in `RepeaterHandler` to streamline path hash and source/destination hash extraction.
- Updated `record_packet` method to utilize a new `_build_packet_record` method for improved readability and maintainability.
- Enhanced `PacketRouter` comments for clarity on handling remote destinations and packet processing, ensuring better understanding of the routing logic.
2026-03-08 18:23:16 -07:00
agessaman 4490c9bb8c Add packet recording for injection-only types in RepeaterHandler
- Introduced `record_packet_only` method in `RepeaterHandler` to log packets for UI/storage without forwarding or duplicate checks, specifically for injection-only types like ANON_REQ and ACK.
- Updated `PacketRouter` to call `_record_for_ui` method, ensuring that relevant metadata is recorded for packets processed by various handlers.
- Enhanced handling of packet metadata, including RSSI and SNR values, to improve the visibility of packet information in the web UI.
2026-03-08 17:23:20 -07:00
Lloyd 884de123b9 Merge branch 'pr-128' into feat/companion
# Conflicts:
#	repeater/engine.py
#	repeater/web/api_endpoints.py
2026-03-08 07:09:06 +00:00
agessaman 062dabc46e Enhance TCP timeout configuration for companions
- Added `tcp_timeout` setting to `config.yaml.example` for companion configurations, allowing customization of TCP connection timeouts.
- Updated `RepeaterDaemon` to retrieve and apply the `tcp_timeout` setting, with a default value of 120 seconds.
- Modified `CompanionFrameServer` to accept `client_idle_timeout_sec` parameter, ensuring proper handling of idle timeouts.
- Enhanced API endpoints to include `tcp_timeout` in companion settings, improving configuration visibility and management.
2026-03-07 20:39:37 -08:00
agessaman 1b6f9df489 Improve companion identity handling and persistence
- Introduced `normalize_companion_identity_key` function to standardize identity key formatting by stripping whitespace and removing the optional 0x prefix.
- Updated `RepeaterDaemon` to utilize the new normalization function when processing identity keys, improving consistency and error handling.
- Added a `stop` method in `CompanionFrameServer` to persist contacts and channels before stopping, ensuring data survives daemon restarts.
2026-03-07 14:41:31 -08:00
agessaman 3725d6eb21 Add path hash mode configuration and management
- Introduced `path_hash_mode` setting in `config.yaml.example` to specify the hash size for flood packets.
- Updated `ConfigManager` to re-apply the path hash mode when the mesh section changes, with validation for acceptable values (0, 1, 2).
- Enhanced `RepeaterDaemon` to set the default path hash mode during initialization, ensuring consistent handling of flood packets.
2026-03-07 13:57:46 -08:00
Lloyd d74c8bda5c Add support for enabling pin configuration in hardware settings 2026-03-06 21:53:03 +00:00
Lloyd 72d4650323 Refactor manage.sh to install pymc_repeater with fresh dependencies from pyproject.toml, ensuring no stale modules from pymc_core. 2026-03-06 21:34:07 +00:00
Lloyd e5c91f382a Add mesh configuration for loop detection and update API endpoint handling 2026-03-06 21:21:30 +00:00
Lloyd e19ec79b49 Implement advertisement packet deduplication with configurable TTL and max hashes 2026-03-06 16:47:38 +00:00
Lloyd 5c3b2eff2a Update manage.sh to uninstall existing pymc_core and install fresh version from GitHub 2026-03-06 15:34:13 +00:00
Lloyd 9000d83754 Remove cached pymc_core installation before package updates to prevent stale module issues 2026-03-06 14:52:27 +00:00
Lloyd 6de88dd2a0 Fix formatting in dependencies section of pyproject.toml 2026-03-06 14:43:45 +00:00
Lloyd f63b001ca7 fix typos in manage.sh 2026-03-06 14:40:15 +00:00
Lloyd f792b20bcf Update pymc_core dependency to include hardware support 2026-03-06 14:24:46 +00:00
Lloyd ff7a06eaf7 Merge pull request #122 from agessaman/dev-companion-v2-cleanup
Add Companion module and multi-byte path support
2026-03-06 12:55:12 +00:00
agessaman 5b0359b74b Enhance configuration management and companion node handling
- Added backup functionality for config.yaml during save operations.
- Improved YAML saving to support Unicode characters and increased line width.
- Introduced a mechanism to sync companion node names to the configuration upon updates.
- Updated API endpoints to validate companion node names and persist changes to the configuration.
- Enhanced the RepeaterCompanionBridge to load and save preferences, ensuring consistent state management.
2026-03-05 20:04:17 -08:00