Go Down

Topic: An error occurred while uploading the sketch. (Read 134983 times) previous topic - next topic

pert

avrdude: ser_open(): can't open device "\\.\COM4": The system cannot find the file specified.
Select the COM port of your Nano from the Arduino IDE's Tools > Port menu.

If you don't know which port is your Arduino, you can find it like this:
  • Unplug your Arduino board from the computer.
  • Tools > Port
  • Note the ports, if any, listed in the menu.
  • Close the Tools menu
  • Plug your Arduino board into the computer.
  • Tools > Port - The new port listed in the menu is your Arduino board.

ScienceMax

Hi, guys, I have an error :Re: An error occurred while uploading the sketch. can you please help me!!!!
I tried opening IDE by itself but I get the same error! can you please help me!!!!

ScienceMax

#62
Aug 19, 2019, 03:45 pm Last Edit: Aug 19, 2019, 03:50 pm by ScienceMax
I've gotten error :Re: An error occurred while uploading the sketch.
here is my code:


#include <Servo.h>
int pot1 = A0;
Servo myservo;
void setup() {
 // put your setup code here, to run once:
myservo.attach(0);
Serial.begin(6900);
}

void loop() {
 // put your main code here, to run repeatedly:
Serial.println(pot1);
myservo.write(90);
Serial.println(myservo.read());
delay(1000);
myservo.write(0);
Serial.println(myservo.read());
}


please help me!!

port: COM7
programmer: arduinoISP
board: uno
message: help!

pert

I've gotten error :Re: An error occurred while uploading the sketch
Please do this:
  • (In the Arduino IDE) File > Preferences
  • Uncheck the checkbox next to "Show verbose output during: compilation"
  • Check the checkbox next to "Show verbose output during: upload
  • Click "OK"
  • Sketch > Upload
  • After the upload fails, you'll see a button on the right side of the orange bar "Copy error messages" (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the upload output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

ScienceMax


pert

My instructions above were only intended to get the necessary information to troubleshoot your problem. There is nothing about them that should have solved the problem. However, I'm glad to hear it's working now. Enjoy!
Per


Sriman_singaravelan

Some one help me I have the same problem even though I used it many times but now I have that problem and it showing the message after a long time of uploading

pert

Some one help me I have the same problem even though I used it many times but now I have that problem and it showing the message after a long time of uploading
Please do this:
  • (In the Arduino IDE) File > Preferences
  • Uncheck the checkbox next to "Show verbose output during: compilation"
  • Check the checkbox next to "Show verbose output during: upload
  • Click "OK"
  • Sketch > Upload
  • After the upload fails, you'll see a button on the right side of the orange bar "Copy error messages" (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the upload output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

ck81

Hi,
I have the same problem. The output is the following:

Arduino: 1.6.11 (Windows 8.1), Board: "Arduino/Genuino Micro"

Sketch uses 4,136 bytes (14%) of program storage space. Maximum is 28,672 bytes.
Global variables use 148 bytes (5%) of dynamic memory, leaving 2,412 bytes for local variables. Maximum is 2,560 bytes.
Forcing reset using 1200bps open/close on port COM7
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
PORTS {COM1, COM7, } / {COM1, COM7, } => {}
Uploading using selected port: COM7
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM7 -b57600 -D -Uflash:w:C:\Users\CONSTA~1\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.ino.hex:i

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

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM7
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


Thanks.

pert

Hi,
I have the same problem. The output is the following:
Make sure you have the correct board selected from the Tools > Board menu.

Make sure you have selected the port of your Arduino board from the Tools > Port menu.

Sometimes the port will be labeled with the board name in the menu. Other times it will not. If you don't know which port is your Arduino, you can find it like this:
  • Unplug your Arduino board from the computer.
  • Tools > Port
  • Note the ports, if any, listed in the menu.
  • Close the Tools menu
  • Plug your Arduino board into the computer.
  • Tools > Port - The new port listed in the menu is your Arduino board.

Go Up