65 Commits

Author SHA1 Message Date
agessaman
744826199e feat: implement duplicate packet recording for UI visibility in RepeaterHandler
- Added record_duplicate method to RepeaterHandler to log known duplicate packets without forwarding.
- Enhanced RepeaterDaemon to subscribe to raw packets for deduplication logging, ensuring all path variants are visible in the UI.
- Updated recent_packets management to group duplicates under their original packets for better tracking.
2026-03-23 17:02:29 -07:00
Lloyd
369b420ae3 feat: enhance RepeaterHandler with duplicate packet limit and cache cleanup, add graceful shutdown handling in RepeaterDaemon, and increase PacketRouter queue size 2026-03-23 14:30:01 +00:00
Lloyd
d11d957318 Merge pull request #158 from agessaman/feat/companion-traces
Fix multibyte trace handling for companion/repeater and exclude trace packets from _record_for_ui
2026-03-22 22:44:10 +00:00
agessaman
c5c94fe60a feat: exclude TRACE packets from logging in RepeaterHandler and PacketRouter
- Updated record_packet_only method to skip logging for TRACE packets, as TraceHelper manages trace paths.
- Enhanced documentation to clarify the handling of TRACE packets in the web UI.
- Added tests to ensure TRACE packets are not recorded, maintaining data integrity.
2026-03-22 15:26:28 -07:00
Lloyd
55fe9feddd feat: add useSignalQuality utility for signal strength evaluation 2026-03-22 22:26:18 +00:00
agessaman
7558c5604c feat: enhance repeater TX mode functionality so companion tenants can TX while in monitor mode
- Modify TX modes: forward, monitor, and add no_tx, allowing for flexible packet handling.
- Updated configuration and API endpoints to support the new modes.
- Adjusted logic in RepeaterHandler to manage packet processing based on the selected mode.
- Enhanced CLI commands to reflect the new mode settings.
- Added tests for each TX mode to ensure correct behavior.
2026-03-15 13:03:18 -07: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
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
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
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
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
e5c91f382a Add mesh configuration for loop detection and update API endpoint handling 2026-03-06 21:21:30 +00:00
agessaman
0217a49ed2 Refactor RepeaterHandler path management and enhance packet validation
- Removed redundant call to mark_seen() for duplicate packets.
- Added validation to ensure hop count does not exceed the maximum limit before appending to the packet path.
- Updated logic to check for path size constraints when appending hash bytes, improving packet processing efficiency.
2026-03-05 16:52:43 -08:00
agessaman
c150b9a9bf Merge upstream/feat/newRadios into dev-companion-v2-cleanup
- Keep our Vite-built assets and index.html script (index-DyUIpN7m.js)
- Remove upstream-only asset chunks and RoomServers-BxQ-0q-x.js
- README: keep two-backend intro, add upstream CAUTION/compatibility table
- manage.sh: keep dialog/gauge UX and .[hardware]; add CH341 udev, sudoers, libusb, polkit, silent upgrade
- sqlite_handler: add crc_errors table, index, and cleanup from upstream
- engine: add validate_packet and mark_seen in direct_forward; keep our path hash_size/hop_count logic
- advert: keep comment, use current_time = now
- api_endpoints: use restart_service() from service_utils
- config merge: strip user config comments before yq merge (upstream)

Made-with: Cursor
2026-03-05 16:43:14 -08:00
agessaman
b6757a0ca0 Refactor path handling in RepeaterHandler to utilize hash-based representations
- Replaced list-based path storage with hash-based methods for original and forwarded paths, improving efficiency and consistency.
- Updated display logic to format path hashes correctly, ensuring compatibility with new hash size management.
- Adjusted local transmission handling to align with the new hash representation, enhancing clarity in packet processing.
2026-03-05 14:06:43 -08:00
agessaman
0271aa9455 Add support for multi-byte hashes via local_hash_bytes
- Updated the RepeaterHandler constructor to accept local_hash_bytes, improving path handling.
- Implemented checks to ensure packet paths do not exceed MAX_PATH_SIZE when appending hash bytes.
- Refactored direct_forward method to utilize local_hash_bytes for next hop validation and path manipulation.
- Adjusted path length encoding to accommodate changes in path management logic.
2026-03-05 09:39:11 -08:00
Lloyd
136af19178 add loop detection configuration and tests for flood routing 2026-03-05 14:06:28 +00:00
Lloyd
7dccb7457f Add advertisement configuration options for rate limiting and adaptive settings 2026-03-05 11:12:28 +00:00
Lloyd
4a05e20172 Add CRC error tracking and API endpoints for error count and history
- Create a new table for storing CRC errors in SQLite.
- Implement methods to store and retrieve CRC error counts and history.
- Update StorageCollector to record CRC errors and expose relevant methods.
- Enhance RepeaterHandler to track and record CRC error deltas from the radio hardware.
- Add API endpoints to fetch CRC error count and history.
2026-03-02 12:36:08 +00:00
Lloyd
c2f57c3d0f add tests and more validation to packets, remove crc setting from config as hardcoded. 2026-03-02 11:35:50 +00:00
agessaman
e14fd3feea Refactor noise floor retrieval in RepeaterHandler to use asyncio executor
- Updated the noise floor retrieval method to run in an executor, preventing blocking of the event loop during the KISS modem's command execution.
- This change enhances responsiveness by allowing the process to handle other tasks while waiting for the noise floor measurement.
2026-02-21 15:38:04 -08:00
agessaman
65164fffb7 Improve retransmission logic and duty cycle handling in RepeaterHandler
- Improved local transmission handling by deferring local TX when duty cycle limits are exceeded, instead of dropping packets.
- Added LBT metadata extraction and logging for better monitoring of transmission attempts and delays.
- Refactored `schedule_retransmit` to support retrying local transmissions on failure, enhancing reliability.
- Introduced a lock in PacketRouter to serialize local TX operations, preventing race conditions during packet processing.
2026-02-21 15:38:01 -08:00
agessaman
c2f8a2e3cd refactor: companion FrameServer and related (substantive only, no Black)
Reapply refactor from ce8381a (replace monolithic FrameServer with thin
pymc_core subclass, re-export constants, SQLite persistence hooks) while
preserving pre-refactor whitespace where patch applied cleanly. Remaining
files match refactor commit exactly. Diff vs ce8381a is whitespace-only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 15:35:47 -08:00
Lloyd
371b9fdbb8 fix: update airtime calculations to use config values in AirtimeManager 2026-01-19 11:52:23 +00:00
Lloyd
d671c58184 suppress duplicate packets in processing logic 2026-01-12 16:23:11 +00:00
Lloyd
1999af8bdd add Packet Hash Cache to UI 2026-01-10 22:59:43 +00:00
Lloyd
effad3378f Increase default cache TTL from 60 seconds to 1 hour 2026-01-10 22:27:15 +00:00
Paul Picazo
942d4dfe28 Enhance advert storage logic: prioritize direct routes and handle zero-hop measurements
Refactor packet processing: use processed_packet for forwarding and drop reason checks

Fix: Update zero-hop determination logic in AdvertHelper

Fix: Clone packet in process_packet to prevent modification of the original

Fix: Import copy module for deep copying of packets in process_packet
2026-01-03 14:35:30 -08:00
Lloyd
8b8edb9929 add pymc console endpoints and ui 2026-01-02 16:35:18 +00:00
Lloyd
98b425f444 added CLI 2025-12-29 14:37:54 +00:00
dmduran12
e74e062fe5 feat(api): Expose additional config values in /api/stats
Adds the following fields to the stats API response for MeshCore CLI parity:

- config.repeater.max_flood_hops: Max flood hops setting (for 'get flood.max')
- config.repeater.advert_interval_minutes: Local advert interval (for 'get advert.interval')
- config.delays.rx_delay_base: RX delay base setting (for 'get rxdelay')

These fields are already present in config.yaml but were not exposed via the
stats API, making them inaccessible to web dashboards and CLI tools that
communicate over HTTP.

This enables pyMC Console's Terminal to display these values without
requiring direct config file access.

Co-Authored-By: Warp <agent@warp.dev>
2025-12-27 19:46:29 -08:00
Lloyd
24866707f4 retransmission handling to await completion and extract LBT metadata 2025-12-21 21:31:36 +00:00
Lloyd
9834ae7059 Add LBT metadata extraction and logging after packet transmission 2025-12-21 21:22:49 +00:00
Lloyd
7da569f4b1 LBT metrics extraction in packet 2025-12-21 20:45:10 +00:00
Lloyd
9a56c03ae7 Add LBT metrics to packet storage and logging in RepeaterHandler 2025-12-21 20:41:22 +00:00
Lloyd
5222800474 Refine packet handling to skip LetsMesh only for invalid packets, excluding duplicates and operational drops 2025-12-02 16:14:43 +00:00
Lloyd
9b53c5b6de Update packet handling to skip invalid advert packets and update record_packet method to conditionally publish to LetsMesh 2025-12-02 16:09:43 +00:00
Lloyd
6c7e92d35c support local transmissions and update PacketRouter to use local_transmission flag for packet injection 2025-12-01 22:57:06 +00:00
Lloyd
1b3ee8f4f1 packet handling to support locally injected packets in RepeaterHandler and update trace packet forwarding to use injection method 2025-12-01 22:43:02 +00:00
Lloyd
e8afa79114 Refactor packet handling in pyMC Repeater
- Updated dependency for pymc_core to use the feat/valid-packets-checks branch.
- Removed neighbor tracking logic from RepeaterHandler and moved it to AdvertHelper.
- Introduced PacketPipeline for centralized packet processing, ensuring all packets flow through repeater logic.
- Created handler helpers: TraceHelper, DiscoveryHelper, and AdvertHelper for better modularity.
- Implemented asynchronous processing of advertisement packets and discovery requests.
- Enhanced logging for better traceability and debugging.
- Cleaned up unused code and improved overall structure for maintainability.
2025-12-01 15:13:23 +00:00
Lloyd
da1d4e9700 Merge pull request #24 from rightup/feat/advert-dedupe
feat: add caching for known neighbors in RepeaterHandler to improve perf
2025-11-27 07:31:36 -08:00
Lloyd
2a5293e2e7 fix: improve error message for max path size and add check for do-not-retransmit packets 2025-11-27 15:29:45 +00:00
Lloyd
08dbcf696b feat: add caching for known neighbors in RepeaterHandler to improve performance and dedupe adverts. 2025-11-25 22:51:30 +00:00
Lloyd
bdc38c5307 fix: standardize packet hash casing to uppercase in RepeaterHandler and RepeaterDaemon 2025-11-24 09:58:13 +00:00
Lloyd
2137e6a1c6 Refactor code structure for improved readability and maintainability 2025-11-22 22:07:46 +00:00
Lloyd
2495f08ab9 Add favicon and index.html for pyMC Repeater Dashboard
- Introduced a favicon.ico file for the application.
- Created index.html with basic structure, including meta tags, links to Google Fonts, and references to JavaScript and CSS assets for the dashboard.
2025-11-22 13:33:19 +00:00