howto:set_symlinks_for_usb_serial_ports
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | howto:set_symlinks_for_usb_serial_ports [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Why? ====== | ||
+ | |||
+ | You might have multiple serial/USB converters connected to your box. And you would like to make sure that device focuser is at / | ||
+ | |||
+ | Recent Linux distributions uses udevd for assigning names to devices. There is a lot of documentation, | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | You do not read it fully, there are important parts in steps: | ||
+ | |||
+ | * plug the device | ||
+ | * run dmesg to see which port was created | ||
+ | * run (as root, or using sudo): | ||
+ | < | ||
+ | root@host: | ||
+ | |||
+ | Udevadm info starts with the device specified by the devpath and then | ||
+ | walks up the chain of parent devices. It prints for every device | ||
+ | found, all possible attributes in the udev rules key format. | ||
+ | A rule to match, can be composed by the attributes of the device | ||
+ | and the attributes from one single parent device. | ||
+ | |||
+ | looking at device '/ | ||
+ | KERNEL==" | ||
+ | SUBSYSTEM==" | ||
+ | DRIVER=="" | ||
+ | |||
+ | looking at parent device '/ | ||
+ | KERNELS==" | ||
+ | SUBSYSTEMS==" | ||
+ | DRIVERS==" | ||
+ | ATTRS{latency_timer}==" | ||
+ | ATTRS{port_number}==" | ||
+ | </ | ||
+ | * the text says all. Find some unique parameters in some parent device (but only one!). The good guesses are usually serial numbers etc. Then compose udev rule, and add it to / | ||
+ | |||
+ | < | ||
+ | SUBSYSTEMS==" | ||
+ | </ | ||
+ | |||
+ | Of course change xxxx to what you get with udevadm. | ||
+ | * You might need to restart udev, but just unplugging and replugging device should be enough. | ||
+ | |||
+ | ====== When something fails ====== | ||
+ | |||
+ | |||
+ | When you need to debug udev, the best to do is to run udevd in debug mode. As root, do | ||
+ | |||
+ | < | ||
+ | root@host: | ||
+ | root@host: | ||
+ | 1288130388.961886 [26940] udev_device_new_from_syspath: | ||
+ | </ | ||
+ | |||
+ | The udevd will print messages when you connect and disconnect devices - which rules are applied, ... Most of them are easy to decode. | ||
howto/set_symlinks_for_usb_serial_ports.txt · Last modified: 2011/08/04 00:00 (external edit)