ESP 01 not responding on AT commands.

Hi here.

Using ESP 01 with arduino UNO in 2 ways:

  1. when module connected to tx and rx, arduino reset is connected to GND, so basically arduino is like USB uploader (tried to update firmware) - everything works just fine.

  2. when module is connected to custom digital pin and will use serial monitor. But in this case, wifi module ignores all AT commands. Using breadboard supply with 3.3v.
    When I trying to send some command via serial monitor, I see that wifi module receives something, his TX led works for a half of second - received command, but I see no updates in serial monitor window.

connects:

ESP GND -> supply GND
ESP VCC -> supply VCC
ESP CH_PD -> supply VCC
ESP TX -> arduino 3 pin
ESP RX -> arduino 2 pin

(I have tried already a lot of combinations and external connections and this one is 'default' I guess)

here is my sample code:

#include <SoftwareSerial.h>

const byte rxPin = 2; 
const byte txPin = 3; 

SoftwareSerial ESP8266 (rxPin, txPin);

void setup() 
{
Β  Serial.begin(115200);
Β  ESP8266.begin(115200);Β  
Β  delay(1000);Β  Β  Β  Β   
}

void loop() 
{
Β  delay(1000);
Β  Serial.println("Sending an AT command...");
Β  ESP8266.println("AT");
Β  delay(30);
Β  while (ESP8266.available())
Β  {
Β  Β   Serial.println("...");
Β  Β   String inData = ESP8266.readStringUntil('\n');
Β  Β   Serial.println("Got response from ESP8266: " + inData);
Β  }Β  
}

61cR93dX74L.SY355.jpg

  1. Try smaller baudrate. Not all equipment could work at 115200, I have examples of 9600.

  2. Try ESP8266.print("AT\n"); or ESP8266.print("AT\r"); - what is the line break symbol there? #13 or #10 or #13#10 like in Windows?

  3. Check if you not put rx pin instead of tx

  4. Maybe some delay in loop is necessary? It will just flood your screen or hang until not receive something

  5. What about

pinMode(PINSERRX, INPUT);

pinMode(PINSERTX, OUTPUT);

in Setup()?

AndreyZelenchuk:
connects:

ESP GND -> supply GND
ESP VCC -> supply VCC
ESP CH_PD -> supply VCC
ESP TX -> arduino 3 pin
ESP RX -> arduino 2 pin

(I have tried already a lot of combinations and external connections and this one is 'default' I guess)

here is my sample code:

#include <SoftwareSerial.h>

const byte rxPin = 2; 
const byte txPin = 3;

That is wrong. You need to make the connections RX-TX, TX-RX. The reason is that RX stands for "receive" and TX stands for "transmit".

Now you may be thinking "but I had it connected RX-RX, TX-TX when I was using configuration (1) and it worked fine". The reason that worked is because you weren't communicating between the ESP8266 and the primary ATmega328P microcontroller on the Uno. You were communicating between the ESP8266 and the USB to TTL serial adapter chip on the Uno (ATmega16U2 or CH340). The USB to serial adapter chip is connected to the ATmega328P RX-TX, TX-RX, so what appeared to you to be an RX-RX, TX-TX connection was really an RX-TX, TX-RX connection.

mmessiah is correct that you can't use 115200 baud. The SoftwareSerial library doesn't work reliably at that speed. You will need to use the appropriate AT command to set the ESP8266 to use a lower baud rate.

1 Like