avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied

Hi All
I'm new to Linux Mint and am having trouble connecting to my Uno board this is the error message I get: avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied. IDE sees the board but can't connect to it.

Is there a setup in Linux that I have to change that grants permission to a device to connect to the USB port?

Thanks
Joe

1 Like

In a terminal, with the board plugged in, enter and run:
Note: -l is lowercase L, not 1
ls -l /dev/ttyUSB*

This will show the group that has access to the port.

Example: crw-rw-r-- 1 root dialout ... /dev/ttyUSB0, root is owner, dialout is the group with access.

Running the command, groups or id, in a terminal will show the groups you belong to.

sudo adduser YourUserName GroupToJoin Will fix things if you need to join a group, logout and login after you run adduser.

1 Like

Hi tf68

Thank you for responding I have tried what you had suggested but may not have the syntax correct, please see below, your help is greatly appreciated.

Here is what I have tried in the terminal:

marine@linux-mint-desktop:~$ ls -l /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Jul 29 17:16 /dev/ttyUSB0
marine@linux-mint-desktop:~$ sudo adduser marine /dev/ttyUSB0
adduser: The group /dev/ttyUSB0' does not exist. marine@linux-mint-desktop:~$ sudo adduser marine 188 adduser: The group 188' does not exist.
marine@linux-mint-desktop:~$ sudo adduser marine 1
adduser: The group 1' does not exist. marine@linux-mint-desktop:~$ sudo adduser marine 188 0 adduser: Only one or two names allowed. marine@linux-mint-desktop:~$ sudo adduser marine 188,0 adduser: The group 188,0' does not exist.
marine@linux-mint-desktop:~$ sudo adduser marine /dev/ttyUSB0
adduser: The group /dev/ttyUSB0' does not exist. marine@linux-mint-desktop:~$ id uid=1000(marine) gid=1000(marine) groups=1000(marine),4(adm),5(tty),24(cdrom),27(sudo),30(dip),46(plugdev),112(lpadmin),127(sambashare) marine@linux-mint-desktop:~$ sudo adduser marine 188(/dev/ttyUSB0) bash: syntax error near unexpected token ('
marine@linux-mint-desktop:~$ sudo adduser marine 188 /dev/ttyUSB0
adduser: Only one or two names allowed.

This is the message from the IDE program:

Sketch uses 930 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied
An error occurred while uploading the sketch

Try this:

sudo adduser marine dialout
1 Like

Thank you

But receiver the same error from the IDE app.

marine@linux-mint-desktop:~$ sudo adduser marine dialout
[sudo] password for marine:
Adding user marine' to group dialout' ...
Adding user marine to group dialout
Done.
marine@linux-mint-desktop:~$

Pert

I think your suggestion would have worked if I had logged out and then logged backed in, I tried the following and then I logged out and logged back in and it now works, thanks for your help.

sudo usermod -a -G tty marine
sudo usermod -a -G dialout marine

1 Like

Thanks to everyone who helped out, I'm all set now

Regards
Joe