Access Denied

Hello! I've been trying to upload code to my arduino similar to a rc car. It compiles but doesn't upload. When I try uploading i get the following:

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/434332679/build -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -libraries /tmp/434332679/pinned -libraries /tmp/434332679/custom -fqbn arduino:avr:uno -build-cache /tmp -logger humantags -verbose=true /tmp/434332679/BB8s_Arduino_Code

Using board 'uno' from platform in folder: /home/admin/builder/opt/cores/arduino/avr

Using core 'arduino' from platform in folder: /home/admin/builder/opt/cores/arduino/avr

Detecting libraries used...

"/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/home/admin/builder/opt/cores/arduino/avr/cores/arduino" "-I/home/admin/builder/opt/cores/arduino/avr/variants/standard" "/tmp/434332679/build/sketch/BB8s_Arduino_Code.ino.cpp" -o "/dev/null"

"/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/home/admin/builder/opt/cores/arduino/avr/cores/arduino" "-I/home/admin/builder/opt/cores/arduino/avr/variants/standard" "-I/home/admin/builder/opt/libraries/latest/dualvnh5019motorshield-2-0-0" "/tmp/434332679/build/sketch/BB8s_Arduino_Code.ino.cpp" -o "/dev/null"

"/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/home/admin/builder/opt/cores/arduino/avr/cores/arduino" "-I/home/admin/builder/opt/cores/arduino/avr/variants/standard" "-I/home/admin/builder/opt/libraries/latest/dualvnh5019motorshield-2-0-0" "/home/admin/builder/opt/libraries/latest/dualvnh5019motorshield-2-0-0/DualVNH5019MotorShield.cpp" -o "/dev/null"

Generating function prototypes...

"/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/home/admin/builder/opt/cores/arduino/avr/cores/arduino" "-I/home/admin/builder/opt/cores/arduino/avr/variants/standard" "-I/home/admin/builder/opt/libraries/latest/dualvnh5019motorshield-2-0-0" "/tmp/434332679/build/sketch/BB8s_Arduino_Code.ino.cpp" -o "/tmp/434332679/build/preproc/ctags_target_for_gcc_minus_e.cpp"

"/home/admin/builder/opt/arduino-builder/tools/arduino-preprocessor/0.1.5/arduino-preprocessor" "/tmp/434332679/build/preproc/ctags_target_for_gcc_minus_e.cpp" "" -- -std=gnu++11

Compiling sketch...

"/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/home/admin/builder/opt/cores/arduino/avr/cores/arduino" "-I/home/admin/builder/opt/cores/arduino/avr/variants/standard" "-I/home/admin/builder/opt/libraries/latest/dualvnh5019motorshield-2-0-0" "/tmp/434332679/build/sketch/BB8s_Arduino_Code.ino.cpp" -o "/tmp/434332679/build/sketch/BB8s_Arduino_Code.ino.cpp.o"

Compiling libraries...

Compiling library "dualvnh5019motorshield-2-0-0"

"/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/home/admin/builder/opt/cores/arduino/avr/cores/arduino" "-I/home/admin/builder/opt/cores/arduino/avr/variants/standard" "-I/home/admin/builder/opt/libraries/latest/dualvnh5019motorshield-2-0-0" "/home/admin/builder/opt/libraries/latest/dualvnh5019motorshield-2-0-0/DualVNH5019MotorShield.cpp" -o "/tmp/434332679/build/libraries/dualvnh5019motorshield-2-0-0/DualVNH5019MotorShield.cpp.o"

Compiling core...

Using precompiled core: /tmp/core/core_arduino_avr_uno_0aa5caef1c8d4449182adee8bd94fca7.a

Linking everything together...

"/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "/tmp/434332679/build/BB8s_Arduino_Code.ino.elf" "/tmp/434332679/build/sketch/BB8s_Arduino_Code.ino.cpp.o" "/tmp/434332679/build/libraries/dualvnh5019motorshield-2-0-0/DualVNH5019MotorShield.cpp.o" "/tmp/434332679/build/../../core/core_arduino_avr_uno_0aa5caef1c8d4449182adee8bd94fca7.a" "-L/tmp/434332679/build" -lm

"/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "/tmp/434332679/build/BB8s_Arduino_Code.ino.elf" "/tmp/434332679/build/BB8s_Arduino_Code.ino.eep"

"/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -R .eeprom "/tmp/434332679/build/BB8s_Arduino_Code.ino.elf" "/tmp/434332679/build/BB8s_Arduino_Code.ino.hex"

Using library dualvnh5019motorshield-2-0-0 at version 2.0.0 in folder: /home/admin/builder/opt/libraries/latest/dualvnh5019motorshield-2-0-0

"/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-size" -A "/tmp/434332679/build/BB8s_Arduino_Code.ino.elf"

Sketch uses 2714 bytes (8%) of program storage space. Maximum is 32256 bytes.

Global variables use 198 bytes (9%) of dynamic memory, leaving 1850 bytes for local variables. Maximum is 2048 bytes.

Flashing with command:C:/Users/Andy/.arduino-create/arduino/avrdude/6.3.0-arduino9/bin/avrdude.exe -CC:/Users/Andy/.arduino-create/arduino/avrdude/6.3.0-arduino9/etc/avrdude.conf -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:C:/Users/Andy/AppData/Local/Temp/arduino-create-agent487381215/BB8s_Arduino_Code.hex:i

avrdude: ser_open(): can't open device "\.\COM3": Access is denied.

avrdude done. Thank you.

How do I fix this? I need a fast response because this is for a school project.
Thanks! :slight_smile:

(deleted)

(deleted)

Access denied on serial port typically indicates that another program is using the serial port. If you can't find any application you were using that's doing that, and it persists after reboot, check if you have any software related to modems running in the background - some modem software assumes that any serial port connected is a modem, and tries to talk to it as if it was one - in the process blocking any other program from using the serial port.

I tried your instructions and checked the ports. I disconnected everything and even went into device manager to check the COMs and all I saw were two COMs being used. Is there a way to get the ports isolated? I've tried replacing them with different COMs but they keep coming back. I'm new to this so sorry if all of this is easy to you guys. :slight_smile: