Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Error: espcomm_open failed

Open srishtisingh08 opened this issue 11 years ago • 37 comments

I am using Arduino 1.6.5 along with ESP8266MOD (16 Pin). Connections are: RX-TX, TX-RX, GND-GND, VCC,GPIO0 and CH_PD- 3.3v arduino.. no error in compilation of the code. But while uploading a warning and an error occurs:

warning: espcomm_sync failed error: espcomm_open failed

Tried changing RX and TX, and also GPIO0 while ploading kept it low. still the same errors..

code: void setup() {

Serial.begin(9600); Serial.begin(9600); delay(1000); }

void loop() {

if(Serial.available()){ byte b = Serial.read(); Serial.write(b); } if(Serial.available()) { byte c = Serial.read(); Serial.write(c); } }

Please help me out!!!

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

srishtisingh08 avatar Jun 23 '15 18:06 srishtisingh08

I got that recently on Adafruit HUZZAH ESP8266 module and found I had the TX / RX leads swapped over. I fixed the connections and the problem went away.

drmpf avatar Jun 23 '15 18:06 drmpf

I tried. But didnt work for me.

srishtisingh08 avatar Jun 23 '15 18:06 srishtisingh08

here is the list what need to be connected and where the pullups shut be: https://github.com/esp8266/Arduino#minimal-hardware-setup-for-bootloading-and-usage

Links2004 avatar Jun 24 '15 00:06 Links2004

The ESP-12 chip exposes GPIO 15. This pin must be pulled to ground for the chip to operate in the flash or UART modes.

AmrKafina avatar Jun 25 '15 09:06 AmrKafina

I had the same issues, the same errors with an ESP201 board. I understood it's close to the ESP-12. I connected the GPIO15 to Ground and it began uploading the sketch. After the uploading finished I disconnected the GPIO0 and the GPIO15 and the module functioned OK. So it's depending on the board used...My board in the picture attached. esp8266-esp-201-pin-reference-v01

VictorLavie avatar Jul 26 '15 12:07 VictorLavie

Sorry, I have to correct myself: You have to leave connected the GPIO15 to the Ground to make the board functioning after the upload. Only the GPIO0 is to be disconnected.

VictorLavie avatar Jul 26 '15 13:07 VictorLavie

Still having the same issues but with the standard ESP8266. Tried swapping the TX/RX, grounded GPIO0, and even tried updating the firmware but not successful. Here's the link of the test

http://iot-playground.com/2-uncategorised/35-esp8266-firmware-update

Hope for any help!

albertbooey71 avatar Aug 14 '15 03:08 albertbooey71

Hi. I was having the same problem. I was uploading the code by the USB. In this case, my USB hasn't had enough power to provide to ESP8266. After install a external 3.3v power supplier, my problem has solved.

jrperin avatar Oct 20 '15 05:10 jrperin

From Adafruit's tutorial, using the Huzzah board, did you try:

  1. Hold down the GPIO0 button, the red LED will be lit
  2. While holding down GPIO0, click the RESET button
  3. Release RESET, then release GPIO0
  4. When you release the RESET button, the red LED will be lit dimly, this means its ready to bootload

Then in the upload.

https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide Hope it might help.

klimovitsky avatar Nov 10 '15 02:11 klimovitsky

I was having the same issue as well. The way the issue was fixed for me is by connecting GPIO2 to 3.3V and GPIO0 to ground then resetting before uploading. GPIO2 can be disconnected from 3.3V after the upload is finished.

stephenmueller avatar Nov 21 '15 22:11 stephenmueller

@stephenmueller You are a life saver man !

Wifsimster avatar Jan 11 '16 19:01 Wifsimster

I got an ESP8266MOD based WiFi Shield made by SZDOIT and it's meant to be a transparent Wifi-serial bridge. Although, the documentation reveals that the official AT or NodeMCU firmware can be loaded.

So, I have been trying to flash the module on the board with an arduino sketch and I always had this error:

Warning: espcomm_sync failed Error: espcomm_open failed

I'm using Arduino IDE 1.6.5 esp8266/Arduino 1.6.5

hakeemta avatar Jan 30 '16 15:01 hakeemta

It seems to be a repeated issue. I believe that all the ESP8266 modules with whatever board they are mounted on - all have to be configured into the "bootload mode". The ESP8266 HAS TO BE in the "bootload mode" before each upload/flash. There is no timeout for bootload mode, so you don't have to rush! Look in this link for example, (HUZZAH ESP8266) - In order to enter the "bootload mode" it is required to:

  1. Hold down the **GPIO0 *_button, the red LED will be lit
  2. While holding down _GPIO0*, click the **RESET *_button
  3. Release _RESET*, then release GPIO0
  4. When you release the *_RESET *_button, the red LED will be lit dimly, this means its ready to bootload

Now, reading the Adafruit HUZZAH ESP8266 Breakout document will tell you that:

GPIO#0, which does not have an internal pullup, and is also connected to both a mini tactile switch and red LED. This pin is used by the ESP8266 to determine when to boot into the bootloader. If the pin is held low during power-up it will start bootloading! That said, you can always use it as an output, and blink the red LED.

And

RESET - this is the reset pin for the ESP8266, pulled high by default. When pulled down to ground momentarily it will reset the ESP8266 system. This pin is 5V compliant

Therefore, I am pretty sure that if you want to program/flash/upload to the ESP8266 you will have to hold LOW the GPIO0 pin of the ESP8266 module you have, then hold LOW the RESET pin of the ESP8266 module you have in order to clear the ESP8266. Then set the RESET pin HIGH, and then set the GPIO0 pin HIGH. Following those 4 steps will cause the ESP8266 chip to enter into bootloading mode. At this point you should be able to upload any program/sketch you want.

I could not find any schematic for the SZDOIT's ESP8266MOD board so I am not sure what is the pinout. But try to follow the above?

klimovitsky avatar Feb 04 '16 14:02 klimovitsky

Thanks so much, Klimovitsky. I'll try that again and get back.

Also, I want to know if there's a particular baudrate for flashing the chip. Although, in the previous discrete ones I have used 115200 was cool.

hakeemta avatar Feb 04 '16 16:02 hakeemta

Yeah, that is what I used as well.

klimovitsky avatar Feb 04 '16 17:02 klimovitsky

I had the same espcomm_sync failed problems with an Adafruit Huzzah, but I think mine is caused by a cheap FTDI adapter with a counterfeit FTDI chip. When I connected via PuTTy and press reset a few times I see: NON GENUINE DEVICE FOUND! NON GENUINE DEVICE FOUND!

This is something FTDI put in the newest Windows drivers to block communication with counterfeit chips. http://hackaday.com/2016/02/01/ftdi-drivers-break-fake-chips-again/

akeroyd avatar Mar 02 '16 12:03 akeroyd

Not having a common logic ground can cause this. If you are running your FTDI from a 5 Volts source and your ESP82 from a separate 3 volt source, connect the grounds.

Spackstor avatar Mar 08 '16 16:03 Spackstor

So to be totally newbie to this. I have the feather wifi esp8266 from adafruit. I have found a reset switch, but I will have to connect a switch to the GPIO#0 and GND (or 3V???) in order to put it into bootload mode?

hzd1977 avatar Mar 30 '16 12:03 hzd1977

@hzd1977,

Using Adafruit Feather HUZZAH ESP8266 you do not need to worry about toggling individual GPIO pins in order to put ESP into bootloader mode. This is done for you by the sketch uploader program (esptool) over USB/serial interface.

If not done already just follow Adafruit's guide https://learn.adafruit.com/adafruit-feather-huzzah-esp8266/using-arduino-ide

Krzysztof

krzychb avatar Mar 30 '16 13:03 krzychb

Yeah, I have followed the adafruit guide, step by step. I'll try adding a battery for more power.

I also suspect the usb driver I was told to install. I have the .dmg file and upon double clicking it, nothing seems to happen. Usually there apears a .pkg or something like that.

hzd1977 avatar Mar 30 '16 16:03 hzd1977