0

first post so feel free to rip into me.

Trying to use FT_Open() for an FTDI device. This function is used in the FTDI driver's example 'read' program, and is currently failing there. I am running this on a raspberry pi 4, but am also trying on Ubuntu with the same error.

On both devices, the FTDI is found in the results of lsusb, showing the serial number I need to connect to. I have tried to use FT_Open() opening by port number, but this does not work, returning an ftStatus code of FT_DEVICE_NOT_FOUND.

I have tried to use sudo to correct this when running the example 'read' program however this does not work, but is mentioned as a fix for previous questions.

Here is the code and the error message being printed. This is the same code as on my laptop and the raspberry pi, they both result in the same issue.

    if(ftStatus != FT_OK) {
        /* 
            This can fail if the ftdi_sio driver is loaded
            use lsmod to check this and rmmod ftdi_sio to remove
            also rmmod usbserial
         */
        printf("FT_Open(%d): %d failed\n", iport, ftStatus);
        return 1;
    }

I am expecting this to not even print, however currently I am getting

FT_Open(6): 2 failed.

Any ideas on what to do? The productId is different for this FTDI device as it is actually for a Nistune Consult Cable sold by PLMS Developments. I am trying to connect to it over Linux, there is only support for Windows at the moment.

Edit: Ok so I did end up getting this to work after reprogramming the EEPROM on the FT232R chip I am working with to default settings.

However I am trying to do this without needing to do that. I want to use the default vendorID with a different productID for the chip. Before, every time I unplugged the device it would reload ftdi_sio and usbserial modules. This would result in it never connecting properly. That can be fixed as I’ve seen in other questions.

Now I need to find a way to accept custom productIDs in the Linux driver software. I tried changing all information that seemed relevant but it was again not able to recognise the device.

BM1296
  • 1
  • 1
  • Have you installed the D2XX driver and removed the ftdi_sio that the Linux kernel comes with by default? – Marcos G. Aug 10 '19 at 15:30
  • Possible duplicate of [Why can't I access my FTDI device using D2XX on a Raspberry Pi?](https://stackoverflow.com/questions/42375995/why-cant-i-access-my-ftdi-device-using-d2xx-on-a-raspberry-pi) – Christian B. Aug 10 '19 at 16:23
  • Edited for some more info guys – BM1296 Aug 11 '19 at 23:33
  • "was again not able to recognise the device" -> does this mean that no driver is loaded at all after you changed the PID to a custom one or that the ftdi_sio is loaded again? Does it work with as sudo (after sudo rmmod ftdi_sio etc.)? – Christian B. Aug 12 '19 at 08:56
  • I don't really understand what you are doing or what your problem is... [This](https://stackoverflow.com/a/56706077/11476836) might somehow help. – Marcos G. Aug 12 '19 at 11:31
  • Ok so it was a bit of a brain dump, apologies. My issue now is that I’m not sure how to make the FTDI Linux drivers work with a custom productID. I’ve tried changing all relevant info in the drivers and rebuilding them, however this results in my computer no longer being able to recognise the device. – BM1296 Aug 13 '19 at 12:33

1 Answers1

0

First you should set your custom VID-PID value with the command below.

ftStatus = FT_SetVIDPID(custom_VID, custom_PID);