Failed to connect to ESP8266: Timed out waiting for packet header

I am facing some problem which is Failed to connect to ESP8266

This is the code:

#include <SoftwareSerial.h>
SoftwareSerial espSerial(0, 1); // RX, TX

void setup() {
  Serial.begin(9600);
  espSerial.begin(9600);
  delay(1000);
  espSerial.println("AT+RST"); // reset the ESP8266 module
  delay(1000);
  espSerial.println("AT+CWMODE=1"); // set the module to client mode
  delay(1000);
  espSerial.println("AT+CWJAP=\"dlink-04FF\",\"gbudr79638\""); // replace with your Wi-Fi network credentials
  delay(5000);
}

void loop() {
  float temperature = 25.0; // replace with your own data to be sent to ThingSpeak
  String apiKey = "05WSZUIIGI84SCAB"; // replace with your own ThingSpeak API key
  String url = "GET /update?key=" + apiKey + "&field1=" + String(temperature);
  espSerial.println("AT+CIPMUX=0");
  delay(1000);
  espSerial.println("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",80");
  delay(1000);
  espSerial.print("AT+CIPSEND=");
  espSerial.println(url.length() + 2);
  delay(1000);
  espSerial.println(url);
  delay(5000); // wait for the response from ThingSpeak
}

This is the error:
. Variables and constants in RAM (global, static), used 28740 / 80192 bytes (35%)
║ SEGMENT BYTES DESCRIPTION
╠══ DATA 1496 initialized variables
╠══ RODATA 1100 constants
╚══ BSS 26144 zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 61895 / 65536 bytes (94%)
║ SEGMENT BYTES DESCRIPTION
╠══ ICACHE 32768 reserved space for flash instruction cache
╚══ IRAM 29127 code in IRAM
. Code in flash (default, ICACHE_FLASH_ATTR), used 243000 / 1048576 bytes (23%)
║ SEGMENT BYTES DESCRIPTION
╚══ IROM 243000 code in flash
esptool.py v3.0
Serial port COM3
Connecting......................................_____

A fatal esptool.py error occurred: Failed to connect to ESP8266: Timed out waiting for packet header

I can't really help you.

  1. Which exact board are you using?
  2. The ESP8266 is a 3,3V device.Your feeding is 5V signals (Uno's TX) which might not be healthy for the ESP8266.
  3. You're using the Uno as a TTL-to-USB adapter. Make sure that no program is running on the Uno; safest way is to jeep the Uno board in reset,

Have you seen this:

and this:

what do your orange and yellow wires connect to?

and more fundamentally - if you have an application that requires wifi, why not do it all on a board that supports it? Or is it your idea that the ESP-01 will do that?

  1. Arduino uno v3
  2. I confirm twice and it feeding in 3.3V correctly.
  3. I think that is not working and showing same output.

Orange and yellow wires is connect from ESP8266 to arduino uno which is
Orange = RX (esp8266) to RX <- 0 (arduino uno)
Yellow = TX (esp8266) to RX -> 1 (arduino uno)

Because I am done all of works in tinkercard and this is the last step which is connect to wifi. Now I am trying to setup correctly and facing this problem right now.

I could see that; I was asking about the other one.

I was talking about the TX of the Arduino; that is a 5V signal and can possibly damage the ESP8266.

USB is connected trough Rx and Tx pins on Arduino uno, so you cant use them, use Software serial with other pins.

@noobmastha

You can use those pins if there is no code running on the Uno; either empty sketch or keep ino in reset.

Pity about the bold print, Well that code is supposed to run an the UNO i guess, but if you use swSerial, you should not use the hwSerial pins.

What it looks like to me is that you have code that will make use of the AT-firmware of the ESP and control the ESP from the UNO. You should try and upload that code onto the UNO.

I don't really support that method. It is so much more efficient to upload your own firmware onto the ESP.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.