Skip to content

ESP8266 Error: warning: espcomm_sync failed error: espcomm_open failed error: espcomm_upload_mem failed #4414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HarukiHirosan opened this issue Feb 22, 2018 · 13 comments

Comments

@HarukiHirosan
Copy link

I am using an Ardunio Genuino 101 Board to upload the sketch into my ESP module. Without any USB-TTL converter. I am not using any voltage regulators. My layout is as following on the image below but without the voltage regulator. Just straight connection to 3.3v port on the ardunio board. I've tried using an external 3.3v power but it didn't work either.
screenshot_4

Hardware: ESP8266-01

Whenever I try to upload a sketch, it gives me this error:

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

I do not want to buy an USB-TTL converter just for this. I can't upload anything on the module.

Module: Generic ESP8266 Module
Flash Size: 1M(512k SPIFFS)
CPU Frequency: 80Mhz
Flash Mode: QIO
Flash Frequency: 40Mhz
Upload Using: USB cable via Arduino Genuino 101
Reset Method: ck

Sketch:

/*

  • This sketch demonstrates how to scan WiFi networks.
  • The API is almost the same as with the WiFi Shield library,
  • the most obvious difference being the different file you need to include:
    */
    #include "ESP8266WiFi.h"

void setup() {
Serial.begin(115200);

// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);

Serial.println("Setup done");
}

void loop() {
Serial.println("scan start");

// WiFi.scanNetworks will return the number of networks found
int n = WiFi.scanNetworks();
Serial.println("scan done");
if (n == 0)
Serial.println("no networks found");
else
{
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i)
{
// Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(")");
Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":"*");
delay(10);
}
}
Serial.println("");

// Wait a bit before scanning again
delay(5000);
}

Please help me.

@WereCatf
Copy link
Contributor

WereCatf commented Feb 22, 2018

You need to boot the ESP into flash-mode before you can upload any sketches onto it, ie. push flash-button down, press once on the reset-button, then let go of the flash-button.

That said, this isn't the right place to ask for help. This is for discussing bugs/issues with the Arduino-core for ESP8266 -- visit http://www.esp8266.com/ instead for user-help.

@HarukiHirosan
Copy link
Author

I already tried that and there is no diffrence to it. Perhaps something is wrong? When I do the flash mode thing the blue led flashes once. The red led is always on...

@devyte
Copy link
Collaborator

devyte commented Feb 23, 2018

Off topic, please request assistance at a community forum like esp8266.com or stackoverflow.
Closing per issue POLICY doc.
Btw, you need a special sketch on the UNO to use it like that.

@devyte devyte closed this as completed Feb 23, 2018
@arghasen10
Copy link

I was also facing the same problem. The solution is you need to connect the reset pin of your Arduino UNO to ground and the GPIO0 of esp8266 to a button which is already connected to ground. Now before uploading the code in esp8266, you need to remove the USB and then keep the button pressed so that the GPIO0 is grounded and then connect the USB and then just unpress it. Next time when you are going to upload your code again you have to follow the same steps.

@ravindrasitale096
Copy link

Thank You arghasen10, it really worthy information.

@darrahts
Copy link

darrahts commented Feb 7, 2019

I know the issue is closed but there should be no reason to go through all of the stuff mentioned here. First time using the nodeMCU's I got the blinky sketch to work, and then something happened between my laptop updating and developing on different machines. I spent days trying to figure out why some of my old sketches, when edited or deployed to new NodeMCUs would work, and nothing else would.

The following configuration solved the issue:

Board: "NodeMCU 1.0 (ESP-12E Module)"
Upload Speed: "115200"
CPU Frequency: "80 MHz"
Flash Size: "4M (no SPIFFS)"
Debug port: "Disabled"
Debug Level: "None"
lwIP Variant: "v2 Lower Memory"
VTables: "Flash"
Exceptions: "disabled"
Erase Flash: "Only Sketch"
Port: <your_port>

This worked across different machines, using this link to add the board file to boards manager. I downloaded "esp8266 by ESP8266 Community version 2.5.0".

@raymop
Copy link

raymop commented Feb 9, 2019

I know the issue is closed but there should be no reason to go through all of the stuff mentioned here. First time using the nodeMCU's I got the blinky sketch to work, and then something happened between my laptop updating and developing on different machines. I spent days trying to figure out why some of my old sketches, when edited or deployed to new NodeMCUs would work, and nothing else would.

The following configuration solved the issue:

Board: "NodeMCU 1.0 (ESP-12E Module)"
Upload Speed: "115200"
CPU Frequency: "80 MHz"
Flash Size: "4M (no SPIFFS)"
Debug port: "Disabled"
Debug Level: "None"
lwIP Variant: "v2 Lower Memory"
VTables: "Flash"
Exceptions: "disabled"
Erase Flash: "Only Sketch"
Port: <your_port>

This worked across different machines, using this link to add the board file to boards manager. I downloaded "esp8266 by ESP8266 Community version 2.5.0".

I have tried what you showed above, and really, really hoped it would work.
I have several HUZZAH feathers. Including one that I uploaded firmware to last year.
The firmware is still running, and When I view the serial monitor, I get the output expected.
But, I cannot, cannot upload any new firmware to that HUZZAH or any new ones I bought.
Have tried everything,

  • different PCs (Mac vs WIN10)
  • different serial cables
  • speeds
  • sketches
  • Arduino IDE vs pio

And I always get the same error.:
Error: warning: espcomm_sync failed error: espcomm_open failed error: espcomm_upload_mem failed

I'm about to throw away four ESP8266's and try ESP-32.

What am I missing????!

@darrahts
Copy link

darrahts commented Feb 9, 2019

@raymop the feather requires additional drivers, have you followed the guide here https://learn.adafruit.com/adafruit-feather-huzzah-esp8266/using-arduino-ide ?

@d-a-v
Copy link
Collaborator

d-a-v commented Feb 9, 2019

The official flasher is esptool.py

https://github.com/espressif/esptool

We will use it after #5635 is merged.

Try it, or try #5635.

@eilering
Copy link

eilering commented Dec 26, 2022

In the circuit the GPIO0 pin is connected to VCC through a 10 k resistor. The voltage on the reset pin is 1.97V. in normal operation.
I removed this resister and connected the GPIO0 pin manually.
Normal operation--> GPIO0 not connected
Program mode --> GPIO0 to GND--> switch on VCC --> GPIO0 to VCC --> not connected (to normal operation)

I tried it with 5 esp8266 modules which all were functioning properly after this modification and did not before.

I did it with the blink example
But when I loaded another program in the arduino, it failed uploading to the esp/ Why?
The only difference was the upload speed of the serial monitor.

the arduino file:
void setup() {
//Serial.begin(115200);

When i commented this lline, the upload to the esp worked. ( //Serial.begin(115200); )
when I uncommented it, ( Serial.begin(115200); ) the upload to the esp failed.

So as soon as the Arduino sketch has a serial begin, the communication to the ESP fails.

@Bighoneypot
Copy link
Contributor

I am using an Ardunio Genuino 101 Board to upload the sketch into my ESP module. Without any USB-TTL converter. I am not using any voltage regulators. My layout is as following on the image below but without the voltage regulator. Just straight connection to 3.3v port on the ardunio board. I've tried using an external 3.3v power but it didn't work either.
screenshot_4

Hardware: ESP8266-01

Whenever I try to upload a sketch, it gives me this error:

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

I do not want to buy an USB-TTL converter just for this. I can't upload anything on the module.

Module: Generic ESP8266 Module
Flash Size: 1M(512k SPIFFS)
CPU Frequency: 80Mhz
Flash Mode: QIO
Flash Frequency: 40Mhz
Upload Using: USB cable via Arduino Genuino 101
Reset Method: ck

Sketch:

/*

  • This sketch demonstrates how to scan WiFi networks.
  • The API is almost the same as with the WiFi Shield library,
  • the most obvious difference being the different file you need to include:
    */
    #include "ESP8266WiFi.h"

void setup() {
Serial.begin(115200);

// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);

Serial.println("Setup done");
}

void loop() {
Serial.println("scan start");

// WiFi.scanNetworks will return the number of networks found
int n = WiFi.scanNetworks();
Serial.println("scan done");
if (n == 0)
Serial.println("no networks found");
else
{
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i)
{
// Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(")");
Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":"*");
delay(10);
}
}
Serial.println("");

// Wait a bit before scanning again
delay(5000);
}

Please help me.

Add #include "Arduino.h"
and Add delay(150) after WiFi.mode(WIFI_STA);

@eilering
Copy link

did you try my experience? See previous note.
When i commented this lline, the upload to the esp worked. ( //Serial.begin(115200); )
when I uncommented it, ( Serial.begin(115200); ) the upload to the esp failed.

@Bighoneypot
Copy link
Contributor

Add #define Arduino.h and check your cable. You need to check your upload methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants