Arduino: An error occurred while uploading the sketch with ARDUINO IDE 1.8.4 on NODEMCU ESP8266 module

Created on 26 Sep 2017  路  8Comments  路  Source: esp8266/Arduino

Description

Hello!
I'm trying to use and libraries in same project. However when I use SPIFFS.begin(); and server.handleClient(); I get error while uploding. It takes 5 minutes to upload to 99% and than error! If i upload program without SPIFFS.begin(); it uploads fine. Code and debug messages are below. I hope that someone can help me.

Hardware

Hardware: NodeMCU(ESP-12E Module), 80 MHz, 9600, 4M (3M SPIFFS)

Sketch

include

include

include

include

include

ESP8266WebServer server(12666);
ESP8266WiFiMulti wifiMulti;

boolean connectioWasAlive = true;
int pWifi = 13; //D7
char *ESPssid = "ESP8266WIFI";
char *ESPpass = "ESP8266PASS";

//////////////////// * SETUP * ////////////////////
void setup()
{
pinMode(pWifi, OUTPUT);
digitalWrite(pWifi, LOW);
Serial.begin(9600);
Serial.println("... and giberish STOP!");

SPIFFS.begin();
wifiMulti.addAP(ESPssid, ESPpass);
}

void loop() {
monitorWiFi();
server.handleClient();
}

void monitorWiFi()
{
if (wifiMulti.run() != WL_CONNECTED)
{
if (connectioWasAlive == true)
{
connectioWasAlive = false;
Serial.println("Searching for WiFi signal:");
}
Serial.print(".");
digitalWrite(pWifi, !digitalRead(pWifi));
delay(500);
}
else if (connectioWasAlive == false)
{
connectioWasAlive = true;
Serial.println("!");
Serial.println("Server created!");
digitalWrite(pWifi, HIGH);
}
}

Debug Messages

Archiving built core (caching) in: C:\Users\Tom\AppData\Local\Temp\arduino_cache_394679\core\core_esp8266_esp8266_nodemcuv2_CpuFrequency_80,UploadSpeed_9600,FlashSize_4M3M_53e17bf51bb4f250e1f45a5c11d63252.a
Sketch uses 265713 bytes (25%) of program storage space. Maximum is 1044464 bytes.
Global variables use 36272 bytes (44%) of dynamic memory, leaving 45648 bytes for local variables. Maximum is 81920 bytes.
Uploading 269856 bytes from C:\Users\Tom\AppData\Local\Temp\arduino_build_24175/flash.ino.bin to flash at 0x00000000
................................................................................ [ 30% ]
................................................................................ [ 60% ]
................................................................................ [ 90% ]
.....................An error occurred while uploading the sketch

Also I have another issue. Code is uploading very slow. It takes like 5 minutes to upload simple code like this. I am wondering if this is normal.

Kind regards,

Gromblisk

Most helpful comment

You can Increase the upload speed from menu>>tools>>upload speed>> 256000
It will significantly reduce upload time.
You can also choose greater speed but it may produce an error.

All 8 comments

You can Increase the upload speed from menu>>tools>>upload speed>> 256000
It will significantly reduce upload time.
You can also choose greater speed but it may produce an error.

Thank you, this realy increases upload speed :D
Any idea why i get this error?

woohoooo! It seems higher upload speed also solved my problem! It uploads code fine!

Thank you very much :D

Welcome!

9600 was likely causing a timeout somewhere.
Closing as resolved.

Hi,
Thank you, i was trying at 9600 or 115200 and i always got the same error.
I switched to 57600 and the upload works fine.

Same problem was with me , Just change uploading speed to 115200 or higher.

Hi,
My problem is uploaded 100% but not print anything in serial monitor .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markusschweitzer picture markusschweitzer  路  3Comments

eliabieri picture eliabieri  路  3Comments

pablotix20 picture pablotix20  路  3Comments

rudydevolder picture rudydevolder  路  3Comments

SmartSouth picture SmartSouth  路  3Comments