Linux USB serial ports

October 24, 2025 - Reading time: 5 minutes

The problem

On Linux, serial ports are located in the /dev directory. When you connect a USB serial device it is likely to be allocated ttyUSB0. The second device you connect will be allocated to ttyUSB1, and so on. You can list the contents of /dev to verify this. The problem is that the allocated number is in the order in which you plug in the serial devices. If you're a ham, you probably have multiple devices connected via serial ports. In my case, I have an IC-7610 that presents two serial devices over a single USB cable, and a Winkeyer that presents another. A logging program connects to these, using settings stored in that program. If the USB cables are connected in a different order, the settings in the logging program will be wrong. In addition, it seems to be random what that order is on boot with all the cables connected. This is obviously a bit irritating!

UDEV to the rescue

Fortunately, you can tell Linux how to assign USB ports using a udev rules file. I'm using Linux Mint. These instructions are only correct for that distribution, but will be similar for all distributions.

First, you need to get some 'attributes' that can uniquely identify a particular serial port. Make sure your device is unplugged. Then run dmesg in a terminal. Next plug your device in and do it again. You should see that the result is now different - something like this:

[12945.973493] hub 3-1:1.0: USB hub found
[12945.973601] hub 3-1:1.0: 4 ports detected
[12946.259522] usb 3-1.2: new full-speed USB device number 13 using xhci_hcd
[12946.361846] usb 3-1.2: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
[12946.361857] usb 3-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[12946.361861] usb 3-1.2: Product: CP2102 USB to UART Bridge Controller
[12946.361864] usb 3-1.2: Manufacturer: Silicon Labs
[12946.361868] usb 3-1.2: SerialNumber: IC-7610 13001375 A
[12946.364223] cp210x 3-1.2:1.0: cp210x converter detected
[12946.367060] usb 3-1.2: cp210x converter now attached to ttyUSB1
[12946.447466] usb 3-1.3: new full-speed USB device number 14 using xhci_hcd
[12946.549644] usb 3-1.3: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
[12946.549654] usb 3-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[12946.549658] usb 3-1.3: Product: CP2102 USB to UART Bridge Controller
[12946.549661] usb 3-1.3: Manufacturer: Silicon Labs
[12946.549664] usb 3-1.3: SerialNumber: IC-7610 13001375 B
[12946.552153] cp210x 3-1.3:1.0: cp210x converter detected
[12946.554977] usb 3-1.3: cp210x converter now attached to ttyUSB2
[12946.631560] usb 3-1.4: new full-speed USB device number 15 using xhci_hcd
[12946.734872] usb 3-1.4: New USB device found, idVendor=08bb, idProduct=2901, bcdDevice= 1.00
[12946.734884] usb 3-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[12946.734888] usb 3-1.4: Product: USB Audio CODEC 
[12946.734891] usb 3-1.4: Manufacturer: Burr-Brown from TI              
[12946.768912] input: Burr-Brown from TI               USB Audio CODEC  as /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.4/3-1.4:1.3/0003:08BB:2901.0005/input/input16
[12946.828001] hid-generic 0003:08BB:2901.0005: input,hidraw0: USB HID v1.00 Device [Burr-Brown from TI               USB Audio CODEC ] on usb-0000:00:14.0-1.4/input3

Here you can see that IC-7610 port A was assigned to ttyUSB1 and IC-7610 port B was assigned to ttyUSB2. Note down the attributes. In  my case:

  • SerialNumber: IC-7610 13001375 A
  • idVendor=10c4
  • idProduct=ea60

And,

  • SerialNumber: IC-7610 13001375 B
  • idVendor=10c4
  • idProduct=ea60

It's not obvious, but the one with the different Vendor and Product IDs is the USB Audio Codec, not the second serial port.

Now you need to create a new rules file. I have nedit installed, but you may not. Use your favourite editor.

sudo nedit /etc/udev/rules.d/99-usb-serial.rules

If the file doesn't already exist, nedit should give you the option to create it. Add these lines and save the file (use the attributes you found in the step above - not mine!):

SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="IC-7610 13001375 A", SYMLINK+="ttyUSB.IC7610A"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="IC-7610 13001375 B", SYMLINK+="ttyUSB.IC7610B"

What this does is make a symbolic link from (for example) ttyUSB.IC7610A to the serial device with the attributes you've given, even though it might assign ttyUSBx randomly.

Unplug your serial device(s). You'll either need to reboot at this point or run:

sudo udevadm control --reload-rules

sudo /etc/init.d/udev restart

No plug in your serial device(s), cd to /dev, and look at the output of ls -al. You should see something like this:

In your logging program, or whatever, now use the unique name you've supplied.