18

I bought an Arduino Uno and installed Arduino IDE 1.6.5 But when i want to upload a skecht to Arduino board i take 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.04LTS

    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 Arduino plugged in to computer dmesg | tail :

    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?

  • The dmesg code does not contain the information about plugging the arduino board... please change it with the relevant one. By the way, prepending LANG=C to a command should give you error messages in English. – Rmano Jul 9 '15 at 8:11
  • How are you getting COM1 on Linux. That's how Windows names – ps95 Jul 9 '15 at 8:51
  • prakharsingh95 yes i know but i don't understand why seen as COM1.Anyway in /dev directory there's nothing like COMx or ttyACMx. There are only tty(x) and ttyS(x). – Hakan Ormancı Jul 9 '15 at 10:40
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

  • 2
    It's (port menu) greyed out.. – Hakan Ormancı Jul 9 '15 at 10:36
  • 2
    @hakan try running arduino as root . in terminal write "sudo arduino" – kashish Jul 9 '15 at 10:49
  • @kasnish i tried but it's not worked – Hakan Ormancı Jul 9 '15 at 13:24
  • Didn't select port, woohoo now works thanks – RegarBoy Dec 17 '16 at 17:52
  • 1
    what a simple & perfect solution!!!! Save my day. I tried out many other commands in terminal that makes no change in my progress. Thanks alot. – Shanki Bansal Sep 2 '17 at 13:24
7

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.

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.

  • I had this error Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied. So had to use your sudo chmod a+rw /dev/ttyACM0 magic, but it DID NOT HELP. So I had to use use this command sudo adduser <username> dialout and then logout/login to make things work – Dimitry K Jul 24 '18 at 21:15
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 (just downloaded and followed the readme install). Serial Port was available and was also able to successfully upload to the UNO.

1

Change in lib/preferences.txt file string from serial.port=COM1 to serial.port=/dev/ttyUSB0

0
  1. Permissions on USB port
    As Linux user you'll need to be 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 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, use a direct connection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.