Repository navigation
Conversation
Collaborator
Author
|
when this helps, on a windows pc that keeps FTDI's own driver:
not covered: running plr and the vendor software at the same time (one program per channel), and devices already rebound with zadig (keep |
Member
|
this is awesome! please merge (mantis should be separated though) |
- `ftdi_library="libftdi" | "d2xx" | None`; the default stays "libftdi", so no device changes; None picks D2XX on Windows when FTDI's D2XX library loads, else libftdi - D2XX is loaded with ctypes from FTDI's driver install; no new dependency, nothing bundled - channels resolve by serial number plus interface letter; device_id stays the serial without it; without interface_select a multi-interface chip opens channel A, as libftdi does; usb_address is refused under D2XX - every call mapped to its D2XX call with libftdi's values; 1.5 stop bits refused; reads return what has arrived without waiting; a short write raises - errors name the likely cause: a channel held by another program, or bound to another driver - a D2XX setup is recorded in captures; FTDIValidator.setup takes that record when present Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `ftdi_library` on `Mantis()`, `MantisDevice` and `MantisDriver`, passed to both links (interfaces A and B); None picks FTDI's D2XX library on Windows when it loads, else libftdi - a simulated Mantis refuses `ftdi_library`, as it refuses any link argument - the model-file test names the meshed parts instead of probing for a mesh attribute Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
This branch has not been 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 #1612: only the last two commits are this PR.
The Problem
On Windows, an FTDI device comes bound to FTDI's own driver, installed by Windows Update or with the device's software. PyLabRobot's
FTDItransport talks through libftdi and libusb, which can't open a device bound to that driver. Today the only way in is to rebind the device with Zadig. After that, every other program that uses the device can't reach it until FTDI's driver is restored by hand.FTDI's driver comes with its own library, D2XX (
ftd2xx.dll). Through it, PyLabRobot can open the device with the driver Windows already has: no Zadig, and the device's own software keeps working whenever PyLabRobot isn't connected.PR Content
FTDI(..., ftdi_library=...):"libftdi": the default, unchanged."d2xx": FTDI's own D2XX library (ftd2xx.dll,libftd2xx.dylib/.so), loaded withctypes. There's nothing new to pip-install, and PyLabRobot doesn't bundle the library: it comes with FTDI's driver.None: D2XX on Windows when the library loads, else libftdi.<serial>Aand<serial>Bon an FT2232H.device_idstays the base serial number andinterface_selectpicks the letter.usb_addressis refused under D2XX, which has no USB address, and the error lists the channels it found.ftdi_library="libftdi"for a device rebound with Zadig.D2XXErrorcarries D2XX's status code.FTDIcall has its D2XX counterpart: baud rate, line properties, flow control, RTS/DTR, latency timer, purge, reset and modem status. Reads don't block, as with libftdi.setupentry naming the library. libftdi captures are unchanged, so existing captures still replay.Mantis(..., ftdi_library=None)picks D2XX on Windows. Every other FTDI device keeps libftdi until it has been checked on D2XX itself.Usage
On the device
A Mantis v4 on a Windows PC with FTDI's driver and the vendor software installed, plus the same steps on macOS:
d2xx, fromC:\Windows\System32\ftd2xx.dll; both channels opened, no Zadig🤖 Generated with Claude Code