Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update udev rules #572

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions microbit/src/03-setup/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,30 @@ These rules let you use USB devices like the micro:bit without root privilege, i
Create this file in `/etc/udev/rules.d` with the content shown below.

``` console
$ cat /etc/udev/rules.d/99-microbit.rules
$ cat /etc/udev/rules.d/69-microbit.rules
```

``` text
# CMSIS-DAP for microbit
SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", ATTR{idProduct}=="0204", MODE:="666"

ACTION!="add|change", GOTO="microbit_rules_end"

SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", ATTR{idProduct}=="0204", TAG+="uaccess"

LABEL="microbit_rules_end"
```

Then reload the udev rules with:

``` console
$ sudo udevadm control --reload-rules
$ sudo udevadm control --reload
```

If you had any board plugged to your computer, unplug them and then plug them in again.
If you had any board plugged to your computer, unplug them and then plug them in again, or run the following command.

``` console
$ sudo udevadm trigger
```

Now, go to the [next section].

Expand Down
24 changes: 20 additions & 4 deletions microbit/src/03-setup/verify.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,36 @@ $ # ^^^ ^^^
```

In my case, the micro:bit got connected to the bus #1 and got enumerated as the device #65. This means the
file `/dev/bus/usb/001/065` *is* the micro:bit. Let's check its permissions:
file `/dev/bus/usb/001/065` *is* the micro:bit. Let's check the file permissions:

``` console
$ ls -l /dev/bus/usb/001/065
crw-rw-rw-. 1 root root 189, 64 Sep 5 14:27 /dev/bus/usb/001/065
crw-rw-r--+ 1 nobody nobody 189, 64 Sep 5 14:27 /dev/bus/usb/001/065
```

The permissions should be `crw-rw-rw-`. If it's not ... then check your [udev
The permissions should be `crw-rw-r--+`, note the `+` at the end, then see your access rights by running the following command.

``` console
$ getfacl /dev/bus/usb/001/065
getfacl: Removing leadin '/' from absolute path names
# file: dev/bus/usb/001/065
# owner: nobody
# group: nobody
user::rw-
user:<YOUR-USER-NAME>:rw-
group::rw-
mask::rw-
other::r-
```

You should see your username in the list above with the `rw-` permissions, if not ... then check your [udev
rules] and try re-loading them with:

[udev rules]: linux.md#udev-rules

``` console
$ sudo udevadm control --reload-rules
$ sudo udevadm control --reload
$ sudo udevadm trigger
```

# All
Expand Down
Loading