LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2010, 06:16 PM   #31
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398

Quote:
Everything is unique now so this should work
We have tried to help you solve your problem. Meanwhile, you seem to have solved it yourself.
Good.

It might be very useful to people searching these threads on LQ for linux pl2303 udevadm etc if you posted exactly what you did to resolve your problem.

"The Devil is in the details", so the more information you can post, the better, as it will help others.

Think of it like this: "If I had found this post a week ago, my problems would have been solved, instantly".

Please post a "follow-up", with the details.

Thanks.
 
Old 08-06-2010, 11:08 AM   #32
ibwood
Member
 
Registered: Jul 2010
Posts: 46

Original Poster
Rep: Reputation: 15
Lightbulb Writing udev rules and udevadm

Please note before you start reading this, you should have all unique USB-to-serial adapters (all of different vendors). I will number the steps off on how to gather information and write udev rules:

1. Connect ALL of your adapters into the serial ports of your choosing. Type in the following command:

Code:
$ lsusb
2. Look at the output. It should look similar to this:

Code:
Bus 001 Device 002: ID 04f2:b070 Chicony Electronics Co., Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 006 Device 002: ID 050d:0109 Belkin Components F5U109/F5U409 PDA Adapter
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
The information in bold is the USB-to-serial adapters (it's usually a dead giveaway, the words "USB", "serial", "adapter" are used).

The information in red is vital to writing your udev rules. The four digits before the colon is the vendor ID number, and the four after is the product ID number.

IMPORTANT NOTE: They most likely will not be the same as yours!

3. That's all you need. Now you can start writing your rules. You NEED to follow the following commands if you wish to save the settings.

Code:
$ cd ..
$ cd ..
$ cd etc
$ cd udev
$ cd rules.d
$ sudo gedit 10-local.rules
this will open up the rules as a super-user, which is required to save system settings. The extension of the file MUST be ".rules"

4. Using the udev rules, you can identify devices and send data easy by naming ports. With the information you gathered in step 2, write the following in your local.rules file:

Code:
SUBSYSTEM=="desired_subsystem", ATTRS{idVendor}=="your_vendor_num", ATTRS{idProduct}=="your_product_num", SYMLINK="your_device_name"
This is only one rule. The computer looks at the two IDs provided and matches them with the appropriate USB-serial adapter. If you are writing more than one rule, you HAVE to write the others on separate lines. Writing all of your rules on one line will not work.

5. This step is optional, but very helpful. If you want to name kernels and are also wondering how I got the "ATTRS" prefixes on the IDs, then type in the following command:

Code:
$ udevadm info -a -p  $(udevadm info -q path -n /dev/ttyUSB0)
This will list all of the attributes (ATTRS), as well as the parent devices for your USB ports, however only one adapter can be plugged in at once. If you want to be more specific on writing your udev rules, you can take information from the output of this code (exactly how it reads). The other useful output of this command is telling you the number of the serial port you are using with your adapter.

Sometimes the vendor and product IDs are the same, but have other varying information. If you run into this problem, the easiest way to get around it is to simply buy another adapter of a different vendor. Then the product and vendor IDs will be unique.

6. SAVE YOUR RULES. Now you can communicate with your device(s) using code that you create. Good luck!

Ian

Last edited by ibwood; 08-11-2010 at 11:40 AM.
 
Old 08-06-2010, 11:44 AM   #33
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Thanks for the follow-up.
 
Old 08-11-2010, 11:43 AM   #34
ibwood
Member
 
Registered: Jul 2010
Posts: 46

Original Poster
Rep: Reputation: 15
The instructions have been edited. The file required for hacking the usb ports is 10-local.rules, and the SUBSYSTEM category is required in writing the rules.

Regards,
Ian
 
  


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
Fedora 10 com1 port will not connect to router console port using minicom rgjr979 Linux - Newbie 4 12-28-2009 06:35 PM
Toshiba Satellite USB does not work kaz2100 Linux - General 1 04-09-2005 08:09 PM
Toshiba Sattelite ext usb modem problem (no serial port) denzel Linux - Hardware 4 09-24-2003 03:19 AM
Toshiba Satellite bigredgiant1 Red Hat 8 09-02-2003 10:11 PM
Toshiba Satellite teamstatic84 Linux - Laptop and Netbook 1 07-21-2003 05:50 AM


All times are GMT -5. The time now is 04:28 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration