A Tip About Fixing the "USB Device: Permission Denied" Error (Linux Based Systems)

I was stuck in the Arduino IDE getting the following error:

avrdude: Warning: cannot open USB device: Permission denied

I searched all throughout the Move38 + Arduino Forums and could not find a working solution.

The Arduino Forum had suggested to add permissions to the user you were using. I tried that and it did nothing.

Just by chance, I was tired and decided “There’s nothing to lose, why not just try again?”

I ran *sudo* arduino rather than arduino, and it actually worked!

(It gave the Arduino IDE the correct permissions to access the serial port regardless)

In the end, I was able to upload code through the programmer.

I decided to post it here because there is no fully-defined/working solution, and because I thought other people might have had the same problem.

-ShatteredDisk

4 Likes

You should not do that. The right solution is to give the correct udev permissions to a specific group that you can add users to and those users would then have the correct access rights.

http://www.krekr.nl/content/using-usbtinyisp-with-ubuntu/

3 Likes

This can be extrapolated for other Linux distributions.

If you did it like described on that link and it did not work, it is most likely because your dev-kit for some reason has different vendor/device ids. Can you post the output of lsusb when the dev kit is connected?

Your method, unfortunately, is a security risk. Even without a malicious actor involved, it could result in bad things simply because Arduino is running as root (like you mistakenly overwriting the wrong file). It is great that it worked for you but, as I said, you should not do that. For your own sake.

Hmmm… It actually matches the ids from the link I posted. At the next opportunity I will see how the device is setup in my machine and you can compare to yours and check if anything is different.