1
Discussion - Drivers / Re: FT4232H SN missing A/B/C/D
« 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
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