8

I am having issues uploading to my Arduino from the IDE on Ubuntu 18.04. The error message I have received is:

Arduino: 1.6.10 (Linux), Board: "Arduino/Genuino Uno" avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied

I have checked other questions similiar to this one and have tried adding myself to the dialout group running:

sudo usermod -a -G dialout username

and added permission to write:

sudo chmod a+rw /dev/ttyUSB0

After, when I run:

ls -l /dev/ttyUSB0

I get:

crw-rw-rw- 1 username dialout 188, 0 jūl  2 16:09 /dev/ttyUSB0

However,I still get the same error message from the IDE.

Any help would be greatly appreciated!

sa_leinad's user avatar
sa_leinad
3,2182 gold badges24 silver badges53 bronze badges
askedJul 2, 2018 at 13:26
Neal's user avatar
6
  • Also have set the port in Tools to ttyUSB0CommentedJul 2, 2018 at 13:38
  • log-out and log-inarduino.cc/en/Guide/Linux#toc6CommentedJul 2, 2018 at 13:41
  • Are you sure it's /dev/ttyUSB0? Areal Arduino will be /dev/ttyACM0. Maybe yours is a cheap chinese clone?CommentedJul 2, 2018 at 15:00
  • Yeah just discovered it is a CH340G chip. Any hope of still getting it to work? Have heard of people having success on Windows but haven't found any good troubleshooting for Linux.CommentedJul 2, 2018 at 17:56
  • Were you able to make it work?CommentedSep 21, 2018 at 14:20

3 Answers3

5

Arduino has added a script to the install to fix this problem. I found it after much annoyance trying to get it to work with all these suggestions.

In the arduino-1.8.8-linuxarm.tar.xz file that you download is a script calledarduino-linux-setup.sh

run that from commandline with your user name./arduino-linux-setup.sh <username>

It'll ask for the root password, and then ask you to reboot. After that you won't have any more port trouble.

terminal

answeredFeb 17, 2019 at 3:26
Ticktok's user avatar
4

As mentioned on the officialguide for Linux, you need to run

sudo usermod -a -G dialout <username>

with the<username> replaced with the username of your system.After running this, log out and log in (or in some cases reboot the computer) and you should be good to go.

answeredJul 2, 2018 at 14:41
m.umar's user avatar
2

When you run

ls -l /dev/ttyUSB0

you have

crw-rw-rw- 1 username dialout 188, 0 jūl  2 16:09 /dev/ttyUSB0

The Problem is you havethe dev as<username>, try to change to as root

sudo chown root:dialout -R /dev/

Note:

One thing after your plug your USB, check your port with follow

ll /dev/tty*

if you can see my port as ttyUSB0 or with difference name (i.g ttyUSBx / ttyACMx ).
and then try to compile your sketch with following,

cd /path/your/arduino/installation/$ARDUINO-DIR(pwd)cd /path/your/sketch/$ARDUINO-INO/arduino --verify sketch.ino --board arduino:avr:uno --port /dev/ttyUSB0 --verbose //compile your sketch.ino with arduino uno board.

enter image description here

Hope this helps.

answeredSep 24, 2018 at 9:38
abu-ahmed al-khatiri's user avatar
1
  • You definitely SHOULD NOT change the ownership of every file under /dev aschown -R will.CommentedSep 2, 2022 at 0:52
Protected question. To answer this question, you need to have at least 10 reputation on this site (not counting theassociation bonus). The reputation requirement helps protect this question from spam and non-answer activity.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.