Problem Using Udev Rule
Hello,
I am using headless Ubuntu 11.04 running on BeagleBoard XM. Everytime i reboot the system ttyUSB[x] port_number change i want to use that port number in my C program for particular device. Is it possible in udev rule so that we assign (ttyUSB[x]) the value of x for particular device. Whenever I connect usb to any port it will assign the port number that i have given. if it is possible please help me with the code...... |
I suppose your /dev/ttyUSB* comes from minicom serial port, which will very from time to time.
And I fear we can't handle this from udev rules. But you can initialte your code from some script: Code:
Your script : |
Hi.
I'm not very familiar with udev, so there may be inaccuracies. First you need to find a pair of numbers idVendor:idProduct which correspond to your usb device (such as usb-tty converter). Say, I have a Logitech usb mouse and I want udev to create /dev/logitech_mouse each time I plug it in. To identify the device, type Code:
$ lsusb Now, to create udev rule I open /etc/udev/rules.d/99-local.rules and put there something like this Code:
# Logitech mouse, example Code:
sudo /etc/init.d/udev restart EDIT: Note that udev rules cannot span multiple lines. |
Quote:
|
All times are GMT -5. The time now is 02:25 PM. |