Assign USB to port
This short guide will show you how to assign a USB device to a port - kinda. It doesn't seem like you can exactly lock down the ports, but what you can do is assign a name (alias if you will) to a particular device. Then instead of using /dev/ttyUSB0 you could use /dev/<MY_DEVICE_NAME>.
- Plug in just the device you're interested in
- Bash
dmesg | tail -20this will show the names and information of your devices. You are looking for idVendor & idProduct.idVendor=1a86idProduct=7523
- Create a new rules file. Use a higher number so that the other more important rules happen first
sudo nano /etc/udev/rules.d/99-usb-serial.rules. Add in the correct vendor & product numbers:SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="<DEVNAME>" CTRL+X,Y,Enterto savesudo udevadm control --reload-rules&sudo udevadm triggerto reset.- Check the name you just setup:
ls -l /dev/<DEVNAME>and it should point to the correct port.
To show USB devices
ls -l /dev/serial/by-id/ or