Commit Graph

422 Commits

Author SHA1 Message Date
agessaman 985e0c829f Add companion identity handling and statistics tracking for ACL endpoints. 2026-03-12 20:57:13 -07:00
agessaman 9326868f6e Implement contact import functionality for companions
- Added `companion_import_repeater_contacts` method in `SQLiteHandler` to import repeater adverts into a companion's contact store, with options for filtering by contact types, last seen hours, and import limits.
- Introduced `_get_sqlite_handler` method in `CompanionAPIEndpoints` to ensure the SQLite handler is available for contact import operations.
- Created `import_repeater_contacts` endpoint to handle POST requests for importing contacts, validating input parameters, and returning the count of successfully imported contacts.
- Updated the frontend to reflect changes in the contact import process, ensuring a seamless user experience.
2026-03-12 15:39:04 -07: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
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
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
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
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
Adam Gessaman 75657ac1b1 Merge pull request #1 from agessaman/dev-companion-v2-cleanup-multibyte-paths
Enhance RepeaterHandler with multi-byte hash support and identity updates
2026-03-05 16:34:40 -08:00
agessaman a6170f70ed Add public key to identity details and enhance companion configuration handling
- Updated IdentityManager to include public key in identity details when retrieving identities.
- Introduced a new method in RepeaterDaemon for adding companions from configuration, supporting hot-reload functionality.
- Enhanced error handling for companion registration, ensuring proper validation of identity keys and settings.
- Updated API endpoints to include configured companions in the response, improving visibility of companion status and configuration.
2026-03-05 16:26:50 -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 c54efa3412 add side bar display of advert blocks etc 2026-03-05 12:56:01 +00:00
Lloyd 2b7d394938 add logging for tracking advert blocking 2026-03-05 11:26:40 +00:00
Lloyd 7eeba4d569 add debugs to advert settings 2026-03-05 11:13:44 +00:00
Lloyd 7dccb7457f Add advertisement configuration options for rate limiting and adaptive settings 2026-03-05 11:12:28 +00:00
Lloyd d5e1b0e714 update stats display 2026-03-05 10:53:34 +00:00
Lloyd 998955ec52 Update minimum advertisement interval to 0 for improved mesh retransmission handling 2026-03-05 10:46:24 +00:00
Lloyd 6a52268b8c Disabl as default advertisement rate limiting and adaptive scaling features in configuration 2026-03-05 10:39:35 +00:00
Lloyd 4285023670 Implement adaptive advert rate limiting and configuration updates 2026-03-05 10:35:15 +00:00
Lloyd dd81bf94a9 log display in management script with styled output and color-coded messages 2026-03-04 12:43:24 +00:00
agessaman 1fbd99d52c Add JSON serialization support for companion preferences
- Introduced a new utility function, _to_json_safe, to ensure companion preferences are JSON-serializable, handling various data types including enums and dataclasses.
- Updated the RepeaterCompanionBridge to use the new serialization method when saving preferences to SQLite.
- Modified SQLiteHandler to ensure companion_hash is consistently converted to a string before database operations.
- Enhanced error handling for preference persistence in the RepeaterCompanionBridge.
2026-03-03 16:20:52 -08:00
Lloyd a0cd83a679 Merge pull request #116 from migillett/feature/docker-support
Feature/docker support
2026-03-03 14:01:21 +00:00
Lloyd 2dc39ce206 Merge pull request #117 from zindello/feat/addUltraPeaterBoards
Feat/add ultra peater boards
2026-03-03 13:56:17 +00:00
Joshua Mesilane 1a645bdbc7 Switching to adding a new preset instead of changing the existing one to prevent arguments 2026-03-03 20:24:01 +11:00
Joshua Mesilane 6c02617729 Adding in Zindello Industries UltraPeater boards pre-release 2026-03-03 20:08:25 +11:00
agessaman 4f94b343cc Modify CompanionBridge integration to support persisting NodePrefs
- Added new methods to SQLiteHandler for loading and saving companion preferences as JSON, improving data persistence.
- Introduced a migration to create a companion_prefs table for storing preferences, ensuring compatibility with existing data.
- Refactored main.py to utilize RepeaterCompanionBridge instead of CompanionBridge, aligning with the new architecture.
2026-03-02 21:28:15 -08:00
Michael Gillett 047f60f416 Merge branch 'rightup:main' into feature/docker-support 2026-03-02 22:45:47 -05:00
Michael Gillett 9ac6630128 Clarify Docker usage instructions in README
Updated wording for clarity in Docker section.
2026-03-02 11:47:22 -05:00
agessaman e54d79d7c2 Refactor message handling in CompanionFrameServer to use a dedicated frame building method
- Removed redundant code for building message frames based on message type.
- Introduced a new method, _build_message_frame, to streamline the process of constructing message frames, improving code readability and maintainability.
2026-03-02 07:52:36 -08:00
Lloyd 1f14dcd9fc Ui Chnages for CRC display 2026-03-02 13:53:46 +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
Michael Gillett 908b1c39db instructions for config.yaml
rework of docker

its ALIVE

disable :ro tag for config.yaml

leave empty line

lets open ports instead of network mode host

run as current user

run as user

nevermind

update readme with instructions

relocate docker section
2026-03-01 21:44:32 -05:00
Michael Gillett d24bcb1f43 starting work on a docker build 2026-03-01 21:44:17 -05:00
Lloyd 0967f899a1 Merge pull request #115 from yellowcooln/feat/newRadios
Make CLI upgrade/start/stop/restart silent by default, keep menu dialogs
2026-03-01 22:12:53 +00:00
yellowcooln 34334c68da Make CLI actions silent while keeping menu dialogs 2026-03-01 17:02:02 -05:00
agessaman d82ebc59b0 Normalize companion_hash format in SQLite migrations to include 0x prefix
- Updated the SQLiteHandler to apply a migration that prefixes companion_hash values with '0x' for consistency with room_hash patterns.
- Adjusted the main.py file to reflect the new formatting for companion_hash when generating its string representation.
2026-02-28 09:06:24 -08:00
agessaman d5fe1e637c Restore deleted AdvertHelper. 2026-02-27 22:18:56 -08:00
agessaman 6fa85a832f Update packet type labels in rrdtool_handler and sqlite_handler for consistency
- Enhanced readability by adding descriptive suffixes to packet type labels in both rrdtool_handler.py and sqlite_handler.py.
- Aligned packet type definitions with the new naming conventions from pyMC_core, ensuring consistency across the codebase.
2026-02-27 21:18:29 -08:00
Lloyd b0158c7682 Merge pull request #106 from MSmithDev/patch-3 2026-02-27 07:12:29 +00:00
Matt 6ebce7d93b PiMesh V2 Change cs_pin value from 8 to -1 in radio settings
Switched to using native SPI CS
2026-02-26 13:35:25 -05:00
Adam Gessaman c78133f175 Refactor CompanionFrameServer for non-blocking message synchronization
- Changed the _get_companion_stats method to be asynchronous, improving responsiveness.
- Added a new async method _cmd_sync_next_message to handle message synchronization without blocking the event loop, enhancing performance during message processing.
- Introduced constants for response codes to streamline message handling in the CompanionFrameServer.
2026-02-25 15:39:18 -08:00
agessaman 789a2f27ea Enhance PacketRouter and CompanionFrameServer for improved packet delivery and contact persistence
- Updated PacketRouter to deliver packets to all companion bridges when the destination is not recognized, ensuring better handling of ephemeral destinations.
- Refactored CompanionFrameServer to separate contact serialization and persistence logic, allowing for non-blocking database operations.
- Introduced a unique index for companion contacts in SQLite to support upsert functionality, enhancing data integrity and performance.
- Improved AdvertHelper to run database operations in a separate thread, preventing event loop blocking and maintaining responsiveness.
2026-02-24 21:51:56 -08:00