0

I am sorry for posting this question for the nth time but I am still not able to find a solution for this error.

I am trying to upload the WiFiScan(Arduino IDE example program)program code to ESP8266 using Arduino Mega 2560. I followed the procedure given here. And I tried uploading it with "Generic ESP8266 Module" and "Adafruit HUZZAH ESP8266" selected as the Board. But I am still getting the following error.

trying to connect
  espcomm_send_command: sending command header
  espcomm_send_command: sending command payload
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed

Edited to add: enter image description here

Connections-

ESP8266 - Arduino Mega2560

Tx - Tx1(Pin 18)

Rx - Rx1(Pin 19)

Gnd - Gnd

Vcc - 3.3V (Directly from Arduino's 3.3V pin)

CH_PD - 3.3V (Directly from Arduino's 3.3V pin)

GPIO0 - Push button K2 (refer photo)

RST - Push button K1

While pressing the K2 button(Flash button - GPIO0), I clicked the K1 button(Reset button - RST) and then released K2. According to the document, this should bring the ESP8266 to flash mode. Now when I upload the code, it throws the above error.

  • That tutorial doesn't have anything to do with an Arduino Mega and you didn't tell us how you wired it. We can only guess what is wrong. – gre_gor Sep 12 '17 at 15:47
  • Add a photo clearly showing your devices and wiring and you might get a better response. – Squats Sep 12 '17 at 22:52
  • As suggested, I've included the connection details in the question. @gre_gor, Squats – Purvaja Suresh Sep 13 '17 at 6:34
  • tx to tx and rx to rx ??? have you tried the obvious? tx to rx and rx to tx, seeing as that's how serial connections work – Jaromanda X Feb 11 '18 at 1:02
0

After googling for several hours, I was able to figure out the reason. Thanks to this link. Transferring data to ESP8266 with Arduino acting as USB to Serial converter did not work. Using a USB to TTL converter, and following this link you can easily transfer data to ESP8266.

  • My Arduino Mega worked as a USB to Serial converter just fine... – Fusseldieb Sep 13 '17 at 12:02
  • @Fusseldieb could you please tell me how you uploaded data using Arduino Mega? – Purvaja Suresh Sep 13 '17 at 12:04
  • I just plugged TX to TX, RX to RX, GND to GND and shorted RST to GND, causing the Arduino to loop continuously on reset. I also chosen "Tools" -> "Programmer" -> "Arduino as ISP". Then I uploaded the sketch just fine. – Fusseldieb Sep 13 '17 at 12:06
  • I just plugged TX to TX, RX to RX - no you didn't – Jaromanda X Mar 12 '18 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.