Quote:
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. |
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 Code:
Bus 001 Device 002: ID 04f2:b070 Chicony Electronics Co., Ltd 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 .. 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" 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) 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 |
Thanks for the follow-up.
|
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. |