1. Ben Bass
  2. pylibftdi
  3. Issues
Issue #10 resolved

Exception calling Driver list_devices() if device has no serial

Jonathan Liu
created an issue
>>> from pylibftdi import Driver
>>> d = Driver()
>>> d.list_devices()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pylibftdi/driver.py", line 157, in list_devices
    raise FtdiError(self.fdll.ftdi_get_error_string(byref(ctx)))
pylibftdi._base.FtdiError: libusb_get_string_descriptor_ascii() failed

Here is relevant lsusb info for the device:
idVendor: 0x0403 Future Technology Devices International, Ltd
idProduct: 0x6010 FT2232C Dual USB-UART/FIFO IC
iManufacturer: 1 FTDI
iProduct: 2 Dual RS232-HS
iSerial: 0

pylibftdi Version: 0.12

Comments (5)

  1. Ben Bass repo owner

    Thanks for the report. Could you let me know the libftdi version you are using e.g. from

    from pylibftdi import Driver
    
    Driver().libftdi_version()
    

    I'd be interested to know what return code is given by ftdi_usb_get_strings() if you're able to hack pylibftdi to show that; possible values are listed here : http://www.intra2net.com/en/developer/libftdi/documentation/group__libftdi.html#ga17e8eae09e58bd3bfeeab8decfce7fd9 - perhaps some of these errors should be ignored (or at least not raise an exception, but report "<unknown>" or similar?)

  2. Jonathan Liu reporter
    >>> from pylibftdi import Driver
    >>> Driver().libftdi_version()
    (1, 0, 0, '1.0', '1.4_M5.final-1010-g176a46b')
    >>> Driver().list_devices()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python2.7/site-packages/pylibftdi/driver.py", line 157, in list_devices
        raise FtdiError("%s (Code %s)" % (self.fdll.ftdi_get_error_string(byref(ctx)), res))
    pylibftdi._base.FtdiError: libusb_get_string_descriptor_ascii() failed (Code -9)
    
  3. Log in to comment