Identify the USB serial adapter's product and vendor codes
- Open up a Terminal. Physically plug in the USB serial adapter to the computer's USB port. Type in the following command:
$ dmesg | grep ttyUSB
The device messages with the string ttyUSB are displayed. - Note which default device name has been assigned. In this case it is /dev/ttyUSB0.
- Type in the following command to print out the attributes of the device.
$ udevadm info --name=/dev/ttyUSB0 --attribute-walk
The attributes are printed out. - Scroll and look for the idProduct and idVendor attributes.
- Note down the codes for the idProduct and idVendor attributes. In this case, the codes are ea60 and 10c4 respectively.
- In a text editor, create a rule file e.g. 50-usb-serial.rules. Type in the following line:
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="my_device_name"
Note: replace the idVendor and idProduct and the my_device_name with the appropriate values.
An example file listing: - Place the rule file in /etc/udev/rules.d/. Note: you need to place it as the super user.
- This can be done by restarting the computer.
- Alternatively, run the following command in a Terminal:
$ sudo udevadm trigger - To see whether it has been renamed, type in the following command:
$ ls -l /dev/my_device_name
Note: replace my_device_name with the name you defined in the rule file.
The USB serial device has been renamed accordingly as a symbolic link.