Changing permissions on serial port

Solution 1:

The issue with the permissions for /dev/ttyACM0 can be permanantly solved by adding yourself to the dialout group.

You can do this with:

  1. sudo usermod -a -G dialout $USER

  2. Logout and then log back in for the group changes to take effect.

Solution 2:

I couldn't get Rinzwind's suggestion to work, because it complained that the user account already exists. Instead, I used this command to add an existing user (terrik) to an existing group (dialout), as described on the Ubuntu Help Wiki.

sudo adduser terrik dialout

Also useful is this command for listing your current groups, although as Rinzwind says, you have to log out and log in before the serial port starts letting you in.

groups terrik

Solution 3:

Another possibility is to make a rules file in /etc/udev/rules.d/ directory. I had similar problem and I have created 50-myusb.rules file in the above directory with this content:

KERNEL=="ttyACM[0-9]*",MODE="0666"

Note that this will give any device connected to ttyACM socket read/write permissions. If you need only specific device to get read/write permissions you must also check idVendor and idProduct. You can find those by running lsusb command twice, once without your device connected and once when it is connected, then observe the additional line in the output. There you will see something like Bus 003 Device 005: ID ffff:0005. In this case idVendor = ffff and idProduct = 0005. Yours will be different. Than you modify the rules file to:

ACTION=="add", KERNEL=="ttyACM[0-9]*", ATTRS{idVendor}=="ffff", ATTRS{idProduct}=="0005", MODE="0666"

Now only this device gets the permissions. Read this to know more about writing udev rules.

Solution 4:

I couldn't get Terrik's answer working, but I could if I made this slight adjustment to the path for ttyACM0.

sudo chmod 666 /dev/ttyACM0

Would post as a comment but I don't have the privileges for that yet...