Open srobertjames opened 1 year ago
Questions:
lsusb -v
if you run it immediately after the issuedmesg
)Questions:
Is it a genuine FTDI or one of those crap chinese fake FTDIs?
I certainly wanted a genuine FTDI, but it's hard to tell. The bag has the FTDI logo on it, and says "FTDI Chip". How can I verify if it's genuine?
When PyFtdi returns an error, what does return lsusb -v if you run it immediately after the issue
(will do)
Are there some related error message reported by the kernel (see dmesg)
/etc/udev/rules.d$ sudo dmesg | grep -i -2 -E '(FTDI)|(Future)|(error)'
[ 3.402108] evm: HMAC attrs: 0x1
[ 3.402866] PM: Magic number: 7:134:136
[ 3.404605] RAS: Correctable Errors collector initialized.
[ 3.411067] Freeing unused decrypted memory: 2036K
[ 3.412459] Freeing unused kernel image (initmem) memory: 4764K
--
[164606.603377] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[164606.603383] usb 1-2.1: Product: TTL232R-3V3
[164606.603388] usb 1-2.1: Manufacturer: FTDI
[164606.603392] usb 1-2.1: SerialNumber: FT9PIFW4
[164606.698664] usbcore: registered new interface driver usbserial_generic
[164606.698683] usbserial: USB Serial support registered for generic
[164606.707692] usbcore: registered new interface driver ftdi_sio
[164606.707717] usbserial: USB Serial support registered for FTDI USB Serial Device
[164606.712189] ftdi_sio 1-2.1:1.0: FTDI USB Serial Device converter detected
[164606.713544] usb 1-2.1: Detected FT232R
[164606.721419] usb 1-2.1: FTDI USB Serial Device converter now attached to ttyUSB0
[165341.725472] usb 1-2.1: USB disconnect, device number 9
[165341.732718] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[165341.732783] ftdi_sio 1-2.1:1.0: device disconnected
[165380.077401] usb 1-2.1: new full-speed USB device number 10 using uhci_hcd
[165380.437881] usb 1-2.1: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[165380.437904] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[165380.437914] usb 1-2.1: Product: TTL232R-3V3
[165380.437921] usb 1-2.1: Manufacturer: FTDI
[165380.437929] usb 1-2.1: SerialNumber: FT9PIFW4
[165380.475561] ftdi_sio 1-2.1:1.0: FTDI USB Serial Device converter detected
[165380.475795] usb 1-2.1: Detected FT232R
[165380.481244] usb 1-2.1: FTDI USB Serial Device converter now attached to ttyUSB0
[165981.453687] usb 1-2.1: USB disconnect, device number 10
[165981.458696] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[165981.458754] ftdi_sio 1-2.1:1.0: device disconnected
[165981.902250] usb 1-2.1: new full-speed USB device number 11 using uhci_hcd
[165982.299340] usb 1-2.1: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[165982.299348] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[165982.299351] usb 1-2.1: Product: TTL232R-3V3
[165982.299354] usb 1-2.1: Manufacturer: FTDI
[165982.299356] usb 1-2.1: SerialNumber: FT9PIFW4
[165982.341317] ftdi_sio 1-2.1:1.0: FTDI USB Serial Device converter detected
[165982.341359] usb 1-2.1: Detected FT232R
[165982.349832] usb 1-2.1: FTDI USB Serial Device converter now attached to ttyUSB0
[166920.664039] usb 1-2.1: USB disconnect, device number 11
[166920.664771] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[166920.664911] ftdi_sio 1-2.1:1.0: device disconnected
[166925.141807] usb 1-2.1: new full-speed USB device number 12 using uhci_hcd
[166925.505150] usb 1-2.1: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[166925.505170] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[166925.505176] usb 1-2.1: Product: TTL232R-3V3
[166925.505181] usb 1-2.1: Manufacturer: FTDI
[166925.505185] usb 1-2.1: SerialNumber: FT9PIFW4
[166925.552294] ftdi_sio 1-2.1:1.0: FTDI USB Serial Device converter detected
[166925.552389] usb 1-2.1: Detected FT232R
[166925.559078] usb 1-2.1: FTDI USB Serial Device converter now attached to ttyUSB0
[167299.871095] usb 1-2.1: usbfs: interface 0 claimed by ftdi_sio while 'ipython' sets config #1
[167299.872134] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[167299.872170] ftdi_sio 1-2.1:1.0: device disconnected
I'll add that I get similar behavior with other ops, e.g. if I try to open a port USBTimeoutError: [Errno 110] Operation timed out
.
I have a clue as to the problem. See https://unix.stackexchange.com/questions/696001/dev-ttyusb0-is-available-but-after-try-to-call-its-gone which posted a similar problem, which was due to usb 1-2: usbfs: interface 0 claimed by ftdi_sio while 'brltty' sets config #1
from brltty
daemon. I don't have brltty
and it does not appear anywhere in dmesg
.
However, look at this (very similar) line: usb 1-2.1: usbfs: interface 0 claimed by ftdi_sio while 'ipython' sets config #1
. The ipython process is of course what I was using to use pyftdi
.
I'm not sure how to take this further, or what that error indicates.
I would suggest to first try with a simple(r) environment, i.e. cpython
Note that I got similar behavior when just using ftdi_urls
from the command line.
For future reference, here's an (old) post talking about similar issues in libftdi itself, having to do with attach and reattach: https://libftdi.developer.intra2net.narkive.com/4QoVetCi/disconnect-by-usbfs-dev-ttyusb0-disappears-when-using
I've setup pyftdi on Ubuntu, including the udev rules. Sometimes the
ftdi_urls
script can see my FTDI, sometimes it can't. This happens without any changes to perms.Consistently:
My udev file is:
My
lsusb -v
There's also:
I am a member of the dialout group.