4

I've installed Arduino but as the title says, I can only upload with sudo. And yes my user is part of the dialout group so that's the weird thing.

Arduino did function before on my system. What could be wrong?

Output ls -l:

ls -l /dev/ttyUSB*
crw-rw-rw- 1 root dialout 188, 0 apr  2 09:23 /dev/ttyUSB0
Sergiy Kolodyazhnyy
  • 103,293
  • 19
  • 273
  • 492
Sjors123
  • 41
  • 2

1 Answers1

1

As shown in the output of your ls command, /dev/ttyUSB0 and all similart tty device files all belong to dialout group.

crw-rw-rw- 1 root dialout 188, 0 apr 2 09:23 /dev/ttyUSB0

Thus you need to add yourself to that group via usemod command:

sudo usermod -a -G dialout $USER

The change requires logging out and logging back in. This is a very frequent solution and I use it myself for all my development boards that require serial console.


Alternative could be setting up a udev script that will change ownership of that file whenever it's connected, but changing group for user is preferred approach in a lot of cases

In particular, you should examine output of dmesg to obtain the information on vendor and product id of your arduino. Then in /etc/udev/rules.d/ you could set up 50-arduino.rules script. For instance, here's example of what I use for Altera's FPGA board:

$ cat /etc/udev/rules.d/51-usbblaster.rules                                                                              
# USB-Blaster II
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="*", \
ENV{DEVTYPE}=="usb_device",MODE="0666"

Replace "09fb" with your Arduino's vendor id. ATTR part can reman the same. You can run chown with RUN argument. For instance, use `RUN=+"/path/to/chmod_script.sh root:myuser %k". See this for more info.

Sergiy Kolodyazhnyy
  • 103,293
  • 19
  • 273
  • 492
  • Thanks for your answer. But i've applied usemod multiple times so i'm stuck. Did i break my ubuntu? I'm not familiar with script so i can't work with it yet. Sorry – Sjors123 Apr 04 '17 at 17:38