Udev fix for Linux permission problem

We were pleasantly surprised to receive our Joulescope yesterday. It looks great (even coming with custom packing tape and case), and worked well once I fixed a problem with permissions on my Ubuntu 18.04.1 LTS Linux system.

It initially didn’t work (complained of being unable to open the USB port), then when I ran the app as root it worked. I’d installed the provided udev 99-joulescope.rules file and restarted udev previously.

I fixed this issue by editing the rules file to add , GROUP="plugdev" to each of the two rules so they looked like this:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0e88", MODE="0666", GROUP="plugdev"

Then I restarted udev as before.

2 Likes

Thank you @nedkonz for sharing your experience, and welcome to the forum! Sorry to hear that you ran into an issue, but great that you were able to fix it! I am a little confused as to why it worked though. The original udev rule grants Joulescope read/write access to everyone, so the GROUP specification shouldn’t matter.

If you have a moment, I would be interested in knowing the resulting permissions on your computer. You need to issue two commands:

$ lsusb -d 16d0:0e88
$ ls -al /dev/bus/usb/{bus}/{device}

Replacing {bus} and {device} with the values returned by lsusb. On my system, I see:

$ lsusb -d 16d0:0e88
Bus 002 Device 021: ID 16d0:0e88 MCS
$ ls -al /dev/bus/usb/002/021
crw-rw-rw- 1 root root 189, 148 Jun 26 19:07 /dev/bus/usb/002/021

root is the owner with read/write permissions, root is the group with read/write permissions and everyone has read/write permissions. I would expect your rules to generate the same permissions, except the group should be plugdev. However, the behavior you described indicates 0660 permissions were applied instead.

I agree that it’s better security practices to grant 0660 permissions, assign a GROUP and ensure that your account is part of that group, but it also means that I would also have to ask people to do:

sudo usermod -a -G plugdev `whoami`

and then log out and back in again. I will add , GROUP="plugdev" to the rules regardless and add comments for how to add users to the plugdev group. Here is what I added:

# This file grants everyone read/write access.  If you want to restrict access,
# you should modify MODE to "0660".  You can then grant access to specific user
# accounts by adding them to the plugdev group.  To grant yourself permission:
#
#    sudo usermod -a -G plugdev `whoami`
#
# You will have to log out and then back in for the group change to take effect.
# To grant permission to a specific {user}:
#
#    sudo usermod -a -G plugdev {user}
#
# replacing {user} with the actual username.

Thanks again, and I hope that you enjoy using your Joulescope!

1 Like

Hi @mliberty,
Here’s what I get:

ned@ned-dt0060:~$ lsusb -d 16d0:0e88
Bus 001 Device 018: ID 16d0:0e88 MCS 
ned@ned-dt0060:~$ ls -al /dev/bus/usb/001/018
crw-rw-rw- 1 root plugdev 189, 17 Jul  1 09:22 /dev/bus/usb/001/018

Thanks @nedkonz! That’s what I would expect with everyone having rw permissions. I’m not sure why adding the group made a difference for you, but great that you are up and running!