With an STM32 disco board connected to Ubuntu 16.04, the command
dfu-util -l
results in the error
dfu-util: Cannot open DFU device 0483:df11
However, it does work correctly when using 'sudo' as in
sudo dfu-util -l
As per #15, I tried adding the 'udev' rule from the dfu-util source, by doing this command:
sudo cp ~/repos/dfu-util/doc/40-dfuse.rules /etc/udev/udev/rules.d
This did not change the behaviour, not even after rebooting. The rule in question is:
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="664", GROUP="plugdev"
The problem seemed to be that my user account did not belong to the group 'plugdev' (the groups to which a user belongs can be listed via the command groups $USER
). To add my user to the group I executed:
sudo adduser $USER plugdev
Then I rebooted (perhaps enough to just log out and login again). Success: After this I no longer need to use 'sudo'.
This issue can be closed from my point of view, just thought it'd be good to report how I solved it.
Perhaps the file doc/40-dfuse.rules could contain a comment about user needing to belong to the group 'plugdev'.
Cheers,
Christian
Anonymous
Yes, good suggestion. The plugdev group used to be a standard for the desktop user, but maybe not any longer (sigh, I wish the Linux desktop were a stabler environment). Which groups are in by default on 16.04?
I got Xubuntu 16.04 installed on my desktop and plugdev is still valid with those udev rules. One thing that I notice with Xubuntu 16.04 on Chromebook though, I had to modify the permission from 664 to 666 for no apparent reason. I didn't have to add user to plugdev group manually.
I recently also installed Ubuntu 16.04 on a laptop and I should be able to check if plugdev is still valid or not on this machine.
Last edit: Ekawahyu Susilo 2016-06-15
Yes, if you set permissions to 666 (write access for world) it doesn't matter what groups anyone is in.
So, which groups are default on Ubuntu 16.04 (not Xubuntu)?
To whom was the last question by Tormod addressed?
Well, to any of you, since you both have Ubuntu 16.04, although I initially asked you in my first comment here.
I tested creating a user called "testuser" from the command line:
I did this also using some graphical tool with the same result. The very
first user that's created during installation of Ubuntu must be added to
some additional groups like 'sudoers', but it's not the case for users
added later. I don't know if my user account was created during
installation or later, so it's not conclusive that my account didn't belong
to 'plugdev'.
So my suggestion is that the documentation mentions that the user should
check that he belongs to 'plugdev'.
/Christian
[removed quoted mail message]
Last edit: Tormod Volden 2017-06-03
I would hesitate to recommend less-secure solutions in the documentation.
As such: recommending to add a dfu-util user to plugdev may have consequences you can't anticipate.
So, for documentation I would recommend we write:
The sample udev rules file doc/40-dfuse.rules now includes the uaccess tag so it should work also without the plugdev group.
However, Roger's advice still applies.