LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   udev rule not working (http://www.linuxquestions.org/questions/linux-hardware-18/udev-rule-not-working-880563/)

r_jr 05-13-2011 01:52 PM

udev rule not working
 
I have a usb to serial device that creates a /dev/ttyACM0 node, but for some serial software it needs to be /dev/ttyUSB*. So, I wrote a udev rule, but it does not seem to work though I have used this before without a problem though on a different type of device. I was wondering if someone could tell me why this rule is not working.

:confused:

50-ubw-serial.rules:
Code:

KERNEL=="ttyACM*", SUBSYSTEMS=="usb", "ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="000a", ATTRS{manufacturer}=="Microchip Technology, Inc.", ATTRS{product}=="CDC RS-232 Emulation Demo", MODE=="0777", SYMLINK+="ttyUSB*"
here is the output of
Quote:

udevadm info --query=all --name="/dev/ttyACM0" --attribute-walk
output:
Quote:

looking at device '/devices/pci0000:00/0000:00:04.1/usb2/2-4/2-4.3/2-4.3:1.0/tty/ttyACM0':
KERNEL=="ttyACM0"
SUBSYSTEM=="tty"
DRIVER==""

looking at parent device '/devices/pci0000:00/0000:00:04.1/usb2/2-4/2-4.3':
KERNELS=="2-4.3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{configuration}==""
ATTRS{bNumInterfaces}==" 2"
ATTRS{bConfigurationValue}=="1"
ATTRS{bmAttributes}=="80"
ATTRS{bMaxPower}=="100mA"
ATTRS{urbnum}=="14"
ATTRS{idVendor}=="04d8"
ATTRS{idProduct}=="000a"
ATTRS{bcdDevice}=="0000"
ATTRS{bDeviceClass}=="02"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bNumConfigurations}=="1"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{speed}=="12"
ATTRS{busnum}=="2"
ATTRS{devnum}=="5"
ATTRS{version}==" 2.00"
ATTRS{maxchild}=="0"
ATTRS{quirks}=="0x0"
ATTRS{authorized}=="1"
ATTRS{manufacturer}=="Microchip Technology Inc."
ATTRS{product}=="CDC RS-232 Emulation Demo"


catkin 05-13-2011 01:59 PM

MODE=="0777" should be MODE="0777" ?

SL00b 05-13-2011 02:10 PM

Try matching on fewer things. If this is the only device like this, then all these extra criteria in the rule are overkill. It creates opportunities for a mismatch. If this is the only type of device like this on the machine, then the KERNEL parameter would have been fine.

In this case, I think it was a simple syntax error that caused the rule to not be matched.

ATTRS{manufacturer}=="Microchip Technology, Inc." - Your rule
ATTRS{manufacturer}=="Microchip Technology Inc." - udevinfo

r_jr 05-13-2011 04:32 PM

Quote:

Originally Posted by catkin (Post 4355537)
MODE=="0777" should be MODE="0777" ?


Thanks. :)

r_jr 05-13-2011 04:37 PM

Quote:

Originally Posted by SL00b (Post 4355544)
Try matching on fewer things. If this is the only device like this, then all these extra criteria in the rule are overkill. It creates opportunities for a mismatch. If this is the only type of device like this on the machine, then the KERNEL parameter would have been fine.

In this case, I think it was a simple syntax error that caused the rule to not be matched.

ATTRS{manufacturer}=="Microchip Technology, Inc." - Your rule
ATTRS{manufacturer}=="Microchip Technology Inc." - udevinfo

Thanks a lot. I guess I needed a second pair of eyes for this. Originally, I used hwinfo to get that string and it has the comma. I will have to remember to only use udevadm from now on. Anyway, it works now and thanks again.

:)

r_jr 05-13-2011 04:58 PM

Quote:

Originally Posted by r_jr (Post 4355690)
Thanks a lot. I guess I needed a second pair of eyes for this. Originally, I used hwinfo to get that string and it has the comma. I will have to remember to only use udevadm from now on. Anyway, it works now and thanks again.

:)

I guess I was a little premature in thinking the problem was solved. Yes, it does create a symbolic link now, but instead of /dev/ttyUSB0, I get /dev/ttyUSB_ . So, I had to change the SYMLINK+="ttyUSB*" to SYMLINK+="ttyUSB%n". Now, I get what I was looking for.

:)


All times are GMT -5. The time now is 12:45 AM.