I have ESP 01 module, and it is connected with ARDUINO UNO. I have wired my ESP to Arduino as below
ESP - Arduino
VCC - 3.3 V
GND - GND
CH-PD - 3.3 V
TXD - digital pin 2
RXD - digital pin 3
and the program used here is
#include <SoftwareSerial.h>
const byte rxPin = 2; // Wire this to Tx Pin of ESP8266
const byte txPin = 3; // Wire this to Rx Pin of ESP8266
// We'll use a software serial interface to connect to ESP8266
SoftwareSerial ESP8266 (rxPin, txPin);
void setup() {
Serial.begin(9600);
//You may need to uncomment this block for the first run:
// ESP8266.begin(115200); // Change this to the factory baudrate used by ESP8266
// delay(1000);
//
// Serial.println("Setting BAUDRATE to 9600");
// ESP8266.println("AT+IPR=9600");
ESP8266.begin(9600);
}
bool okReceived = false;
void loop() {
if (Serial.available() > 0)
{
String command = Serial.readStringUntil('\n');
Serial.println("Command Sent: " + command);
Serial.println();
ESP8266.println(command);
}
int responseCounter = 0;
if (ESP8266.available() > 0)
{
while (ESP8266.available() > 0)
{
if (responseCounter == 0)
{
Serial.println("Response Received:");
}
String response = ESP8266.readStringUntil('\n');
Serial.println(response);
responseCounter++;
}
Serial.println();
Serial.println("============");
Serial.println();
}
}
The module worked fine for the first time, and it has received the AT commands and responded back. When I powered off and again powered on the ESP module it seems not responding to AT commands and blue and red LEDs are constantly ON.
I kindly request the reader to help me with this issue, Thanks in advance