LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 08-31-2012, 02:40 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
udev: how to rename a device from a usb dongle that creates 3 devices?


Hi!

I want to rename what in my host is set up as /dev/ttyUSB0 when I plugin my usbdongle to something like: /dev/modemWhatever

I know this is done with udev rules however I want to know how to tell each of the 3 devices from each other.

The device creates 3 ttyUSBx devices: ttyUSB0, 1 and 2.

When I request for information from them to udevadm I see the same information for all of them so I can't really tell which is which.

Code:
$ udevadm info --query=all --path=/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.0
P: /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.0
E: DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.0
E: DEVTYPE=usb_interface
E: DRIVER=option
E: INTERFACE=255/255/255
E: MODALIAS=usb:v12D1p14ACd0000dcEFdsc02dp01icFFiscFFipFF
E: PRODUCT=12d1/14ac/0
E: SUBSYSTEM=usb
E: TYPE=239/2/1
E: UDEV_LOG=3

$ udevadm info --query=all --path=/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.3
P: /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.3
E: DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.3
E: DEVTYPE=usb_interface
E: DRIVER=option
E: INTERFACE=255/255/255
E: MODALIAS=usb:v12D1p14ACd0000dcEFdsc02dp01icFFiscFFipFF
E: PRODUCT=12d1/14ac/0
E: SUBSYSTEM=usb
E: TYPE=239/2/1
E: UDEV_LOG=3

$ udevadm info --query=all --path=/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.4
P: /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.4
E: DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5:1.4
E: DEVTYPE=usb_interface
E: DRIVER=option
E: INTERFACE=255/255/255
E: MODALIAS=usb:v12D1p14ACd0000dcEFdsc02dp01icFFiscFFipFF
E: PRODUCT=12d1/14ac/0
E: SUBSYSTEM=usb
E: TYPE=239/2/1
E: UDEV_LOG=3
Thanks in advance.
 
Old 08-31-2012, 06:26 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
The basic documentation for creating rules can be found here:

http://www.reactivated.net/writing_udev_rules.html

In essence you just need to find something unique about each of the devices to match against, and set up an action for it. I recommend not trying to change the original device name though, just create a symlink to it with the name you want.

If you can't find anything unique, then I don't think it's possible to set up completely-fixed devices for them. From what you've posted so far, it seems that only the device path is different. If they always get created in the same order, perhaps you could use that.

(Full disclosure: I have not yet set up anything like this myself, I've only done a bit of playing around with it.)

Last edited by David the H.; 08-31-2012 at 06:33 PM. Reason: small addition
 
  


Reply

Tags
dongle, kernel, serial, udev, usb


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
[SOLVED] usb dongle / udev-rule toredo Linux - Hardware 2 05-02-2012 05:04 PM
one GSM/GPRS/3G usb stick modem creates 3 usb serial devices radu.pop Linux - General 2 07-16-2010 02:32 AM
[SOLVED] Udev creates the external usb hard disk device node too late pastoreerrante Linux - Software 2 05-24-2010 01:42 AM
Automating detection of Internet USB dongle via udev Sylvester Incognito 5 07-03-2009 11:02 PM
Pairing Bluetooth devices - dongle can't see device? Mark_667 Ubuntu 1 05-11-2007 05:18 PM


All times are GMT -5. The time now is 02:14 AM.

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