Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.55 Operation not supported or unimplemented on this platform (FT4232HA) Windows #350

Closed
MSOcu opened this issue Aug 9, 2023 · 1 comment

Comments

@MSOcu
Copy link

MSOcu commented Aug 9, 2023

Hi! First, let me thank you for the overall great working library!
I used the pyftdi together with the FT4232H mini module and it worked like a charm. I made a custom board based on the FT4232H(A) variant since it was the only available version at the time.
I've seen, that support for this device was added recently with version 0.55. The device is detected correctly, but I receive the error message: "Error: Operation not supported or unimplemented on this platform" when using the ftdi_urls.py.
To emulate the behavior of the FT4232H I programmed the EEPROM of the FT4232HA device to match the VID of the standard one. The issue is still present. Additional information: My machine is running Windows 11. I'm using the libusb-1.2.7.3 driver.
When using my code, which is working with the FT4232H I received some more information:

Traceback (most recent call last):
  File "c:\Users\Hidden\Documents\Testsystem\Testsystem_SW\Python\I2C_Test\PCA9548.py", line 8, in <module>
    i2c.configure('ftdi://ftdi:4232:5:a/2', frequency = 10000)
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyftdi-0.55.0-py3.11.egg\pyftdi\i2c.py", line 498, in configure
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyftdi-0.55.0-py3.11.egg\pyftdi\ftdi.py", line 633, in open_mpsse_from_url
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyftdi-0.55.0-py3.11.egg\pyftdi\ftdi.py", line 399, in get_identifiers
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyftdi-0.55.0-py3.11.egg\pyftdi\usbtools.py", line 312, in parse_url
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyftdi-0.55.0-py3.11.egg\pyftdi\usbtools.py", line 417, in enumerate_candidates
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyftdi-0.55.0-py3.11.egg\pyftdi\usbtools.py", line 100, in find_all
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyftdi-0.55.0-py3.11.egg\pyftdi\usbtools.py", line 556, in get_string
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\usb\util.py", line 311, in get_string
    langids = dev.langids
              ^^^^^^^^^^^
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\usb\core.py", line 851, in langids
    self._langids = util.get_langids(self)
                    ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\usb\util.py", line 266, in get_langids
    buf = get_descriptor(
          ^^^^^^^^^^^^^^^
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\usb\control.py", line 172, in get_descriptor
    desc = dev.ctrl_transfer(
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    self._ctx.managed_open()
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\usb\core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\usb\core.py", line 131, in managed_open
    self.handle = self.backend.open_device(self.dev)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    return _DeviceHandle(dev)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\Users\Hidden\AppData\Local\Programs\Python\Python311\Lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    raise NotImplementedError(_strerror(ret))

Thank you in advance!

@MSOcu MSOcu closed this as completed Aug 10, 2023
@MSOcu
Copy link
Author

MSOcu commented Aug 10, 2023

Solved:
Issue was, that two different FTDI devices where connected simultaniously. One using the standard windows driver (necessary to funtion properly with third party software) and the target device using libusb.
Device was instanciated through the URL. During initalization pyusb tries to communicate with the device through incopatible drivers and throws a exception, even if it is not the device which should be connectes.
Fix: Create pyftdi object with an usb.core device object, called by VID:PID.

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

No branches or pull requests

1 participant