LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-09-2006, 02:22 AM   #1
garnser
Member
 
Registered: Aug 2004
Location: Sweden
Distribution: Fedora Core, OpenBSD and FreeBSD
Posts: 37

Rep: Reputation: 15
Force a USB device to use a specific /dev/ttyUSBX


Hi, I'm putting up this system to control my switches, I'm using a USB2Serial converter that I can get the id from in /proc/bus/usb/devices, there's a problem though, since it's USB it change tty device if I reboot the server that's controlling the switches and so on so I wonder if there's any way to force a specific Serialnumber from /proc/bus/usb/devices to be a specific /dev/ttyUSBX.

I'm using Fedora Core 4
 
Old 02-09-2006, 02:38 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
this would presumably be irrelevant to the usb side of the device, instead you would assign this, in fc4 at least, via the udev framework defined in /etc/udev/ to use a certain device on recognising a certain attribute of the device
 
Old 02-09-2006, 03:44 AM   #3
garnser
Member
 
Registered: Aug 2004
Location: Sweden
Distribution: Fedora Core, OpenBSD and FreeBSD
Posts: 37

Original Poster
Rep: Reputation: 15
I've succeded to map a specific usbdevice to a /dev/device but don't get how to map the device so i can use it as an tty, how do i do this?

this is the rule for the device
BUS="usb", SYSFS{serial}="FTCD6IQC", NAME="USBconverterHP2626b", SYMLINK="usbconverters/USBHP2626b"
 
Old 02-09-2006, 03:47 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
I think it's in the file /etc/udev/udev.d/static_devices.txt

Have a look at

http://www.reactivated.net/writing_udev_rules.html
http://ftp.kernel.org/pub/linux/util...tplug/udev-FAQ
 
Old 02-10-2006, 06:28 AM   #5
garnser
Member
 
Registered: Aug 2004
Location: Sweden
Distribution: Fedora Core, OpenBSD and FreeBSD
Posts: 37

Original Poster
Rep: Reputation: 15
well I came a bit but i solved it with a perlscript instead:

opendir(DIR, '/sys/class/tty/');
@files = grep { /ttyUSB/ } readdir(DIR);
closedir(DIR);

foreach (@files) {
$tmp = readpipe('udevinfo -a -p /sys/class/tty/'.$_.' | grep SYSFS{serial}==\"F');
@tmp2 = split('"', $tmp);
system('ln -s /dev/'.$_.' /dev/ttyUSB'.$tmp2[1]);
}
 
  


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
USB pilot-link under Fedora Core 3: /dev/ttyUSBx there but not there reeder.29 Linux - Laptop and Netbook 2 10-17-2005 10:25 AM
which device in /dev is mapped to an USB device malo_umoran Slackware 4 07-31-2005 01:12 PM
Failed to open device /dev/usb/ttyUSB0: No such device efm Linux - Newbie 2 04-04-2005 08:46 PM
how can usb-storage device attach to specific /dev/sd* xxie Linux - Hardware 0 05-25-2004 10:14 PM
HP Deskjet (USB) & CUPS & Slackware 9.1: Unable to open USB device "usb:/dev/usb/lp0&qu arnostienen Slackware 2 01-29-2004 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:13 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