mark bower
April 15th, 2020, 02:30 AM
My question is, is there a way via BIOS or something I am not aware of which will always cause USB ports to be captured/assigned in the same order when a PC is booted?
I am using two HP34401A multimeters which have RS-232 output and each is connected to a PC USB port. In the connection process, the RS-232 signals are converted and delivered to the USB ports via cabling with built in converters (RS-232 to USB). There is a problem in that for each boot of the computer, it is a toss-up as to whether the FTDI converter will be assigned to ttyUSB0 or ttyUSB1 and vise versa for the pl2303 device.
The inputs from the meters are plotted and displayed on a monitor like an oscilloscope screen. The switching of assignment from one boot to another obviously wreaks havoc with the meaning of the display.
Case 1 boot:
mark@mark:~$ dmesg | grep tty
[ 0.214063] printk: console [tty0] enabled
[ 1.656751] 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[ 21.149448] usb 1-5.4: FTDI USB Serial Device converter now attached to ttyUSB0
[ 21.181525] usb 1-5.2: pl2303 converter now attached to ttyUSB1
Case 2 Boot (FTDI and pl2303 have switched assignments):
mark@mark:~$ dmesg | grep tty
[ 0.212725] printk: console [tty0] enabled
[ 1.659891] 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[ 15.811967] usb 1-5.2: pl2303 converter now attached to ttyUSB0
[ 15.846315] usb 1-5.4: FTDI USB Serial Device converter now attached to ttyUSB1
The following code is how the devices are captured in the program:
scom1 = "/dev/ttyUSB0:9600,e,7,2,rs,cd0,cs0,ds0"
scom2 = "/dev/ttyUSB1:9600,e,7,2,rs,cd0,cs0,ds0"
open com scom1 for input as #1
open com scom2 for input as #2
I am using two HP34401A multimeters which have RS-232 output and each is connected to a PC USB port. In the connection process, the RS-232 signals are converted and delivered to the USB ports via cabling with built in converters (RS-232 to USB). There is a problem in that for each boot of the computer, it is a toss-up as to whether the FTDI converter will be assigned to ttyUSB0 or ttyUSB1 and vise versa for the pl2303 device.
The inputs from the meters are plotted and displayed on a monitor like an oscilloscope screen. The switching of assignment from one boot to another obviously wreaks havoc with the meaning of the display.
Case 1 boot:
mark@mark:~$ dmesg | grep tty
[ 0.214063] printk: console [tty0] enabled
[ 1.656751] 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[ 21.149448] usb 1-5.4: FTDI USB Serial Device converter now attached to ttyUSB0
[ 21.181525] usb 1-5.2: pl2303 converter now attached to ttyUSB1
Case 2 Boot (FTDI and pl2303 have switched assignments):
mark@mark:~$ dmesg | grep tty
[ 0.212725] printk: console [tty0] enabled
[ 1.659891] 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[ 15.811967] usb 1-5.2: pl2303 converter now attached to ttyUSB0
[ 15.846315] usb 1-5.4: FTDI USB Serial Device converter now attached to ttyUSB1
The following code is how the devices are captured in the program:
scom1 = "/dev/ttyUSB0:9600,e,7,2,rs,cd0,cs0,ds0"
scom2 = "/dev/ttyUSB1:9600,e,7,2,rs,cd0,cs0,ds0"
open com scom1 for input as #1
open com scom2 for input as #2