18

I bought an Arduino Uno and installed Arduino IDE 1.6.5. But when I want to upload a sketch to the Arduino board I get this error:

avrdude: ser_open(): can't open device "COM1": No such file or directory
ioctl("TIOCMGET"): Inappropriate ioctl for device

I'm using Ubuntu 14.04 (Trusty Tahr) LTS.

    hakan@hakan-pc:~$ ls -l /dev/ttyUSB0
ls: /dev/ttyUSB0'e erişilemedi: Böyle bir dosya ya da dizin yok(In English: No such a file like this)

 hakan@hakan-pc:~$ ls -l /dev/ttyS0
crw-rw-rw- 1 root dialout 4, 64 Tem  8 22:40 /dev/ttyS0

While the Arduino is plugged into the computer, dmesg | tail shows:

    hakan@hakan-pc:~$ dmesg | tail
[   21.784795] sound hdaudioC1D3: hda-codec: out of range cmd 3:5:707:ffffffff
[   21.784969] sound hdaudioC1D3: hda-codec: out of range cmd 3:5:707:ffffffbf
[   21.786110] sound hdaudioC1D0: hda-codec: out of range cmd 0:5:707:ffffffff
[   21.792705] sound hdaudioC1D0: hda-codec: out of range cmd 0:5:707:ffffffff
[   26.849759] sound hdaudioC1D0: hda-codec: out of range cmd 0:5:707:ffffffbf
[   27.515096] init: Failed to spawn nvidia-persistenced main process: unable to execute: No such file or directory
[   43.647261] audit: type=1400 audit(1436384452.263:72): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/cups/backend/cups-pdf" pid=2246 comm="apparmor_parser"
[   43.647270] audit: type=1400 audit(1436384452.263:73): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=2246 comm="apparmor_parser"
[   43.647654] audit: type=1400 audit(1436384452.267:74): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=2246 comm="apparmor_parser"
[   87.513268] systemd-hostnamed[2572]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!

How can I solve this problem?

Hakan Ormancı
  • 181
  • 1
  • 1
  • 3

7 Answers7

21
  1. Connect your Arduino hardware.Open Arduino IDE.

  2. Go to "Tool".

  3. Go to "Port".

  4. Select the port to which Arduino is connected.(If no other external drive is connected except Arduino,there will be only one port)

    This will tell Arduino IDE the port to which your hardware is connected. After that,you will be able to upload your sketch successfully

kashish
  • 1,342
9

If you run Arduino IDE on Ubuntu (Arduino 1.5.7 and Ubuntu 14.04 in my case), most possibly you cannot upload to Arduino board, caused by the error of:

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

To fix it, enter the command:

$ sudo usermod -a -G dialout <username>
$ sudo chmod a+rw /dev/ttyUSB0

Where is your user name in Ubuntu, /dev/ttyUSB0 is the detected device of your Arduino board.

First line doing add group (dialout) to username
Second line doing write and read permission to "/dev/ttyUSB0"

iceberg
  • 191
2

I was getting the same error on Ubuntu 14.04 with Arduino Uno. What worked for me was first selecting the appropriate port under Tools > Port and then changing the permission of the port using command like:

sudo chmod a+rw /dev/ttyUSB0

Then the error disappeared and I could upload fine.

bhaskarc
  • 121
1

Change in the lib/preferences.txt file:

The string from

serial.port=COM1

to

serial.port=/dev/ttyUSB0

1

I received the same message in Ubuntu 14.04 and the 1.0.5 version of the IDE.

Loading the FTDI chip D2XX drivers resolved the issue (I just downloaded and followed the README install). The serial port was available, and I was also able to successfully upload to the Arduino Uno.

0

On Kubuntu 18.04, the package 'arduino' gives a similar problem.

My workaround has been to get the one from the Arduino web site. Just extract it and make ./arduino to launch it. It works fine.

0
  1. Permissions on the USB port

    As a Linux user you'll need to be a member of the group dialout to be able to read and write to any /dev/tty* connections.

    Thus, making the connection world-writable or running the Arduino IDE as root is both not the way to go.

    It will be enough to add your user to the group dialout and re-login afterwards:

    sudo adduser *username* dialout
    
  2. USB connection COM1

    The Arduino IDE is written in Java, but it is probably still OS dependent. Is it likely that you did use the Windows ZIP package of the IDE on a Linux system?

  3. USB connection general

    Obviously your computer did not recognize the USB connection to the Arduino. Try to avoid USB hubs or USB sockets that some displays provide, and instead use a direct connection.

one-mb
  • 91