Created
August 22, 2016 03:28
-
-
Save huzhifeng/1a9b5d5b08b96d2f6e742451fa5cd3e1 to your computer and use it in GitHub Desktop.
udev rule for usb serial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/udev/rules.d/90-tty-usb.rules | |
# CP210x | |
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE="0666" | |
How to add udev rule for usb serial device | |
[huzhifeng@CentOS72 ~]$ minicom | |
Cannot create lockfile for /dev/ttyUSB0: 权限不够 | |
[huzhifeng@CentOS72 ~]$ su root -l | |
[root@CentOS72 ~]# ls -al /dev/ttyUSB0 | |
crw-rw---- 1 root dialout 188, 0 8月 22 08:59 /dev/ttyUSB0 | |
[root@CentOS72 ~]# lsusb | grep CP210x | |
Bus 001 Device 055: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light | |
[root@CentOS72 ~]# udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0) | |
[root@CentOS72 ~]# echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE="0666"' > /etc/udev/rules.d/90-tty-usb.rules | |
[root@CentOS72 ~]# udevadm control --reload | |
# Plug in/out CP210x | |
[root@CentOS72 ~]# udevadm test $(udevadm info -q path -n /dev/ttyUSB0) | |
[root@CentOS72 ~]# ls -l /dev/ttyUSB0 | |
crw-rw-rw- 1 root dialout 188, 0 8月 22 11:03 /dev/ttyUSB0 | |
[root@CentOS72 ~]# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works fine for me. Thanks a lot, you saved me a lot of time!