LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   USB port non-responsive on Toshiba Satellite L450 (minicom) (https://www.linuxquestions.org/questions/linux-newbie-8/usb-port-non-responsive-on-toshiba-satellite-l450-minicom-821306/)

tredegar 08-05-2010 05:16 PM

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.

ibwood 08-06-2010 10:08 AM

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

tredegar 08-06-2010 10:44 AM

Thanks for the follow-up.

ibwood 08-11-2010 10:43 AM

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


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