I am using Thonny to program microcontrollers plugged into a usb slot. After a recent upgrade (sorry, not sure when) Thonny can no longer connect to the device as it has insufficient permissions. I have created a udev rules file that looks like this
and added myself to the plugdev group
then rebooted.
I thought this was all I had to do to allow myself to access the usb devices.
If I do sudo chmod 666 /dev/ttyUSB0 then Thonny can access the device.
What else do I need to do to allow Thonny to access the device without having to manually chmod?
Thanks.
I don’t know Thonny, but looking at your screenshots my first guess would by that your rules are beeing overwritten by some shipped ones.
In my understanding rules are applied in alphabetical order. Try renaming the file to 99-usb-permissions.rules - maybe that’s all.
If not, you can try running udevadm test /dev/ttyUSB0. This should show you how udev reasons about applying rules to that device.
Also: by using only SUBSYSTEM==”usb” as qualifier, that rule would apply to all usb-devices, which is probably not what you want. udevadm info --attribute-walk /dev/ttyUSB0 will show you all attributes of the device, which you can use to make the rule more specific.
EDIT: sudo udevadm control --reload should apply new rules without rebooting
@aguzinski thanks for the reply. Renaming the rules file did it. It now works.
I tried looking at some other criteria to add to the rule to restrict it, but got lost very quickly. udev rules are a lot more complex than I thought! I found an attribute called DEVNAME which looked perfect (it’s /dev/ttyUSB0 for this device, and /dev/ttyACM0 for some others I have) but when I put it in the rule it didn’t work.
Thanks, Ian
Glad it works 
I would consider anything with “/dev/” to be unstable anyway (might point to a different device if you plug in new hardware). Maybe it has not been created at the time udev applied the rules.
If you want to give it another try, I suggest a combination of Vendor & Product (if your device supports these attributes).