Commit Graph

767 Commits

Author SHA1 Message Date
Lloyd 456e97a896 refactor: update pre-commit configuration and dependencies for improved Python 3.9 support 2026-05-27 14:28:11 +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
Lloyd 8eaf24ab35 Merge pull request #266 from zindello/fix/python310-datetime-utc 2026-05-27 07:22:32 +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 36aa8ecf0d Merge pull request #265 from yellowcooln/dev 2026-05-26 20:59:26 +01:00
Yellowcooln 9da8317463 docker: install rrdtool for runtime python 2026-05-26 13:38:47 -04: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 e17d1137ab Merge pull request #259 from pyMC-dev/dev
pyMC_Repeater 1.0.10 updates
2026-05-22 16:09:38 +01:00
Lloyd 85f282357c feat: expand allowed sections for configuration imports to include additional radio types 1.0.10 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
Lloyd 3244f7b9bc feat: add validation for TX power settings and update API endpoint for serial ports 2026-05-22 12:47:02 +01:00
Lloyd 5c687076f1 feat: add endpoint to discover available serial/USB modem device paths 2026-05-22 10:21:07 +01:00
Lloyd 4cf04f87d1 test: sensor tests with mock implementations and additional assertions 2026-05-21 14:23:02 +01:00
Lloyd 22b39e5715 fix: update maintainer information in changelog, control, and build scripts 2026-05-21 12:47:54 +01:00
Lloyd b464fa8593 docs: update example configuration for Waveshare UPS D and E Hats 2026-05-21 12:42:22 +01:00
Lloyd 5b93d1023d fix: update loop detection thresholds and improve path hash handling in API endpoints 2026-05-21 12:29:21 +01:00
Lloyd d25e97af3c feat: implement setup status check and reject subsequent setups after completion 2026-05-21 11:32:08 +01:00
Lloyd 8f3477ddd6 Merge pull request #256 from CarlsonCustoms/add-waveshare-ups-hat-e
Add Waveshare UPS HAT (E) sensor plug-in
2026-05-20 21:35:45 +01:00
Zack Carlson 6e89272bce Add Waveshare UPS HAT (E) sensor plug-in
The HAT (E) uses a dedicated BMS MCU (not an INA219) at I2C address 0x2D.
It exposes charge state, pack voltage/current, per-cell voltages, remaining
capacity in mAh, and time-to-empty/full estimates directly via I2C registers.

Tested on Raspberry Pi 4B with pyMC_Repeater running pymc-battery-writer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 09:25:38 -07:00
Lloyd 22adbd1a84 feat: add setup usb/tcp details on setup 2026-05-19 14:45:26 +01:00
Lloyd 6aab7ec676 fix:update-restart-functions 2026-05-19 11:23:46 +01:00
Lloyd 7d54859348 Add example configurations for SHTC3 and Waveshare UPS Hat sensors 2026-05-19 11:17:12 +01:00
Lloyd cbfcb69c07 Merge pull request #255 from CarlsonCustoms/add-shtc3-waveshare-sensors
Add SHTC3 and Waveshare UPS HAT (D) sensor plug-ins
2026-05-19 11:12:04 +01:00
Zack Carlson f88d3c52be Revert "Add NMEA GPS sensor plug-in"
This reverts commit 8b0607aa1c.
2026-05-18 22:55:05 -07:00
Zack Carlson 8b0607aa1c Add NMEA GPS sensor plug-in
nmea_gps.py reads NMEA 0183 sentences directly from a serial GPS receiver
(/dev/serial0 by default) and exposes fix status, position, motion, accuracy,
and satellite fields as sensor readings.

Parses GGA, RMC, and GSA sentence types using stdlib only (no pynmea2
dependency) — pyserial is already required by the repeater.

Designed for use when the repeater's built-in GPS service is disabled
(gps.enabled: false). Both cannot share the serial port simultaneously.
With gps.api_fallback_to_config_location: true the repeater continues
advertising the manually-configured location while the sensor plugin handles
raw GPS data.

Returns: fix_valid, fix_quality, fix_type, latitude, longitude, altitude_m,
speed_kmh, course_degrees, hdop, pdop, vdop, satellites_used, utc_datetime.
Position and motion fields are null when fix_valid is false to avoid
reporting config-fallback coordinates as real GPS data.

Tested on Raspberry Pi 3B+ (DietPi) with a u-blox GPS module on /dev/serial0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 22:50:17 -07:00
Zack Carlson 9c1661f097 Add SHTC3 and Waveshare UPS HAT (D) sensor plug-ins
- shtc3.py: SHTC3 temperature/humidity sensor (RAK1901 WisBlock module,
  I2C 0x70). Uses smbus2 i2c_rdwr for raw I2C reads since SHTC3 requires
  16-bit command words with no register-byte prefix. Returns temperature_c,
  temperature_f, humidity_pct.

- waveshare_ups_d.py: Waveshare UPS HAT (D) battery monitor via INA219 at
  I2C 0x43. Uses the HAT's actual shunt (0.01 Ω, CAL=26868) rather than the
  generic INA219 defaults. Returns bus_voltage_v, shunt_voltage_mv,
  current_ma, power_mw, battery_percent (piecewise-linear SoC for 21700
  cell), and charge_state (charging/discharging/idle). Sign convention
  matches Waveshare sample code: negative current = charging.

Both plug-ins tested on Raspberry Pi 3B+ (DietPi) with RAK1901 WisBlock
sensor and Waveshare UPS HAT (D).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 22:32:20 -07:00
Lloyd 13ea672597 Merge pull request #254 from yellowcooln/dev
docker: improve container restart handling, publishing, and config mounting
2026-05-18 21:10:34 +01:00
Yellowcooln f21aba0ac4 docker: mount config directory in compose 2026-05-18 13:25:23 -04:00
Yellowcooln 11e2b90c18 ci: route docker publish by repository owner 2026-05-18 12:43:19 -04:00
Yellowcooln ab8ae30e7d web: clarify docker restart update messaging 2026-05-18 12:40:43 -04:00
Yellowcooln 7b6babd9f5 service: restart containers by exiting process 2026-05-18 12:12:18 -04:00
Lloyd 193b428cc2 Merge pull request #252 from yellowcooln/patch-2
docker: bootstrap config on startup and include rootless container fixes
2026-05-18 16:19:58 +01:00
Lloyd 8c354db99c Merge pull request #253 from pyMC-dev/wip/null-radio-before-pr250
Wip/null radio before pr250
2026-05-18 16:18:05 +01:00
Lloyd e0dbecd51c feat: update default radio type to null in config example 2026-05-18 15:59:49 +01:00
Yellowcooln c03d4ddc2b docker: merge config from example on boot 2026-05-18 10:48:39 -04:00
Yellowcooln 72a8755399 docker: bootstrap config and run rootless 2026-05-18 10:23:37 -04:00
Yellowcooln a08c4d093c Update repository conditions in docker-publish.yml
Had old repo path, Changing to 

pyMC-dev/pyMC_Repeater
2026-05-18 10:10:32 -04:00
Lloyd 0e1031227e update ui for setup 2026-05-18 14:50:45 +01:00
Lloyd 56113c22ec feat: update radio status handling to show radio errors 2026-05-18 14:34:42 +01:00
Lloyd 052474cf48 feat: add connection type for KISS and pymc modems in radio settings 2026-05-18 14:15:46 +01:00