Repository navigation
Discover devices automatically in the machine wizard - #376
Merged
Merged
Conversation
Add a discovery-first flow to the machine configuration wizard: - Transport layer gains a generic serial scanner that opens each port once, probes it across baud rates, and captures whatever the device sends (banner plus nudged responses). - Drivers declare a DISCOVERY recognizer (label, firmware matcher, device-name extractor) instead of running scans themselves; adding drivers never multiplies scan cost. - The new first wizard step lists found devices and probes them without interaction; rows then show the machine's own name and work area. - All collected identity data feeds profile matching against vendor/model tokens declared in every built-in device.yaml; on a unique match the curated profile is adopted and every step whose data is already known is skipped. - When no profile matches, the profile picker is pre-filtered to matching vendors and controllers. - Fix crash in the laser control widget when the active machine is deleted while its signals are still attached.
This branch was previously deployed
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.
Stacked on #371.
Summary
Adds a discovery-first flow to the machine configuration wizard. Plugging in a machine and opening "Add Machine" is now enough to get a fully configured device — no forms, no baud-rate guessing.
Architecture
Discovery is split into two processes (scan once, evaluate many):
machine/transport/serial_scan.py, transport layer): opens every serial port once per scan, probes it across the candidate baud rates, and captures everything the device sends — unsolicited banner first, then responses to\n/?nudges, plus a quiet-gap drain for multi-line bursts. Firmware-agnostic; a generic mostly-printable-output heuristic decides when a port is talking.machine/driver/discovery.py): drivers declare aDISCOVERY = DeviceRecognizer(label, matches, name, firmware)class attribute — pure data, no behavior.find_all_devices()runs one scan and lets every recognizer evaluate the captured bytes. Adding serial drivers costs zero additional port opens.Wizard flow
$I/$$) — no interaction. Rows update live to show what the machine reported about itself (e.g. "Sculpfun iCube, 120×120 mm work area").device.yaml.Notable details
$I-style build info instead of a boot banner (e.g. Sculpfun iCube) are recognized via[VER:/[OPT:/[MSG:markers;[MSG:machine:...]/mechine:names drive both the row title and profile matching.okack never claims a port by itself (Marlin acks identically) — nudge responses are accumulated so recognition has full context.ValueError: No machine found with ID …from lazy controller resolution during signal disconnect).Test plan
tests/machine/transport/test_serial_scan.py(single-open semantics, baud ordering, garbage fall-through, exclusion, lock serialization),tests/machine/driver/test_discovery.py(one-scan-serves-all-drivers, bannerless GRBL, real Sculpfun banner end-to-end),tests/machine/device/test_profile_matching.py.