Shield Esp8266 Esp12e on Mega2560 : Failed to connect to ESP8266

Hi guys! How are you doing? I assembled a Shield Esp8266 Esp12e on Arduino mega 2560 to control relays in the system. But the process to write generate a esptool.FatalError:

"esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header".

Serial port /dev/cu.usbmodem1101
Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
  File "/Users/caiosanchezchristino/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py", line 66, in <module>
    esptool.main(cmdline)
  File "/Users/caiosanchezchristino/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 3552, in main
    esp.connect(args.before, args.connect_attempts)
  File "/Users/caiosanchezchristino/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 529, in connect
    raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

and. That's my board system.

I'm using MAC Monterey. Arduino IDE 1.8.19 and NodeMCU 1.0 (ESP-12E Module) from ESP8266 version 3.0.2

anyone already past for this problem and can help me?
Thanks!

difficult to see from you photo but did you follow Step 2: Firmware Upgrade on ESP8266 ESP-12E UART Wireless WIFI Shield TTL Converter for Arduino ESP8266-ESP-12E-UART-Wireless-WIFI-Shield
I would use USB-TTL serial converter to program the ESP8266, e.g. DIL switch positions

  1. to program down down up up
  2. to run program all down

As you stated correctly in the topic name, it failed to connect. chances are you need to flick some dip-switches to upload new firmware to the ESP. Check the manual of the shield.
In the next sketch try and set up OTA updates, that will save a lot of hassle.

Thanks for helping @horace and @Deva_Rishi
I believe that's an upgrade isn't solve the problem.. i think about dip-switches makes sense to me because if I keep the reset button of mega pressed, the build are started with success. But process to write exceed the 17s and reset me Mega board and the code aren't written.

@Deva_Rishi Are only available dip-switches on shield Esp selectors right? It's possible set a "jumper" the Mega 2560 too?

I assume you are attempting to program the device by connecting the shields EXTERNAL SERIAL USB ADAPTER CONNECTION to RX0 and TX0 of the UNO
the shield guide (referenced in post #2) states
NOTE: Before mounting the Arduino wiring diagram, you must load a blank code on the board to ensure that the serial USB converter is not being used.
did you do thst?
never attempted to program a shield this way - always used a USB-TTL converter

If i understood the tutorial in #2 correctly, to upload using the mega (or UNO as in the tutorial.)

  • first load a blank sketch (or blink) onto the mega.
  • and set dip 3 & 4 to 'ON' and reset the shield.
  • and connect the shields TX to mega TX and RX to RX.

It is a weird shield in my opinion, but like that it should work.

tend to agree - I have several of these shields but prfer using the NodeMCU ESP8266 being far easier to program and use