Permission Denied when uploading a program to my Arduino

If you just started playing with Arduino on Linux, you may have run into an error uploading your very first program, similar to the following:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device
Problem uploading to board. See for suggestions.

Your Arduino is mapped to a character device file called /dev/ttyACM0 and it looks like the IDE does not have permission to write to it. That’s essentially the problem and the fix is simple enough.

Open up a terminal and follow these commands. First let’s figure out what the current permissions are on this file.

ls -lah /dev/ttyACM0

You should get output similar to the following:

crw-rw---- 1 root dialout 166, 0 Feb 28 10:47 /dev/ttyACM0

What this shows us is that the owner (root) has read and write permissions, the group (dialout) has read and write permissions and others have no permissions at all. The fix is to let others have read and write permission so that your IDE can upload the program.

sudo chmod 666 /dev/ttyACM0

As demonic as that permission code looks like, it is actually just giving everyone read and write permission for this file.

If you run the ls command again, you should see that the permissions have changed:

crw-rw-rw- 1 root dialout 166, 0 Feb 28 10:56 /dev/ttyACM0

I don’t know what the user is when the IDE tries to upload, but if you do, please leave a comment!

You should now be good to upload your sketch to your Arduino.

My Top 5 Mistakes in Ubuntu

Ubuntu Logo

While I love using Ubuntu, I’ve made my share of (sometimes disastrous) mistakes while using it and wanted to share them so no one else falls down the same dark paths that I have walked.

5. Not using the Long Term Support (LTS) Versions

Each version of Ubuntu just keeps getting better and better, but sometimes upgrading to the latest version isn’t the best choice. If you don’t have a lot of patience (or a slow internet connection) this could be problematic as an upgrade could take several contiguous hours, which not everyone can spare. Then of course there are the problems upgrading from one version to another, such as certain programs not working correctly or packages being corrupted, etc. Avoid it all by just sticking to the LTS versions. You’re not missing anything important by playing it safe; rather, you’re saving yourself hours of headache because you’ll only need to update every 5 years instead of every 6 months.

4. Using the command line for something that could have been done through the GUI easily

Learning how to use the command line is important, but if you know your stuff already it’s better to just take the GUI route when you can. Why? The GUI is usually robust enough to avoid making the mistakes you’d make if you were allowed free access to the guts of your Linux distro. The Software Center already knows everything that is has to do, so there is no guess work and no need to cross your fingers. A single mis-typed character on the command line could send your entire computer into utter chaos and you’d never know why.

Continue reading