Commit Graph

227 Commits

Author SHA1 Message Date
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
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
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
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
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 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
Lloyd 0d14884adb broker connection management with JWT reconnection scheduling and error handling 2026-01-23 14:47:29 +00:00
Lloyd d28ddcc34c reorganize hardware configuration for sx1262 settings 2026-01-22 13:29:05 +00:00
Lloyd 267b8e2a1c fix setup fields 2026-01-22 13:10:07 +00:00
Lloyd 5e4adf62b3 add ed auth to WS 2026-01-20 21:53:24 +00:00
Lloyd 8b95bfb8ba feat: enhance MQTT error handling and add packet stats broadcasting 2026-01-20 20:31:45 +00:00
Lloyd 33e353d215 fix: update reconnection logic to refresh JWT token before connecting 2026-01-19 12:41:54 +00:00
Lloyd 371b9fdbb8 fix: update airtime calculations to use config values in AirtimeManager 2026-01-19 11:52:23 +00:00
dmduran12 64100d6311 fix: use correct Semtech LoRa airtime formula
Replace simplified airtime calculation with the proper Semtech reference
formula that accounts for:
- Coding rate (CR)
- CRC overhead
- Explicit/implicit header mode
- Low data rate optimization (SF11/SF12 at 125kHz)

The previous formula significantly underestimated airtime, especially
at higher spreading factors, leading to inaccurate duty cycle tracking.

Reference: https://www.semtech.com/design-support/lora-calculator

Co-Authored-By: Warp <agent@warp.dev>
2026-01-18 17:16:21 -08:00
Lloyd f6a4e0f861 simplify PacketTable rendering and system stats update logic 2026-01-18 22:39:13 +00:00
Lloyd 86ab778aeb fix datarange in NF 2026-01-18 21:27:35 +00:00
Lloyd a7fe30b2c3 up date to stats card 2026-01-18 20:56:43 +00:00
Lloyd 599e4628d9 Changes include:
Features

Neighbour details modal with full info and map view

WebSocket support with heartbeat and automatic reconnection

Improved signal quality calculations (SNR-based RSSI)

Route-based pagination for faster initial loads

UI

Mobile sidebar tweaks (logout, version info, lazy-loaded charts)

Sorting added to the neighbour table

Packet view now shows multi-hop paths

CAD calibration charts respect light/dark themes

Statistics charts now show the full requested time range

Performance

Reduced polling when WebSocket is active

Lazy loading for heavier components

Noise floor data capped to keep charts responsive

Technical

Improved type safety across API responses

Contrast improvements for accessibility

Cleaner WebSocket and MQTT reconnection handling

Additional metrics added to heartbeat stats

Bug fixes

Corrected noise floor history query

Fixed authentication for CAD calibration streams

Nothing major required from users — just update and carry on.
As always, shout if something looks off.
2026-01-18 20:15:50 +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
Lloyd 4f22cb1308 Convert public key to uppercase when retrieving from local identity 2026-01-09 17:24:10 +00:00
Lloyd 7bd5b6f13d Add UTF-8 validation for node name length and improve hardware file loading logic 2026-01-09 16:44:05 +00:00
Lloyd d7a886d0e5 Update file paths for radio settings and presets to use config-based directory 2026-01-09 12:14:38 +00:00
Lloyd 0baddc1416 Fix casing for Zebra configuration and add use_dio2_rf setting 2026-01-09 10:26:52 +00:00
Lloyd 1a527c761f feat: Refactor LetsMesh handler to use LocalIdentity for key management 2026-01-08 09:11:45 +00:00
Lloyd 1b45060e13 Update key retrieval method in StorageCollector to support both standard and firmware keys 2026-01-08 08:52:02 +00:00
Lloyd 4011a6b25e Add light mode to ui 2026-01-07 23:05:54 +00:00
Lloyd 32ce1ff698 Add configurable JWT token expiry and WebSocket transport support for MQTT 2026-01-05 16:50:15 +00:00
Lloyd 3011706102 feat: Update hardware and presets file loading to check installed location first 2026-01-05 10:57:40 +00:00
Lloyd dfe4adad1c feat: Enhance MQTT configuration with TLS/SSL support and update logging 2026-01-05 10:47:14 +00:00
Lloyd 0e8df60764 HTTPStatsServer to use SQLiteHandler for token management 2026-01-05 10:04:26 +00:00
Paul Picazo 9288e070aa fix: Add missing Dict, Any import to sqlite_handler.py 2026-01-03 14:47:37 -08: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 75c4967bd6 feat: Add authentication handlers to HTTPStatsServer configuration 2026-01-02 17:23:21 +00:00
Lloyd 8d14b93874 feat: Update HTML directory configuration to handle missing web_path gracefully 2026-01-02 16:39:14 +00:00
Lloyd 8b8edb9929 add pymc console endpoints and ui 2026-01-02 16:35:18 +00:00
Lloyd 7d4a779939 feat: Enhance filtered_packets endpoint to support additional query parameters for improved packet filtering 2026-01-02 11:01:01 +00:00