- Wed Oct 07, 2015 9:21 am
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.