LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 09-30-2015, 04:56 AM   #1
mr.simo
Member
 
Registered: Feb 2010
Posts: 78

Rep: Reputation: 0
udev does not apply rules


Hi all,

I am having some problem assigning rules from udev.

I have 2 FTDI232 chips mounted on my board (they are totally 3 but I am interested in 2 of them right now), the kernel manages them with the drivers ftdi_sio, names them as ttyUS0 and ttyUSB1 and I am applying these rules in order to name them as usbS1 and usbS2:

Code:
KERNELS=="1-2.1" KERNEL=="ttyUSB0" ATTR{idVendor}=="0403" ATTR{idProduct}=="6001" SUBSYSTEMS=="usb" NAME="usbS1"
KERNELS=="1-2.2" KERNEL=="ttyUSB1" ATTR{idVendor}=="0403" ATTR{idProduct}=="6001" SUBSYSTEMS=="usb" NAME="usbS2"
according to the inormation from dmesg

Code:
[    4.676116] usb 1-2.1: new full-speed USB device number 3 using ehci-omap
[    4.811920] usb 1-2.1: New USB device found, idVendor=0403, idProduct=6001
[    4.819244] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    4.826965] usb 1-2.1: Product: FT232R USB UART
[    4.831726] usb 1-2.1: Manufacturer: FTDI
[    4.835968] usb 1-2.1: SerialNumber: A101XRTT
[    4.963256] usb 1-2.2: new full-speed USB device number 4 using ehci-omap
[    5.102355] usb 1-2.2: New USB device found, idVendor=0403, idProduct=6001
[    5.109649] usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    5.117370] usb 1-2.2: Product: FT232R USB UART
[    5.122161] usb 1-2.2: Manufacturer: FTDI
[    5.126403] usb 1-2.2: SerialNumber: A101XRTQ

...

[   16.839935] usbserial: USB Serial support registered for FTDI USB Serial Device
[   16.848327] ftdi_sio 1-2.1:1.0: FTDI USB Serial Device converter detected
[   16.856781] usb 1-2.1: Detected FT232RL
[   16.977935] usb 1-2.1: FTDI USB Serial Device converter now attached to ttyUSB0
[   16.986785] ftdi_sio 1-2.2:1.0: FTDI USB Serial Device converter detected
[   16.994720] usb 1-2.2: Detected FT232RL
[   17.099914] usb 1-2.2: FTDI USB Serial Device converter now attached to ttyUSB1
[   17.108581] ftdi_sio 1-2.7:1.0: FTDI USB Serial Device converter detected
[   17.116485] usb 1-2.7: Detected FT232RL
[   17.165710] i2c 2-005c: Driver mt9v032 requests probe deferral
[   17.187561] twl4030_madc 48070000.i2c:twl@48:madc: clk disabled, enabling
[   17.228759] usb 1-2.7: FTDI USB Serial Device converter now attached to ttyUSB2
But it's not working. I don't know why.

On a older system (with kernel 2.6.34) I was simply applying these rules:

Code:
KERNELS=="2-2.1" SUBSYSTEMS=="usb" NAME="usbS1"
KERNELS=="2-2.2" SUBSYSTEMS=="usb" NAME="usbS2"
which works fine on that system, but not on this one I am working on right now (of course with the KERNELS parameters changed).

What's wrong in my rules file ?
Thank you in advance for your suggestions.

Simon

Last edited by mr.simo; 09-30-2015 at 07:03 AM.
 
Old 10-01-2015, 04:47 AM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,833

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Have you checked attribute matching carefully from the following?

Code:
udevadm info --attribute-walk --path=/sys/bus/usb-serial/devices/ttyUSB0
Code:
udevadm info --attribute-walk --path=/sys/bus/usb-serial/devices/ttyUSB1
Be careful with "ATTR" and "ATTRS" sysfs attributes. They are different.
 
Old 10-02-2015, 02:14 AM   #3
mr.simo
Member
 
Registered: Feb 2010
Posts: 78

Original Poster
Rep: Reputation: 0
Hi, I finally solved with this.

Code:
KERNELS=="1-2.1", SUBSYSTEMS=="usb", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", SYMLINK+="usbS0"
KERNELS=="1-2.2", SUBSYSTEMS=="usb", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", SYMLINK+="usbS1"
KERNELS=="1-2.7", SUBSYSTEMS=="usb", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", SYMLINK+="usbS3"
 
Old 10-02-2015, 03:32 AM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,833

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Glad to read that all is working as expected now.
 
  


Reply



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
RKHunter ASCII text in /dev/.udev/rules.d/root.rules metrx Linux - Security 2 03-07-2014 08:37 AM
[SOLVED] Missing /etc/udev/rules.d/70-persistent-net.rules - Chapter 7.2.1. Mordillo98 Linux From Scratch 5 06-11-2012 08:37 PM
Slack 13.1 : /etc/udev/rules.d70-persistent-net.rules Ramurd Slackware 10 02-18-2011 09:56 AM
cat: /etc/udev/rules.d/70-persistent-net.rules: No such file or directory rcg1984 Linux From Scratch 2 09-17-2008 07:02 AM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 03:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration