Commit Graph

49 Commits

Author SHA1 Message Date
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
Lloyd 9da12d6082 feat: implement transport code validation with caching for flood forwarding 2025-11-21 16:54:59 +00:00
Lloyd 08d4e054b0 clean up code formatting and improve readability in letsmesh_handler and storage_collector 2025-11-20 10:11:06 +00:00
Lloyd 38569d029e log trace packet storage 2025-11-19 12:24:44 +00:00
Lloyd 3a2466f953 refactor LetsMesh handler initialization and add live stats support 2025-11-19 11:28:00 +00:00
Lloyd 8ef2d3997d feat: update raw packet handling in StorageCollector and RepeaterHandler 2025-11-18 23:05:34 +00:00
Lloyd 306beea7a0 feat: add LetsMesh configuration and handler integration in StorageCollector 2025-11-18 22:23:09 +00:00
Lloyd f8661a2c10 Implement data acquisition module with SQLite, RRDTool, and MQTT handlers
- Added `SQLiteHandler` for managing packet and advert storage in SQLite database.
- Implemented `RRDToolHandler` for creating and updating RRD databases for metrics.
- Developed `MQTTHandler` for publishing data to MQTT broker.
- Created `StorageCollector` to integrate SQLite, RRDTool, and MQTT functionalities.
- Added methods for recording packets, adverts, and noise floor data.
- Implemented data retrieval methods for packet statistics, recent packets, and noise floor history.
- Established database schema with appropriate tables and indices for efficient data access.
- Included error handling and logging for database operations and MQTT communications.
2025-11-10 10:26:24 +00:00
Lloyd c58330aff5 feat: add noise floor monitoring with history, stats, and chart data endpoints 2025-11-07 16:17:01 +00:00
Lloyd 3f092e3b39 Add StorageCollector class for packet and advert management
- Refactored main.py to import HTTPStatsServer from the new path.
- Introduced storage.py to handle SQLite database for packets and adverts.
- Implemented methods for initializing SQLite, RRD, and MQTT.
- Added functionality to record packets and adverts, including storage and metrics updates.
- Created methods for retrieving packet statistics, recent packets, and filtered packets.
- Implemented RRD data fetching and packet type statistics.
- Added cleanup method for old data in the database.
2025-11-07 13:23:44 +00:00
Lloyd 4a9aa89042 UI with new dialog for displaying packet information 2025-11-04 22:13:22 +00:00
Lloyd 2564f4b772 Fix formatting in log messages and debug statements for consistency 2025-10-31 08:51:31 +00:00
Lloyd 85df2c5b0f Implement trace packet logging and SNR display enhancements 2025-10-30 00:11:04 +00:00
Lloyd 511321bb98 Add noise floor measurement feature and update dashboard display 2025-10-27 21:01:34 +00:00
Lloyd 71a429ebca Refactor packet handling: replace custom hash function with built-in packet hash method and clean up unused code 2025-10-27 12:45:30 +00:00
Lloyd 97256eb132 Initial commit: PyMC Repeater Daemon
This commit sets up the initial project structure for the PyMC Repeater Daemon.
It includes base configuration files, dependency definitions, and scaffolding
for the main daemon service responsible for handling PyMC repeating operations.
2025-10-24 23:13:48 +01:00