Difference between revisions of "Udev"

From PaparazziUAV
Jump to navigation Jump to search
m
 
Line 21: Line 21:
To actually retrigger without having to re-plug it:
To actually retrigger without having to re-plug it:
  sudo udevadm trigger
  sudo udevadm trigger
To reload the udev rules without rebooting your computer:
sudo udevadm control --reload-rules


== examples ==
== examples ==

Latest revision as of 12:59, 29 April 2016

Also see writing udev rules.

Please see paparazzi naming description for understanding why do we need udev rules.

You can get the serial number of your FTDI usb/serial converter connected to your xbee via

udevadm info --query=all --attribute-walk --name=/dev/ttyUSB0

and looking for the lines

ATTRS{manufacturer}=="FTDI"
ATTRS{product}=="FT232R USB UART"
ATTRS{serial}=="A80081ej"

where the last one would be your serial you need to write into the rules file, e.g.

# your own XBee ground modem with FTDI USB adapter (adapt serial number)
SUBSYSTEM=="tty", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A80081ej", SYMLINK+="paparazzi/xbee", GOTO="tty_FTDI232_end"


To see what udev rules would match (It may show incorrect results, because some values may be different, or not available at a simulation run.)

udevadm test --action=add $(udevadm info --query=path --name /dev/ttyUSB0)

To actually retrigger without having to re-plug it:

sudo udevadm trigger

To reload the udev rules without rebooting your computer:

sudo udevadm control --reload-rules

examples

udev rule for the floss-jtag serial interface (will then be accessible under /dev/jtag-serial)

SUBSYSTEM=="tty", ATTRS{interface}=="FLOSS-JTAG", ATTRS{bInterfaceNumber}=="01", SYMLINK+="jtag-serial"

udev rule foe the BlackMagicProbe serial interface (will then be accessible under /dev/bmp-serial)

SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic UART Port", SYMLINK+="bmp-serial"