Arduino serial port COM1 problem

68,397

Solution 1

  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

Solution 2

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"

Solution 3

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.

Solution 4

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.

Solution 5

Change in the lib/preferences.txt file:

The string from

serial.port=COM1

to

serial.port=/dev/ttyUSB0

Share:
68,397

Related videos on Youtube

Hakan Ormancı
Author by

Hakan Ormancı

Updated on September 18, 2022

Comments

  • Hakan Ormancı
    Hakan Ormancı over 1 year

    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?

    • Rmano
      Rmano almost 9 years
      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.
    • xyz
      xyz almost 9 years
      How are you getting COM1 on Linux. That's how Windows names
    • Hakan Ormancı
      Hakan Ormancı almost 9 years
      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ı
    Hakan Ormancı almost 9 years
    It's (port menu) greyed out..
  • kashish
    kashish almost 9 years
    @hakan try running arduino as root . in terminal write "sudo arduino"
  • Hakan Ormancı
    Hakan Ormancı almost 9 years
    @kasnish i tried but it's not worked
  • Shanki Bansal
    Shanki Bansal over 6 years
    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.
  • kashish
    kashish over 6 years
    @ShankiBansal your welcome!
  • Dimitry K
    Dimitry K almost 6 years
    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