FRC900 / 2017VisionCode

2017 Competition Code
9 stars 3 forks source link

make the chmod of /dev/ttyACM0 on startup #2

Open anja-sheppard opened 7 years ago

kjaget commented 7 years ago

This is done by adding a line to the file /etc/udev/rules.d/10-local.rules. The format per device is something like :

ACTION=="add", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", SYMLINK+="symlink_name"

The ATTRS fields can be found by running the following when a device is connected :

udevadm info -a -p $(udevadm info -q path -n /dev/ttyACM0)

The symlink makes a /dev/symlink_name entry in /dev linked to the appropriate /dev/tty* node.

After editing the /etc/udev/rules.d/10-local.rules file, run

sudo udevadm trigger

to reload the rules (should also be picked up on reboot).

There's already a 10-local.rules file in the root of the 2017Preseason repo with a NAVX define. Add a rule for the px4 to this, and the lidar as well. Have each use a unique symlink. Keeping the file in the repo makes it easy to set up other machines - just copy the file over and run udevadm trigger.

Update launch files to look for the symlink rather than /dev/ttyACMx or /dev/ttyUSBx.

kjaget commented 7 years ago

More importantly, move this issue over to 2017Preseason (or the tasks repo) since the 2017VisionCode repo is kinda dead at this point