So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By cardboarddude
#64353 I have been at this problem for days and I'm driving myself insane just trying to figure out how to upload anything to ESP8266-01!! Here is the error message I'm getting:

Sketch uses 227097 bytes (23%) of program storage space. Maximum is 958448 bytes.
Global variables use 31988 bytes (39%) of dynamic memory, leaving 49932 bytes for local variables. Maximum is 81920 bytes.
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed


Wiring:
Setup #1 -
ESP8266-01 RXD --- Arduino Mega 2560 R3 TXD0 with 200:50ohm voltage divider
ESP8266-01 TXD --- Arduino Mega 2560 R3 RXD0
ESP8266-01 RST --- Pulled high (3.3V 300ohm) with push button GND (BUTTON 1)
ESP8266-01 CH_PD --- Pulled high (3.3V)
ESP8266-01 GND --- Common GND
ESP8266-01 GPIO0 --- Float with push button to GND (BUTTON 2)
ESP8266-01 GPIO2 --- Float

Setup #1 -
ESP8266-01 RXD --- FTDI USB TXD with 200:50ohm voltage divider
ESP8266-01 TXD --- FTDI USB RXD
ESP8266-01 RST --- Pulled high (3.3V 300ohm) with push button GND (BUTTON 1)
ESP8266-01 CH_PD --- Pulled high (3.3V)
ESP8266-01 GND --- Common GND w/ FTDI USB GND
ESP8266-01 GPIO0 --- Float with push button to GND (BUTTON 2)
ESP8266-01 GPIO2 --- Float
(FTDI USB CTS & RTS left alone)

Troubleshooting:

    - I'm powering ESP with external 2.4A 3.3V supply. Common GND
    - I push BUTTON 1 & 2 simultaneously. Wait 2 sec. Release 1. Wait 2 sec. Release 2. Wait 2s. Upload code.
    - Try removing power supply and reattaching. Then try previous process.
    - Try pushing BUTTON 1. Wait 2s. Release 1. Wait 2s. Push BUTTON 2. Wait 2s. Release 2. Wait 2s. Upload code.
    - I am using this guide w/ Arduino IDE 1.8.2
    - Arduino and FTDI USB are brand new. I tested by connecting RX to TX and checking to see that I receive what I sent in COM.
    - I tried only uploading the Bare Minimum sketch (Setup and Loop are empty).
    - During upload Arduino RX blinks thrice then TX blinks once. ESP-01 Red LED stays lit. Blue LED dims. Blue LED then blinks when Arduino TX blinks.
    - Four different ESP8266-01 modules were tested with same results.
    - Two different FTDI USB cables were tested.
    - Breadboard and wiring was changed to eliminate the possibility of faulty connections.

I'm going bald from pulling all my hair :O

Any help is greatly appreciated :) :)
Last edited by cardboarddude on Wed Mar 29, 2017 4:30 pm, edited 1 time in total.
User avatar
By cardboarddude
#64387 Thanks for the feedback. I changed the pull up resistance to 5.1K of RST and both GPIOs, but I'm still receiving the same error.

New Setup:

ESP8266-01 RXD --- Arduino Mega 2560 R3 TXD0 with 200:50ohm voltage divider
ESP8266-01 TXD --- Arduino Mega 2560 R3 RXD0
ESP8266-01 RST --- Pulled high (3.3V 5.1Kohm) with push button GND (BUTTON 1)
ESP8266-01 CH_PD --- Pulled high (3.3V)
ESP8266-01 GND --- Common GND
ESP8266-01 GPIO0 --- Pulled high (3.3V 5.1Kohm) with push button to GND (BUTTON 2)
ESP8266-01 GPIO2 --- Pulled high (3.3V 5.1Kohm)
User avatar
By icons
#64390 Hello,
On the tutorial you linked TX on mega is going to TX on esp8266 and RX to RX. You have yours connected the other way.

On my mega is the same way RX1 to RX on esp8266 and TX1 to TX.

I could not get it to work with RX0 & TX0 on mega, I think because these pins are also connected to the usb, so there is conflict.
But you need to use the serial pasthrough library (arduino ide, open file, examples, communication, serialpassthrough).

Also, you might need to hold your button2 longer, until you see it is beginning to upload sketch, then you can release.
So I would hold button 1 down then hold button 2 down at the same time, then release button 1, holding 2 down and wait until sketch is uploading then release.