Skip to content

setup wizard: pymc_tcp / pymc_usb hardware tiles#250

Closed
itk80 wants to merge 1 commit into
pyMC-dev:devfrom
itk80:feat/pymc-tcp-usb-wizard
Closed

setup wizard: pymc_tcp / pymc_usb hardware tiles#250
itk80 wants to merge 1 commit into
pyMC-dev:devfrom
itk80:feat/pymc-tcp-usb-wizard

Conversation

@itk80
Copy link
Copy Markdown

@itk80 itk80 commented May 17, 2026

Summary

Follow-up to #240 (which only added the pymc_usb / pymc_tcp branches in get_radio_for_board). This wires the same two radio types into the first-run web wizard so users can pick them without hand-editing config.yaml.

  • Two new tiles in radio-settings.json (pymc_usb, pymc_tcp) — appear in /api/hardware_options automatically.
  • setup_wizard() in api_endpoints.py gets dedicated branches mirroring the existing KISS pattern: writes sensible defaults (/dev/ttyACM0@921600 for USB, port: 5055 + REPLACE_WITH_MODEM_HOST placeholder for TCP) but accepts pymc_usb_port, pymc_tcp_host, pymc_tcp_port, pymc_tcp_token from the request body if the SPA ever exposes inputs for them.
  • For pymc_tcp, the placeholder host is intentional: get_radio_for_board will refuse to start with a clear error pointing at pymc_tcp.host (existing behavior from config: add pymc_tcp / pymc_usb radio_type branches #240), so the user is guided to fix it post-wizard.

Tests

tests/test_setup_wizard_pymc.py — 5 new tests covering pymc_usb/pymc_tcp defaults, request-body overrides, and a KISS regression guard. All green locally alongside the existing tests/test_radio_config.py.

Verified

Live on a running 1.0.10.dev80 instance: /api/hardware_options now lists both new tiles (21 hardware keys total, up from 19), service restart clean.

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.
@rightup rightup closed this May 19, 2026
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