-->
Page 1 of 3

espcomm_sync failed,

PostPosted: Tue Oct 06, 2015 6:58 pm
by johnjcouture
Com4 (serial monitor comes up ok), Arduino 1.6.5 with ESP8266 Board Manager from GITHUB,
HP Laptop, Win 8.1, 15" Envy Touchscreen model about 18 months old.
Using ESP8266 Development Board (white with Relay, LEDs, Temp/Humi,buzzer).

Trying to program directly with IDE for ESP8266. Tried it with K2 in both positions
Board: Generic ESP8266 Module
Powered only from USB cable from Laptop

Loaded Blink Sketch, compiles ok, uploads ok (blue light on module blinks when uploading) but get error message at end

Sketch uses 201,082 bytes (46%) of program storage space. Maximum is 434,160 bytes.
Global variables use 44,592 bytes (54%) of dynamic memory, leaving 37,328 bytes for local variables. Maximum is 81,920 bytes.
warning: espcomm_sync failed
error: espcomm_open failed

Any ideas what I am doing wrong?

Re: espcomm_sync failed,

PostPosted: Wed Oct 07, 2015 9:21 am
by observing
I have wrestled with this problem before and, from my investigation of others' experiences, I think it has multiple facets. The main symptom is that the espcomm portion of the IDE is not receiving information from the ESP8266 (through the USB-UART adapter) that it is expecting (i.e. sync failed). After a few failed attempts, espcomm gives up (i.e. open failed). I have successfully programmed an ESP-12, but I haven't been good about documenting my wiring and procedures, so my results have been inconsistent. I believe that the following represents my most recent successful attempt:

First and foremost, an external 3.3 volt power supply (approximately one ampere) needs to be connected to the ESP8266's Vcc pin. The USB-UART provides 3.3 volts, but (mine, at least) doesn't provide sufficient current. While the ground pins of the USB-UART and external supply should be connected, the 3.3 volt output of the USB-UART should not be connected.

I am using 10k ohm resistors to pull up CH_PD, RESET, GPIO2, and GPIO0 to 3.3 volts. I am also using a 10k ohm resistor to pull down GPIO15 to ground. TXD of the ESP8266 is connected to RXD of the USB-UART and RXD of the ESP8266 is connected to TXD of the USB-UART. Lastly, I have connected a 10uF capacitor across the Vcc and ground pins of the ESP8266.

On the IDE side, I have set the communications parameters to 115200 baud, 8 bits, 1 stop bit, no parity bit, no handshaking, and the appropriate serial port. The sequence I used to program the ESP8266 is:
1. Apply the external power supply to the ESP8266
2. Connect a USB cable between the USB-UART and the laptop's USB port. NOTE: I have to run my laptop on AC power for its USB port to provide sufficent current to the USB-UART.
3. Ground the GPIO0 pin
4. Momentarily ground the RST pin
5. Click the IDE's upload button

One last troubleshooting tip. I'm using a laptop running Windows 7 (32 bit) to program the ESP8266. I tried using a Windows 7 (64 bit) desktop computer and its USB ports were unable to receive characters from the USB-UART. So, try a loopback test (connect together TXD and RXD of the USB-UART) and make sure that the computer receives the characters that you type. NOTE: When you do this test, disconnect TXD and RXD of the ESP8266.

Re: espcomm_sync failed,

PostPosted: Wed Oct 07, 2015 9:56 am
by erhardd
A second troubleshooting tip:
- if you have a blue LED (ESP 07 /ESP 12) this Led must flicker short if the chip is in "Bootloader-Mode" !
Without this you never get the espcomm in sync.

Re: espcomm_sync failed,

PostPosted: Wed Oct 07, 2015 7:23 pm
by johnjcouture
I did find a solution on this board that works for me.
See http://www.esp8266.com/viewtopic.php?f=27&t=3966.

The gist of it is that you:
* turn the board off,
* set K2 to Ground (ON),
* power on
*set K2 to OFF

Then you can upload your sketch. Interesting thing is that you can upload at the uberfast rate too (921600).

Just another side story. Before this incident, I was having problems with getting the module to accept anything (i.e. blue light did not work and USB port did not register). I though it was a CH340 driver problem. Long story short, it was the connector on the USB cable. New cable solved the problem. Moral of the story, check everything, assume nothing.

Thank you guys (and gals) for your help. Collaboration is a good thing.