Skip to content

Commit 15929bb

Browse files
authored
Expand udev rule documentation (#362)
1 parent a300bc0 commit 15929bb

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

docs/getting-started/connecting-devices.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,38 @@ has this capability is the JetBlack Victory.
6060
1. Allow rootless access to the USB device by creating a udev rule:
6161

6262
```console
63-
foo@bar:~$ sudo echo 'ACTION=="add|change", SUBSYSTEM=="usb|tty", ATTRS{idVendor}=="393c", ATTRS{idProduct}=="0006", MODE="0660", GROUP="plugdev", TAG+="uaccess"' > /etc/udev/rules.d/99-jetblack-victory.rules
63+
foo@bar:~$ sudo echo 'ACTION=="add|change", SUBSYSTEM=="usb|tty", ATTRS{idVendor}=="393c", ATTRS{idProduct}=="0006", MODE="0660", GROUP="dialout", SYMLINK+="jetblack_victory", TAG+="uaccess"' > /etc/udev/rules.d/71-jetblack-victory.rules
6464
foo@bar:~$ sudo udevadm control --reload-rules
6565
foo@bar:~$ sudo udevadm trigger
6666
```
6767

68-
If you are not using a JetBlack Victory, change the vendor id and product id attributes to the USB VID/PID of your device.
68+
- `ACTION=="add|change` -- Trigger the rule if a device is added or its properties changed.
69+
- `SUBSYSTEM=="usb|tty"` -- We are only interested in USB and tty devices.
70+
- `ATTRS{idVendor}=="393c"` -- The USB vendor identifier. If you are not using a JetBlack Victory, change this to your
71+
trainer's USB vendor id.
72+
- `ATTRS{idProduct}=="0006"` -- The USB product identifier. If you are not using a JetBlack Victory, change this to your
73+
trainer's USB product id.
74+
- `MODE="0660"` -- Allow read and write access to the device owner and assigned group.
75+
- `GROUP="dialout"` -- The group to assign to the USB device. This value is different for most Linux distributions. To figure
76+
out the correct group, look at `ls -l /dev/tty*`. On Fedora the group is `dialout` or `plugdev`, on Arch Linux the group is
77+
`uucp`. Also make sure your user is a member of the correct group `sudo usermod -aG dialout $USER`. Adding a group is not
78+
needed if your system supports the `uaccess` mechanism.
79+
- `SYMLINK+="jetblack_victory"` -- Your device is assigned a filename such as `/dev/ttyACM0`. It is possible that your device
80+
gets a different number, for example `/dev/ttyACM1`. If you are not using a JetBlack Victory, it is also possible that your
81+
device is recognized as `/dev/ttyUSB0`. The number can also change if you have multiple USB devices connected. To make it
82+
easier to refer to the device, you can assign an extra name to it. You can then refer to your device using
83+
`/dev/jetblack_victory` instead of having to figure out the correct filename.
84+
- `TAG+="uaccess"` -- Make the device accessible to all logged-in users.
85+
- `/etc/udev/rules.d/71-jetblack-victory.rules` -- The filename to use for the udev rule. For the `uaccess` tag to work, the
86+
number at the start of the filename has to be less than 73. It is recommended to use 71.
6987

7088
2. Pass the USB device to the netbrain/zwift container using the
7189
[CONTAINER_EXTRA_ARGS](../../configuration/options/#container_extra_args) configuration option:
7290

7391
```bash
74-
CONTAINER_EXTRA_ARGS=(--device=/dev/ttyACM0)
92+
CONTAINER_EXTRA_ARGS=(--device=/dev/jetblack_victory)
7593
```
7694

77-
It is possible that your device gets a different number, for example `ttyACM1`. If you are not using a JetBlack Victory,
78-
it is also possible that your device is recognized as `ttyUSB0`.
79-
8095
3. On the Zwift pairing screen, use the USB option when connecting your trainer. Read the
8196
[JetBlack Victory Adds USB Connection Support][jetblack-victory-usb] Zwift Insider article for detailed instructions.
8297

0 commit comments

Comments
 (0)