Closed nmichaels-qualinx closed 1 year ago
I'm not sure whether it could help, but have you tried to flush the device cache?
If it is a PyUSB issue, I'm not sure what can be done @ PyFtdi level but ideas are welcomed.
I'm not sure whether it could help, but have you tried to flush the device cache?
If it is a PyUSB issue, I'm not sure what can be done @ PyFtdi level but ideas are welcomed.
I had not, and it worked. Thanks!
I have a device (0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC) that I've been using pyftdi with successfully for a while now. However, occasionally when I call
Ftdi.list_devices()
I get aValueError
telling me the device has no langid.I managed to get this to happen and drop into an interactive shell. Repeated calls to
Ftdi.list_devices()
still raise the same exception. Reloading pyftdi didn't change it. However, if I run a script that callslist_devices()
in a subprocess or throughos.execv
, it works.So it looks like something tied to the process is preventing this error from clearing. I'm running this on a VM (Debian on proxmox) that has the port passed through to it. I'm also disabling and re-enabling the port with a USB switch. Here's the most reliable way I've found to reproduce the issue:
$ while true ; do ./test.py || break ; done
While that's running, trigger a test, which basically unplugs then replugs the device I care about.
This comment seems to say that there's a potential race condition where if the device isn't immediately available after being configured it might return this error. That seems like a plausible explanation.
Once this happens, the process is effectively useless. Is there a way to reinitialize it that I'm not seeing?