Skip to content

config: add pymc_tcp / pymc_usb radio_type branches#240

Merged
rightup merged 1 commit into
pyMC-dev:devfrom
itk80:feat/pymc-tcp-usb-radio
May 13, 2026
Merged

config: add pymc_tcp / pymc_usb radio_type branches#240
rightup merged 1 commit into
pyMC-dev:devfrom
itk80:feat/pymc-tcp-usb-radio

Conversation

@itk80
Copy link
Copy Markdown

@itk80 itk80 commented May 13, 2026

Wires the TCPLoRaRadio and USBLoRaRadio drivers from pyMC-dev/pyMC_core#68 into get_radio_for_board() so they can be selected via radio_type: pymc_tcp / radio_type: pymc_usb in the config file. New sections documented in config.yaml.example, four tests in tests/test_radio_config.py.

No web-UI / endpoint changes — config-file selection only.

Wires the TCPLoRaRadio and USBLoRaRadio drivers that landed in pyMC_core
on 2026-05-13 (PR pyMC-dev/pyMC_core#68) into get_radio_for_board() so
they can be selected from a repeater config file without any code change
in main.py / api_endpoints.

Both branches follow the existing pattern: read host/port (TCP) or
serial port (USB) plus auth/LBT options from their own config section,
share the LoRa parameters from the common `radio` section, fall back to
the firmware-default sync word 0x12, and surface ImportError as a clear
RuntimeError if the installed pymc_core is too old to ship the drivers.

config.yaml.example documents both sections and updates the radio_type
header comment with the full supported list. Five new tests in
tests/test_radio_config.py monkeypatch the radio classes and verify the
section/parameter wiring + missing-required-field errors.

No web UI / endpoint changes — the deployment this targets edits the
config file directly. A GUI wizard for these radio types can land
separately if there's appetite.
@rightup rightup merged commit c70f360 into pyMC-dev:dev May 13, 2026
yellowcooln pushed a commit to yellowcooln/pyMC_Repeater that referenced this pull request May 18, 2026
Lets a fresh repeater install pick the pymc_usb (USB-CDC) or pymc_tcp
(Wi-Fi/Ethernet) external modem from the first-run /setup wizard
instead of requiring the user to hand-edit config.yaml after install.

radio-settings.json gets two new hardware entries; setup_wizard()
in api_endpoints.py handles them in dedicated branches that mirror
the existing KISS pattern (placeholders if the SPA doesn't yet send
modem-specific inputs, request body overrides if it does).

For pymc_tcp the wizard writes a sentinel host placeholder
('REPLACE_WITH_MODEM_HOST') so the YAML stays valid; on startup
get_radio_for_board() then errors with a clear pointer at
pymc_tcp.host (existing behavior from the PR pyMC-dev#240 branch). pymc_usb
defaults to /dev/ttyACM0 at 921600 baud — matches the USB-CDC
device path documented in pymc_usb's README + pymc_driver.

Five new tests in tests/test_setup_wizard_pymc.py verify both
default and overridden code paths plus a KISS regression guard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants