FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: FT4232H SN missing A/B/C/D  (Read 536 times)

jmuellers

  • Newbie
  • *
  • Posts: 5
    • View Profile
FT4232H SN missing A/B/C/D
« on: April 29, 2021, 05:38:21 PM »

Dear FTDI community,
I worked on a project in a Windows 10 environment. I identify the four ports by their serialnumbers, e.g. GM5K3KQXA, GM5K3KQXB, GM5K3KQXC, GM5K3KQXD.
Now I migrated to a Raspberry, and the very same commands do not return the full serial number, but omit the A,B,C,D.
Does anyone have an explanation for this, and maybe an easy way out?
Thanks,
Johannes


This is what serial.tools.list_ports.comports() returns (after formatting):



DEBUG:programming.uartProgramming:Found the following ports with FT232R parts:
DEBUG:programming.uartProgramming:{
  "device": "/dev/ttyUSB4",
  "name": "ttyUSB4",
  "description": "USB <-> Serial Converter",
  "hwid": "USB VID:PID=0403:6011 SER=GM5K3KQX LOCATION=1-1.3:1.3",
  "vid": 1027,
  "pid": 24593,
  "serial_number": "GM5K3KQX",
  "location": "1-1.3:1.3",
  "manufacturer": "FTDI",
  "product": "USB <-> Serial Converter",
  "interface": null,
  "usb_device_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3",
  "device_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.3/ttyUSB4",
  "subsystem": "usb-serial",
  "usb_interface_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.3"
}
DEBUG:programming.uartProgramming:Found SN: GM5K3KQX
DEBUG:programming.uartProgramming:{
  "device": "/dev/ttyUSB3",
  "name": "ttyUSB3",
  "description": "USB <-> Serial Converter",
  "hwid": "USB VID:PID=0403:6011 SER=GM5K3KQX LOCATION=1-1.3:1.2",
  "vid": 1027,
  "pid": 24593,
  "serial_number": "GM5K3KQX",
  "location": "1-1.3:1.2",
  "manufacturer": "FTDI",
  "product": "USB <-> Serial Converter",
  "interface": null,
  "usb_device_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3",
  "device_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.2/ttyUSB3",
  "subsystem": "usb-serial",
  "usb_interface_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.2"
}
DEBUG:programming.uartProgramming:Found SN: GM5K3KQX
DEBUG:programming.uartProgramming:{
  "device": "/dev/ttyUSB2",
  "name": "ttyUSB2",
  "description": "USB <-> Serial Converter",
  "hwid": "USB VID:PID=0403:6011 SER=GM5K3KQX LOCATION=1-1.3:1.1",
  "vid": 1027,
  "pid": 24593,
  "serial_number": "GM5K3KQX",
  "location": "1-1.3:1.1",
  "manufacturer": "FTDI",
  "product": "USB <-> Serial Converter",
  "interface": null,
  "usb_device_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3",
  "device_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.1/ttyUSB2",
  "subsystem": "usb-serial",
  "usb_interface_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.1"
}
DEBUG:programming.uartProgramming:Found SN: GM5K3KQX
DEBUG:programming.uartProgramming:{
  "device": "/dev/ttyUSB1",
  "name": "ttyUSB1",
  "description": "USB <-> Serial Converter",
  "hwid": "USB VID:PID=0403:6011 SER=GM5K3KQX LOCATION=1-1.3:1.0",
  "vid": 1027,
  "pid": 24593,
  "serial_number": "GM5K3KQX",
  "location": "1-1.3:1.0",
  "manufacturer": "FTDI",
  "product": "USB <-> Serial Converter",
  "interface": null,
  "usb_device_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3",
  "device_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB1",
  "subsystem": "usb-serial",
  "usb_interface_path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0"
}
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 645
    • View Profile
Re: FT4232H SN missing A/B/C/D
« Reply #1 on: April 30, 2021, 12:14:19 PM »

Hello,

Thank you for your question.

The udev system on Linux will only pull the ATTRS{serial} attribute from the parent device and note the individual interfaces on the device. this is why the channel letters are not appended to the serial number when udev is used to obtain attributes for a device (this appears to be what serial.tools.list_ports.comports() is doing).

Please see the attached 'udev.png' for an example of the output for the following command issued when a FT4232H was enumerated on an Ubuntu system:

udevadm info --name=/dev/ttyUSB0 --attribute-walk

Please note the output is for the parent device.

It is possible via the D2XX driver to obtain and access devices via their serial number, please see simple.PNG for an example output from the 'simple' Sample included in the D2XX driver download for Linux. This lists the serial numbers of all connected devices and then opens the first one it can find, in this case channel A of the FT4232H.


Best Regards,
FTDI Community
Logged

jmuellers

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: FT4232H SN missing A/B/C/D
« Reply #2 on: May 05, 2021, 11:26:26 AM »

Thank you for your response.
I have chosen a different approach that needed only minimal changes in my Python code. I use the information in the "location" string, which enumerates A,B,C,D as 0,1,2,3.
I include an incomplete code snippets for whomever migth have a similar question.
Best regards
Johannes

Code: [Select]
        FT232R_VID = 0x0403
        FT232R_PID = 0x6011
        SN_A = ['GM5K3KQXA','GM5K3KQXB','GM5K3KQXC','GM5K3KQXD','GM62D32RA','GM62D32RB','GM62D32RC','GM62D32RD']
        SN_A_SHORT = ['GM5K3KQX','GM62D32R']
        ports = serial.tools.list_ports.comports()
        ftdi = [p for p in ports if p.vid == UART.FT232R_VID and p.pid == UART.FT232R_PID]
        self.logger.debug('Found the following ports with FT232R parts:')
        for p in ftdi:
            self.logger.debug(json.dumps(p.__dict__, indent=2))
            self.logger.debug('Found SN: %s', p.serial_number)
            if p.serial_number in UART.SN_A:
                if UART.SN_A.index(p.serial_number) == self.slot:
                    self.logger.debug('Found valid SN: %s', p.serial_number)
                    self.uartPort=p.device
            if p.serial_number in UART.SN_A_SHORT:
                if int(p.location[-1])+(UART.SN_A_SHORT.index(p.serial_number)*4) == self.slot:
                    self.logger.debug('Found valid SN in SN SHORT: %s', p.serial_number)
                    self.uartPort=p.device
Logged