Commit Graph

448 Commits

Author SHA1 Message Date
Shaun Walker e3762fcb9b Update config.py 2026-02-23 20:20:50 +10:00
Shaun Walker 96caad502b Correct merge issue with_parse_int
Updated SPI configuration to parse bus, cs, and cs_pin as integers.
2026-02-23 09:47:56 +10:00
Shaun Walker 96a5634309 Merge branch 'feat/newRadios' into dev 2026-02-22 21:45:22 +10:00
agessaman f1a944222f Update login, path and req response types.
- Simplified KISS modem setup instructions in README.md by removing unnecessary details.
- Refactored ConfigManager in config_manager.py to improve code clarity and efficiency, including changes to the save_to_file method and live_update_daemon method.
- Updated logging and error handling for better debugging and maintenance.
- Adjusted method signatures for consistency and clarity across the ConfigManager class.
- Modified device_version in frame_server.py to use FIRMWARE_VER_CODE from pyMC_core for better version management.
- Enhanced login.py and protocol_request.py with additional payload type handling and logging improvements.
- Cleaned up auth_endpoints.py for better readability and consistency in response formatting.
2026-02-21 21:19:22 -08:00
agessaman e9841adeff Merge upstream feat/newRadios (radios, MQTT, SPI)
- Take upstream radio-presets.json and radio-settings.json (Femtofox, AIO v2, CH341).
- config.py: upstream get_radio_for_board (_parse_int, sx1262_ch341, GPIO) + re-add KISS branch.
- config.yaml.example: upstream radio/ch341 + our identities.companions.
- manage.sh: upstream SPI warning prompt.
- main.py: single try/finally with companion shutdown and _shutdown().
- letsmesh_handler: upstream UTC fallback and MQTT v5 reason code handling.
- storage_collector, api_endpoints: upstream storage_dir_cfg; apply_setup_wizard supports KISS and sx1262_ch341/ch341.
- airtime.py: upstream bw_hz fix for symbol time.
- pyproject.toml: keep pymc_core dependency (no git pin).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 15:59:01 -08: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 05b839890c Merge pull request #99 from interlock/patch-1
Added radio setting for the AIO v2 for uConsole
2026-02-21 21:29:22 +00:00
June S 88221340cc Added radio setting for the AIO v2 for uConsole
AIO v2 for the uconsole requires two settings to work correctly
2026-02-20 21:50:24 -08:00
agessaman 22e337a707 Add CompanionAPIEndpoints integration in APIEndpoints class
- Introduced CompanionAPIEndpoints to handle routes under /api/companion/*.
- Enhanced the APIEndpoints class to create a nested companion object for improved modularity and organization of companion-related API functionality.
2026-02-15 22:10:23 -08:00
agessaman a3f96962ff Refactor advert frame handling in CompanionFrameServer
- Improved the `_build_advert_push_frames` function to handle optional fields and ensure thread safety.
- Enhanced the `on_advert_received` method to robustly process incoming contact data, including better handling of public keys and optional fields for advert details.
- Added error handling to log exceptions during advert processing, improving reliability.
2026-02-15 19:33:04 -08:00
agessaman c07d24d387 Fix frame building functionality for advert push in CompanionFrameServer
- Introduced a new method `_build_advert_push_frames` to construct short and full advert frames from provided data.
- Refactored the handling of contact data to build and send advert frames asynchronously, improving performance and thread safety.
- Enhanced data structure for advert frame construction, including optional fields for full advert details.
2026-02-14 21:07:18 -08:00
agessaman 2360660a6b fix message persistence in CompanionFrameServer to use async I/O
- Changed `_persist_companion_message` to an asynchronous method to prevent blocking the event loop during SQLite operations.
- Updated calls to `_persist_companion_message` in message handling functions to use `await`.
- Enhanced error handling to include `BrokenPipeError` alongside `ConnectionResetError` for improved robustness.
2026-02-14 20:58:01 -08:00
agessaman d5cabe831c Fix message persistence and deduplication in CompanionFrameServer
- Updated `_persist_companion_message` to clarify deduplication of messages in SQLite.
- Modified `on_message_received` and `on_channel_message_received` to include `packet_hash` for message identification.
- Enhanced `SQLiteHandler` to support deduplication by `packet_hash` when pushing messages, preventing duplicates in the database.
- Added `packet_hash` column to the `companion_messages` table and created an index for efficient lookups.
2026-02-14 20:53:25 -08:00
agessaman 49f412acb0 Enhance control data delivery and discovery handling
- Added a new method `deliver_control_data` in `RepeaterDaemon` to push CONTROL payloads to companion clients.
- Updated `PacketRouter` to invoke the new delivery method for control data packets.
- Introduced `push_control_data` in `CompanionFrameServer` to handle the sending of control data to clients.
- Enhanced `DiscoveryHelper` to support optional debug logging for control handling.

These changes improve the communication and control flow between the repeater and companion clients, facilitating better discovery response handling.
2026-02-14 20:24:00 -08:00
agessaman c0dec9e80a Implement companion client communication and statistics retrieval
- Added raw RX and trace completion handlers to push data to connected companion clients.
- Enhanced PacketRouter to deliver ACK packets to all companion bridges.
- Introduced methods for retrieving companion statistics based on different types.
- Updated constants for handling new commands and responses in the companion protocol.

This update improves the interaction between the repeater and companion clients, enabling better data flow and monitoring capabilities.
2026-02-13 22:26:05 -08:00
agessaman 15299bf374 Add companion module and API integration
- Add repeater/companion with frame server and constants
- Extend config, sqlite_handler, mesh_cli, packet_router for companion
- Update api_endpoints and auth_endpoints; adjust main entry

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 16:07:43 -08:00
Lloyd f1a81e1732 Add optional GPIO parameters to get_radio_for_board function 2026-02-12 16:39:39 +00:00
Shaun Walker c2199c8a71 Merge branch 'dev' into dev 2026-02-12 20:58:14 +10:00
theshaun 9acba65242 Update Femtofox configs 2026-02-12 20:57:27 +10:00
Lloyd 0465450dbf Fix integer conversion by stripping trailing commas in get_radio_for_board function 2026-02-11 11:57:27 +00:00
Lloyd f50b571b86 Refactor SPI configuration parsing to ensure integer values are correctly processed 2026-02-11 11:54:01 +00:00
Lloyd b799a286c2 Enhance SPI check during installation with user prompts for continuation without SPI 2026-02-11 10:53:05 +00:00
Lloyd bc23001cd6 Enhance MQTT error handling with extended v5 error codes and improved logging 2026-02-11 09:34:56 +00:00
Lloyd ded15ea43d Fix bandwidth calculation in calculate_airtime method for accurate airtime estimation 2026-02-08 09:44:20 +00:00
Lloyd 3e47122dae Merge pull request #86 from mattzzw/main 2026-02-07 15:37:08 +00:00
Matthias Wientapper 1083fd9865 README.md: Add HT-RA62 module configuration 2026-02-07 16:30:22 +01:00
agessaman 9eb2b8a50f Add data directory to .gitignore and include rrdtool dependency in pyproject.toml 2026-02-03 16:54:41 -08:00
agessaman f2badfa0cb Remove repeater database file from the project. 2026-02-03 16:23:01 -08:00
agessaman 878ff8dc51 Enhance configuration and setup for KISS modem support
- Added support for Meshcore KISS modem firmware in configuration, allowing users to set `radio_type: kiss` and configure serial port and baud rate.
- Updated `config.yaml.example` to include KISS modem settings.
- Modified `manage.sh` to install with hardware extras for KISS support.
- Enhanced `setup-radio-config.sh` to prompt for radio type and KISS modem settings.
- Updated API endpoints to handle KISS modem configurations and hardware options.
- Improved error handling for missing configuration sections.

This update improves flexibility for users utilizing KISS modems alongside SX1262 hardware.
2026-02-03 16:20:51 -08:00
theshaun 57a25a2dc0 Add support for Femtofox
- Introduce GPIO chip selection and GPIO backend selection
- Add default Femtofox settings (for SX1262 as LR1121 support may come later)
- Add support for Python 3.10 UTC to reduce footprint
- Fix airtime calculation bandwidth variable naming
- Add service auto-enable when starting
- Add Australia: SA, WA, QLD radio preset
- Add Snyk security instructions

Co-authored-by: theshaun <theshaun@users.noreply.github.com>
Based on PR #69
2026-02-03 22:34:14 +00:00
Lloyd f7c4e2b4a8 Add support for new radio hardware configurations and CH341 USB adapter 2026-02-03 22:28:53 +00:00
Lloyd 076d87dcde Merge pull request #80 from dmduran12/feature/bulk-packets-gzip 2026-02-03 19:37:44 +00:00
dmduran12 d28a966e2e Enable gzip compression for bulk_packets endpoint
Reduces payload size for large packet downloads, improving performance
on slow network connections.

Co-Authored-By: Warp <agent@warp.dev>
2026-02-03 11:35:02 -08:00
Lloyd 22c6521fd6 Merge pull request #79 from dmduran12/feature/bulk-packets-timestamp-filter 2026-02-03 19:13:03 +00:00
dmduran12 047b983497 Add timestamp filtering to bulk_packets endpoint
Add start_timestamp and end_timestamp parameters to the bulk_packets API
endpoint to allow time-range filtering for bulk packet retrieval.

Co-Authored-By: Warp <agent@warp.dev>
2026-02-03 11:03:05 -08:00
Lloyd b0e19b13af Add bulk packet retrieval API with gzip compression and pagination support. 2026-02-03 10:21:59 +00:00
Lloyd 3adfee5160 Disable Gzip compression for HTTPStatsServer configuration 2026-02-03 08:34:23 +00:00
Lloyd 04ae4c9bf0 Update dependencies in control file and enhance postinst script for PyPI package installations 2026-02-02 10:49:54 +00:00
Lloyd 9256ba9c35 Remove force-reinstall option from pip install command in install_repeater function 2026-02-02 10:44:39 +00:00
Lloyd adbdc5e3a4 Disable Gzip compression for WebSocket endpoint 2026-02-01 22:53:03 +00:00
Lloyd 7103103cf7 Enable Gzip compression for HTTP responses 2026-02-01 22:36:37 +00:00
theshaun d54269fbc5 Add enabled check for when pymc_repeater is installed by default but not enabled (femtofox) 2026-02-01 16:58:04 +10:00
theshaun a7a3532e1b Slight refactor as bw_khz isnt really reused.
This resolves airtime issue if SF is 11 or higher
2026-02-01 13:51:50 +10:00
theshaun e0168cd4df temp fix for airtime till sync from upstream 2026-02-01 13:45:37 +10:00
theshaun df6da8e2b8 Update radio settings for femtofox stating 1w 2026-01-31 17:16:12 +10:00
theshaun d6178ca4f7 - Rename Australia: Victoria to Australia (Narrow)
- Add Australia: SA, WA, QLD
2026-01-31 16:10:28 +10:00
theshaun 80548e9805 temp change to support testing femtofox build 2026-01-31 11:09:43 +10:00
Lloyd 612fc82b34 SPI check for universal compatibility. 2026-01-30 15:14:24 +00:00