Go Down

Topic: Help fixing device permissions for A000092 usb programmer board, in Ubuntu (Read 2178 times) previous topic - next topic

protomoose

The problem seems to be that the device permissions are not being correctly set by udev when the board is plugged into the pc's usb connector.

If I run the Arduino IDE as root, it lets me use the ISP R3 usb programmer board. Not convenient for sketchbook management!

I can temporarily fix this problem by opening terminal, and typing

Code: [Select]
lsusb

to bring up a list of attached usb devices, then type

Code: [Select]
sudo chmod 666 /dev/bus/usb/006/005

(or whatever the bus/device number happens to be at the time), which lets me as an ordinary user write to the device from the IDE. So for now, I keep using this temporary fix.

Meanwhile, I have tried following the instructions at https://andreasrohner.at/posts/Electronics/How-to-fix-device-permissions-for-the-USBasp-programmer/ , in order to make a udev rule that should fix this, but no success yet.

I have created a new file called /etc/udev/rules.d/99-USB_ISP_R3.rules , which reads like this:

Code: [Select]
# UDEV rule for Arduino ISP R3 programmer board,
# to prevent having to run Arduino IDE as root to get it to program.
# Copy this file to /etc/udev/rules.d so

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0C9f", MODE="0666"


and executed
Code: [Select]

gpasswd -a <username> uucp


but to no avail; I still have to use the temporary fix.

Please can anyone shine some light on this problem? Is there a patch for this anywhere?

Thanks, Matt.

Budvar10

Try to use this rule
Code: [Select]
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0C9f", GROUP="plugdev", MODE="0666"
You have to add user into plugdev group.
Restart udev service
# service udev restart
# udevadm control --reload-rules
Disconnect/reconnect device and it should work.



Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

protomoose

Thanks Budvar10 for replying.

I've changed the rule as you suggested, added my username to the plugdev group, restarted the udev process, and even rebooted.

Sadly, the problem still remains:

Code: [Select]
avrdude: Warning: cannot open USB device: Permission denied
avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)


So it's back to the temporary patch for now...  :smiley-confuse:

Budvar10

Rule file has to be readable by all users [-rw-r--r-- 1 root root]. Make sure that the user is in the group (id command).
Which OS do you use?
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

protomoose

Thanks for your persistence; I've checked your points above and the problem remains.

Here's the rule file listed in /etc/udev/ruled.d/* :

Code: [Select]
-rw-r--r-- 1 root root  371 Mar 21 13:03 99-USB_ISP_R3.rules

Should it be named differently, I wonder?

My username is in the group plugdev.

I'm using Ubuntu 14.04 LTS.

Thanks again.

Budvar10

Hmm, hard to say. You should check the syslog and others. I'm not sure about the rule file name, I know that the number is required and means the order of use and also suffix .rules is required. Maybe underscore in the name is the problem? I'm usiing the same for the USBasp on Mint and it works for me fine but have no experience with the Arduino ISP R3. SYSFS parameter is deprecated in newer lnxs and ATTRS have to be used instead. Try to read this http://playground.arduino.cc/Linux/All.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

kprims

This is working for me on Linux Mint 17.3 using Arduino  IDE 1.6.7.
I have two different USBtiny Programmer, one uses the 6 and 10 lead cable and the other uses 6 leads and a micro usb connection.
Both identify as:
Code: [Select]
lsub
Code: [Select]
Bus 009 Device 009: ID 1781:0c9f Multiple Vendors USBtiny

Code: [Select]
/etc/udev/rules.d/99-USBtiny
Code: [Select]
SUBSYSTEM=="usb", ATTR{idVendor}=="1781", ATTR{idProduct}=="0c9f", GROUP="adm", MODE="0666"

kprims


Go Up