516 Commits

Author SHA1 Message Date
Rightup 291c1a6ed9 fix:update statics for companion ui fix 2026-06-09 22:26:36 +01:00
Yellowcooln 063c8eeb8c Fix companion identity OpenAPI contract 2026-06-09 15:50:09 -04:00
Lloyd 99a04295da Merge pull request #287 from agessaman/kiss/tuning-options 2026-06-09 19:33:47 +01:00
Lloyd 2b7b2b5b4e feat:add channel sender option to policy 2026-06-09 13:51:18 +01:00
Lloyd eb717cc745 fix:update ui clean up and add change password. 2026-06-09 11:54:46 +01:00
agessaman 183650228e feat(config): add optional KISS CSMA tuning parameters
- Updated `config.yaml.example` to include optional KISS key-up and CSMA tuning parameters.
- Enhanced `get_radio_for_board` function in `config.py` to forward KISS tuning settings to the modem firmware when specified.
- Added tests to verify correct forwarding of KISS parameters and omission of unset values in `test_radio_config.py`.
2026-06-08 21:25:26 -07:00
Lloyd 00682e8086 Merge pull request #282 from agessaman/companion/advanced-settings 2026-06-06 18:09:00 +01:00
agessaman f3146ebc14 fix(companion): clean up ruff errors 2026-06-06 09:44:55 -07:00
agessaman ea6e660f34 refactor(api_endpoints): improve sqlite_handler retrieval logic
- Updated the logic for retrieving the sqlite_handler in APIEndpoints to use a safer approach with getattr, ensuring compatibility with the daemon_instance.
- Adjusted test case to include an additional parameter in the sqlite.companion_push_message assertion for consistency.
2026-06-06 09:39:30 -07:00
agessaman dac60443f0 feat(companion): implement contact trimming and retention policies
- Introduced `enforce_companion_contact_capacity` to manage contact limits during companion loading, with an option to trim non-favourite contacts when exceeding capacity.
- Updated `SQLiteHandler` to support message retention limits, allowing for automatic trimming of older messages based on `offline_queue_size`.
- Enhanced API endpoints to handle contact trimming on overflow, providing feedback on trimmed contacts during updates.
- Added utility functions for selecting and trimming contacts while preserving favourites.
- Improved logging for contact management actions and errors related to capacity.
2026-06-05 21:39:11 -07:00
Lloyd af603d78d0 feat:new menu change 2026-06-05 16:38:29 +01:00
Lloyd b3119f97f4 Merge branch 'pr-281' into dev 2026-06-05 16:25:15 +01:00
Lloyd da95c67cef fix: improve error logging for invalid policy entries and adjust test configuration 2026-06-05 16:23:18 +01:00
Yellowcooln b5b2c60eb6 Update MQTT host and audience to meshmapper.net 2026-06-05 11:06:02 -04:00
Lloyd e9a9f21cab feat: update preamble_length to 32 for radio configurations 2026-06-05 16:00:23 +01:00
Rightup 225feda195 feat:ui for policy and logging update 2026-06-04 16:27:35 +01:00
Rightup 14b4804c26 feat: Enhance logging system and introduce policy management endpoints
- Updated LogBuffer to support log entry IDs, enhanced log entry structure with additional metadata, and implemented subscriber management for real-time log streaming.
- Added OpenAPI specifications for new endpoints related to policy management, including retrieval, updating, validation, and group management for network policies.
- Implemented comprehensive tests for new policy endpoints, ensuring correct behavior for creating, updating, validating, and deleting policy groups and entries.
- Introduced policy evaluation tests to validate the functionality of the PolicyEngine, including various scenarios for action decisions based on defined rules.
- Enhanced packet routing tests to ensure proper handling of policy decisions in packet processing.
2026-06-04 15:53:17 +01:00
agessaman 7fe1b19241 fix: update packet injector to include origin hash for companion bridge 2026-06-02 20:52:22 -07:00
agessaman 499f871262 Merge upstream/dev into companion/advanced-settings
Integrate latest dev while preserving per-companion bridge settings
and contact capacity validation. Resolve import conflicts in main.py
and api_endpoints.py.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:34:52 -07:00
Adam Gessaman 7d57b34a04 feat(companion): enhance contact capacity management and bridge settings
- Introduced `CompanionContactCapacityError` to handle cases where persisted contacts exceed configured limits.
- Added utility functions for parsing companion bridge settings and validating contact capacity.
- Updated `RepeaterDaemon` to check contact capacity during companion loading and initialization.
- Enhanced API endpoints to validate companion settings and manage contact limits effectively.
- Implemented logging for bridge limits and errors related to contact capacity.
2026-06-02 07:42:40 -07:00
Lloyd cd7058be99 fix: update packet router debugs for less noise and policy prep for advanced filters works 2026-06-02 12:18:17 +01:00
Lloyd 416310befd refactor: improve code readability 2026-06-02 10:31:47 +01:00
Lloyd d7e74e0a89 Merge pull request #278 from agessaman/feat/pre-1160-compatibility-sendfix
Feat/pre 1160 compatibility sendfix
2026-06-02 10:26:22 +01:00
agessaman e24cdca055 feat(companion): echo injected TX to companion clients as raw RX (0x88)
Push locally-injected TX packets to connected companion frame server
clients as PUSH_CODE_LOG_RX_DATA (0x88) with snr=0/rssi=0, so apps that
decrypt locally from raw RX (e.g. RemoteTerm) see companion-originated
channel traffic. The originating companion is excluded so a node never
hears its own transmission, matching physical firmware behavior.
inject_packet now takes an origin_hash (threaded per-companion via the
packet_injector partial); _on_raw_rx_for_companions gains exclude_hash
to skip that companion's frame server. OTA RX is unaffected.
2026-06-01 17:05:38 -07:00
Lloyd 2cacb7cfc0 Merge pull request #276 from pyMC-dev/feat-open-api
Feat open api updates
2026-05-31 10:08:03 +01:00
Lloyd 9e1dabddbf feat: add PUT endpoint for updating transport keys in OpenAPI specification 2026-05-31 10:03:39 +01:00
agessaman 5a9e1c87cc Merge branch 'fix/companion-message-send' into feat/pre-1160-compatibility-sendfix
Bring in companion transmission handling improvements from RepeaterHandler.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 21:42:26 -07:00
agessaman 778adb6917 feat: implement randomized response jitter in DiscoveryHelper to prevent packet collisions
- Added a default upper bound for randomized pre-send jitter in discovery responses to avoid collisions when multiple repeaters respond simultaneously.
- Introduced a new parameter `response_jitter_ms` in the `DiscoveryHelper` constructor to configure the jitter.
- Updated the `_send_packet_async` method to apply the jitter before sending responses.
- Added tests to verify the correct application of jitter and ensure functionality when jitter is disabled.
2026-05-30 18:07:23 -07:00
agessaman 5fcb6255d5 feat: enhance login handler with anonymous request support and region name formatting
- Updated the `LoginHelper` class to wrap the login handler in an `AnonRequestHandler`, allowing for proper handling of anonymous requests.
- Introduced methods for formatting region names based on flood policies and added support for retrieving transport keys from SQLite storage.
- Enhanced the constructor to accept additional parameters for SQLite handler and configuration, improving flexibility for owner-info and feature-flag replies.
- Added tests to validate the new functionality and ensure correct behavior of region name formatting and owner/features callbacks.
2026-05-30 16:19:52 -07:00
agessaman 6295f0fce1 feat: add utility function to restore bytes from JSON and enhance prefs handling in RepeaterCompanionBridge
- Introduced `_prefs_bytes_from_json` to convert JSON hex strings back to bytes for NodePrefs fields.
- Updated `_load_prefs` logic to handle bytes conversion when loading preferences.
- Improved the handling of preferences in the `RepeaterCompanionBridge` class to ensure proper type restoration.
2026-05-30 09:12:45 -07:00
Lloyd d1dc57cc58 feat: add OpenAPI contract check script and integrate into pre-commit hooks 2026-05-28 12:02:45 +01:00
Lloyd 0f6a7dc053 feat: support 64-byte identity keys in identity validation and tests 2026-05-28 10:29:35 +01:00
Rightup 60ca184dbd refactor: enhance security comments and error handling across multiple modules 2026-05-27 22:07:34 +01:00
Lloyd 0c33483947 refactor: clean up import statements and whitespace in local_cli, base, and update_endpoints modules 2026-05-27 20:16:23 +01:00
Lloyd 45a44eb47b Refactor test cases and base code for consistency and readability
- Updated byte representations in tests to use lowercase hex format for consistency.
- Reformatted code for better readability, including line breaks and indentation adjustments.
- Consolidated multiple lines into single lines where appropriate to enhance clarity.
- Ensured that all test cases maintain consistent formatting and style across the test suite.
2026-05-27 20:15:10 +01:00
Lloyd 62f35c4b45 fix: update transport key generation to use 16-byte length and add corresponding test 2026-05-27 14:27:59 +01:00
Zindello d597ab2ea8 fix: replace datetime.UTC attribute access in repeater_cli
Also extend the compat scanner to catch datetime.UTC used as an
attribute (datetime.datetime.now(datetime.UTC)) in addition to
direct imports, so this form cannot be reintroduced undetected.

Co-Authored-By: Zindello <josh@zindello.com.au>
2026-05-27 12:16:56 +10:00
Zindello a1c66100f5 fix: remove datetime.UTC from mqtt_handler and add 3.10 compat test
Replace the try/except UTC shim in mqtt_handler.py with timezone.utc
directly, consistent with the api_endpoints.py fix. Add a static AST
scan that fails if datetime.UTC is reintroduced anywhere in the codebase,
guarding against future regressions on Python 3.10 (LuckFox Pico Ultra).

Co-Authored-By: Zindello <josh@zindello.com.au>
2026-05-27 11:57:45 +10:00
Zindello 9fe0142fa5 fix: replace datetime.UTC with timezone.utc for Python 3.10 compat
datetime.UTC was introduced in Python 3.11. timezone.utc is available
since Python 3.2 and is functionally identical.

Co-Authored-By: Zindello <josh@zindello.com.au>
2026-05-27 11:03:15 +10:00
Zindello 7db6535a26 fix: Python 3.10 compat for datetime.UTC in api_endpoints
datetime.UTC was added in Python 3.11. Fall back to timezone.utc on
older interpreters, matching the existing pattern in mqtt_handler.py.

Co-Authored-By: Zindello <josh@zindello.com.au>
2026-05-27 09:58:10 +10:00
Lloyd 31edaa9c76 fix: update installation scripts to use the correct branch name 2026-05-26 15:42:59 +01:00
Lloyd 7b86716e06 Add unit tests for HTTP server, main daemon, service utilities, SQLite handler, and update endpoints 2026-05-26 14:59:31 +01:00
Lloyd 37ee0e892a Add more unit tests for handler helpers, identity manager, CLI, key generation, and main functionality
- Introduced tests for TraceHelper and DiscoveryHelper to validate packet forwarding and discovery request handling.
- Implemented tests for LoginHelper to ensure identity registration and login packet processing.
- Added tests for IdentityManager to cover identity registration, lookup, and filtering.
- Created tests for MeshCLI to verify command handling, configuration setting, and error paths.
2026-05-26 13:01:38 +01:00
Lloyd dc317b6568 Merge pull request #261 from CarlsonCustoms/feat/lafvin-ups-3s-sensor
feat: add LAFVIN UPS Module 3S sensor plugin (lafvin_ups_3s)
2026-05-26 08:57:37 +01:00
Rightup ab55748f3f fix: prevent advert echos in the packet table 2026-05-25 20:25:39 +01:00
Zack Carlson e20eaa7f02 feat: add LAFVIN UPS Module 3S sensor plugin (lafvin_ups_3s)
Adds a new sensor type for the LAFVIN UPS Module 3S, an INA219-based
uninterruptible power supply for Raspberry Pi. Reports pack voltage,
current, power, estimated state-of-charge, and charge state for a
3S Li-ion/LiPo battery configuration (9.0–12.6 V range).

The INA219 address defaults to 0x41 (as wired on the LAFVIN board)
and shunt resistance is configurable for accurate current readings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 11:09:47 -07:00
Lloyd 85f282357c feat: expand allowed sections for configuration imports to include additional radio types 2026-05-22 15:19:06 +01:00
Lloyd a48b29837a feat: pre-restart config validation and site identification
- Add pre-restart config preflight to RestartModal with pass/warning/fail result panel and "Restart Anyway" confirmation for warnings
- Add Site Identification (site_name) config field shown as browser title and login page caption
- Add GET /api/validate_config and GET /api/site_info backend endpoints
- Sync document.title with site_name via system store watchEffect
- Fix authRegression.test.ts TS2367 type narrowing error
- add new radio hardware and radio settings tabs
2026-05-22 14:44:15 +01:00
Lloyd 78648f2af9 feat: add site_info endpoint to return site identification name without authentication 2026-05-22 14:35:49 +01:00
Lloyd 2a031b790f feat: add validate_config endpoint to check config.yaml syntax and required settings 2026-05-22 13:59:48 +01:00