Commit Graph

288 Commits

Author SHA1 Message Date
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
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 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
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
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
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
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
4285023670 Implement adaptive advert rate limiting and configuration updates 2026-03-05 10:35:15 +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
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
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
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
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
Lloyd
0df94a0a91 updated convert_firmware_key.sh to support output format options and improve usage instructions; update _load_or_create_identity_key to prioritize system-wide identity key location. 2026-02-24 20:41:15 +00:00
Lloyd
74914541f2 Enhance installation and uninstallation scripts with user-friendly messages, add polkit and sudoers configuration for service management, and improve service restart handling in API endpoints. 2026-02-24 11:33:21 +00:00