LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 05-13-2011, 12:52 PM   #1
r_jr
Member
 
Registered: Feb 2006
Distribution: Ubuntu
Posts: 65

Rep: Reputation: 0
Question 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.



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"
 
Old 05-13-2011, 12:59 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,533
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
MODE=="0777" should be MODE="0777" ?
 
Old 05-13-2011, 01:10 PM   #3
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 111Reputation: 111
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
 
Old 05-13-2011, 03:32 PM   #4
r_jr
Member
 
Registered: Feb 2006
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by catkin View Post
MODE=="0777" should be MODE="0777" ?

Thanks.
 
Old 05-13-2011, 03:37 PM   #5
r_jr
Member
 
Registered: Feb 2006
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SL00b View Post
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.

 
Old 05-13-2011, 03:58 PM   #6
r_jr
Member
 
Registered: Feb 2006
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by r_jr View Post
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.

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
First UDEV Rule, Not quite there ... orbit Slackware 7 02-22-2009 10:08 PM
Any guess as too why this udev rule is not working? FederalPosterChild Linux - Hardware 0 09-07-2008 04:26 PM
udev rule: need help DPenguin Linux - Hardware 0 08-04-2008 07:29 PM
Udev Rule Help Please Toods Slackware 1 11-23-2007 08:55 AM
need help with udev rule hussam Linux - Software 2 12-05-2006 03:30 AM


All times are GMT -5. The time now is 07:46 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration