setup wizard: pymc_tcp / pymc_usb hardware tiles#250
Closed
itk80 wants to merge 1 commit into
Closed
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #240 (which only added the
pymc_usb/pymc_tcpbranches inget_radio_for_board). This wires the same two radio types into the first-run web wizard so users can pick them without hand-editingconfig.yaml.radio-settings.json(pymc_usb,pymc_tcp) — appear in/api/hardware_optionsautomatically.setup_wizard()inapi_endpoints.pygets dedicated branches mirroring the existing KISS pattern: writes sensible defaults (/dev/ttyACM0@921600 for USB,port: 5055+REPLACE_WITH_MODEM_HOSTplaceholder for TCP) but acceptspymc_usb_port,pymc_tcp_host,pymc_tcp_port,pymc_tcp_tokenfrom the request body if the SPA ever exposes inputs for them.pymc_tcp, the placeholder host is intentional:get_radio_for_boardwill refuse to start with a clear error pointing atpymc_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 existingtests/test_radio_config.py.Verified
Live on a running 1.0.10.dev80 instance:
/api/hardware_optionsnow lists both new tiles (21 hardware keys total, up from 19), service restart clean.