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 http://www.arduino.cc/en/Guide/Troubleshooting#upload 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.

How to install Swift on Ubuntu and add syntax highlighting for Sublime Text

I recently started teaching myself Swift, the new Open Source Language from Apple that powers their latest iOS and MacOS apps. In this article, I’ll go over how I installed it on Ubuntu 14.04 and how I got Sublime Text 2 to recognize it’s syntax. Note that there may be better and more comprehensive ways of doing this, I’m just posting what worked for me. If you have any suggestions to improve this, please be sure leave a comment.

Directions adapted from this post.

Start by clicking here and downloading the latest snapshot for Linux. For me it was called Ubuntu 14.04 Swift Development Snapshot, posted on Feb 3, 2016.

Continue reading