Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I just downloaded Arduino IDE on my Linux laptop. I also have an Arduino mega 2560. With nothing connected to it, I tried to upload the blink sketch to test if it is working. However, I get this error:

Arduino: 1.6.11 (Linux), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

/opt/arduino-1.6.11/arduino-builder -dump-prefs -logger=machine -hardware /opt/arduino-1.6.11/hardware -tools /opt/arduino-1.6.11/tools-builder -tools /opt/arduino-1.6.11/hardware/tools/avr -built-in-libraries /opt/arduino-1.6.11/libraries -libraries /home/yongtheskill/Arduino/libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0X2341_0X0042 -ide-version=10611 -build-path /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp -warnings=all -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/opt/arduino-1.6.11/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/opt/arduino-1.6.11/hardware/tools/avr -verbose /opt/arduino-1.6.11/examples/01.Basics/Blink/Blink.ino
/opt/arduino-1.6.11/arduino-builder -compile -logger=machine -hardware /opt/arduino-1.6.11/hardware -tools /opt/arduino-1.6.11/tools-builder -tools /opt/arduino-1.6.11/hardware/tools/avr -built-in-libraries /opt/arduino-1.6.11/libraries -libraries /home/yongtheskill/Arduino/libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0X2341_0X0042 -ide-version=10611 -build-path /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp -warnings=all -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/opt/arduino-1.6.11/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/opt/arduino-1.6.11/hardware/tools/avr -verbose /opt/arduino-1.6.11/examples/01.Basics/Blink/Blink.ino
Using board 'mega' from platform in folder: /opt/arduino-1.6.11/hardware/arduino/avr
Using core 'arduino' from platform in folder: /opt/arduino-1.6.11/hardware/arduino/avr
Detecting libraries used...
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-I/opt/arduino-1.6.11/hardware/arduino/avr/cores/arduino" "-I/opt/arduino-1.6.11/hardware/arduino/avr/variants/mega" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/sketch/Blink.ino.cpp" -o "/dev/null"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-I/opt/arduino-1.6.11/hardware/arduino/avr/cores/arduino" "-I/opt/arduino-1.6.11/hardware/arduino/avr/variants/mega" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/sketch/Blink.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-I/opt/arduino-1.6.11/hardware/arduino/avr/cores/arduino" "-I/opt/arduino-1.6.11/hardware/arduino/avr/variants/mega" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/sketch/Blink.ino.cpp" -o "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/preproc/ctags_target_for_gcc_minus_e.cpp"
"/opt/arduino-1.6.11/tools-builder/ctags/5.8-arduino10/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-I/opt/arduino-1.6.11/hardware/arduino/avr/cores/arduino" "-I/opt/arduino-1.6.11/hardware/arduino/avr/variants/mega" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/sketch/Blink.ino.cpp" -o "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/sketch/Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc" -c -g -x assembler-with-cpp -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-I/opt/arduino-1.6.11/hardware/arduino/avr/cores/arduino" "-I/opt/arduino-1.6.11/hardware/arduino/avr/variants/mega" "/opt/arduino-1.6.11/hardware/arduino/avr/cores/arduino/wiring_pulse.S" -o "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring_pulse.S.o"
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/WInterrupts.c.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/hooks.c.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring.c.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring_analog.c.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring_digital.c.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring_pulse.c.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring_shift.c.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/CDC.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/HardwareSerial.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/HardwareSerial0.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/HardwareSerial1.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/HardwareSerial2.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/HardwareSerial3.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/IPAddress.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/PluggableUSB.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/Print.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/Stream.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/Tone.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/USBCore.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/WMath.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/WString.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/abi.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/main.cpp.o
Using previously compiled file: /tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/new.cpp.o
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring_pulse.S.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/WInterrupts.c.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/hooks.c.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring.c.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring_analog.c.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring_digital.c.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring_pulse.c.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/wiring_shift.c.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/CDC.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/HardwareSerial.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/HardwareSerial0.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/HardwareSerial1.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/HardwareSerial2.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/HardwareSerial3.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/IPAddress.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/PluggableUSB.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/Print.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/Stream.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/Tone.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/USBCore.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/WMath.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/WString.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/abi.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/main.cpp.o"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/new.cpp.o"
Linking everything together...
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-gcc" -Wall -Wextra -Os -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560  -o "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/Blink.ino.elf" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/sketch/Blink.ino.cpp.o" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/core/core.a" "-L/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp" -lm
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/Blink.ino.elf" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/Blink.ino.eep"
"/opt/arduino-1.6.11/hardware/tools/avr/bin/avr-objcopy" -O ihex -R .eeprom  "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/Blink.ino.elf" "/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/Blink.ino.hex"

Sketch uses 1,462 bytes (0%) of program storage space. Maximum is 253,952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8,183 bytes for local variables. Maximum is 8,192 bytes.
/opt/arduino-1.6.11/hardware/tools/avr/bin/avrdude -C/opt/arduino-1.6.11/hardware/tools/avr/etc/avrdude.conf -v -patmega2560 -cwiring -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/buildfd81ed8a65d964141a08fb73eef2726a.tmp/Blink.ino.hex:i 

avrdude: Version 6.0.1, compiled on Apr 14 2015 at 19:04:16
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/opt/arduino-1.6.11/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/yongtheskill/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device
ioctl("TIOCMGET"): Inappropriate ioctl for device
avrdude: ser_send(): write error: Bad file descriptor
avrdude: ser_send(): write error: Bad file descriptor

I tried the Arduino Mega on a Windows PC and it works. I cannot test if the same problem occurs on other Arduinos as all my other Arduinos are broken.
Can someone please tell me how to fix this? Thanks!

share|improve this question
4  
Possible duplicate of Arduino program only works when run as root You need to add your user account to the group which owns serial ports, general instructions for doing so can be found at that link as well as many places around the web. – Chris Stratton Aug 21 at 5:55
    
I think this can be solved by making that com port file executable. $ sudo usermod -a -G dialout <username> $ sudo chmod a+rw /dev/ttyACM0 refer this : arduino-er.blogspot.com/2014/08/… – Sanu - Open Maker Aug 21 at 6:13
1  
Neither of those makes it "executable". The first is the correct solution though the group name varies. The second would only be a temporary fix that would have to be repeated each time it was replugged - if one wanted to do it that way, udev would be the answer. Anyway, the question already has an answer here. – Chris Stratton Aug 21 at 6:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.