Skip to content

Automatically discover and verify ACE 2 on generic USB adapters - #155

Open
Tareku99 wants to merge 4 commits into
mainfrom
tareku99/verified-ace-discovery
Open

Tareku99 wants to merge 4 commits into
mainfrom
tareku99/verified-ace-discovery

Conversation

@Tareku99

@Tareku99 Tareku99 commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Automatically discover ACE 2 units connected through generic USB-RS485 adapters, without entering adapter VID/PID or enabling a discovery option.
  • Enable ACE 2 support and verified generic USB probing by default. Honor existing explicit false settings, and keep v2_probe_generic_usb: false as an optional disable switch.
  • Enumerate stable USB serial links and direct USB tty paths, then verify candidates using bounded DISCOVER_DEVICE and GET_INFO exchanges. Require valid CRC, command, sequence, non-zero UID, and firmware identity.
  • Exclude Klipper-configured serial paths and ports reported open by visible Linux processes. Suspend generic probes when the configured-port inventory or idle printer state cannot be established.
  • Probe at most one new port per scan, rotate attempts across candidates, and back off after failures.
  • Preserve genuine-cable, V1, and explicit v2_extra_usb_ids selection behavior.

ACELink context

ACELink informed the use of GET_INFO to confirm device identity. Its first-matching-adapter heuristic is not copied as the multiACE scanner. Automatic discovery and verification are handled by multiACE's existing V2 protocol code.

Validation and remaining work

  • After rebasing and updating the package-default assertions: 7 managed package tests and 10 discovery tests passed locally. The workflow now runs the discovery tests as well.
  • Python syntax parsing and git diff --check passed.
  • Hardware validation remains for generic and genuine adapters, V1, multiple units, and reconnect behavior.
  • Ownership checks are best-effort and exclusivity is advisory. Eligible USB serial ports receive identification bytes; behavior on unrelated hardware requires review and hardware validation before merging.
  • Host permissions remain the platform's responsibility. Explicit extra USB IDs continue to bypass generic verification for compatibility.

Refs #154

@Tareku99 Tareku99 changed the title Add opt-in verified discovery for generic USB-RS485 adapters Automatically discover and verify ACE 2 on generic USB adapters Oct 1, 2026
@Tareku99
Tareku99 force-pushed the tareku99/verified-ace-discovery branch from e67291c to 648c58a Compare October 1, 2026 06:07
@Tareku99

Tareku99 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Whipped something out really fast. Did not test this yet but I took the code from my own project (https://github.com/Tareku99/ACELink) and it worked fine there. I am out of time, but I wanted to make something before I left.

@Tareku99
Tareku99 marked this pull request as ready for review October 1, 2026 06:18
@Tareku99
Tareku99 requested a review from decay71 as a code owner October 1, 2026 06:18
@decay71

decay71 commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Thanks Nicola, that was quick. I'd like to stay with the opt-in from your first commit: please set the defaults of v2_probe_generic_usb and enable_ace_v2 back to false, but keep the improvements from 648c58a (suspend when the configured-port list is unknown, the probe rotation). A stock setup should never send bytes to a serial port it doesn't know.

Please also take out the exclusive=True in open_transport (that's the reconnect path we tested on hardware, unrelated to discovery) and the README change. Opening a port also toggles DTR, which resets some CH340 boards; could the probe open with DTR/RTS off?

No rush, this can wait until you're back. Safe travels.

Dirk

@Tareku99

Tareku99 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks Nicola, that was quick. I'd like to stay with the opt-in from your first commit: please set the defaults of v2_probe_generic_usb and enable_ace_v2 back to false, but keep the improvements from 648c58a (suspend when the configured-port list is unknown, the probe rotation). A stock setup should never send bytes to a serial port it doesn't know.

Please also take out the exclusive=True in open_transport (that's the reconnect path we tested on hardware, unrelated to discovery) and the README change. Opening a port also toggles DTR, which resets some CH340 boards; could the probe open with DTR/RTS off?

No rush, this can wait until you're back. Safe travels.

Dirk

Sounds good. Thank you for the feedback, shall take care of this when back in 2 weeks or so.
Thank you!

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