I am new to Arduino & ESP modules, here am trying to communicate with ESP-01 via Arduino UNO. I have gone through multiple websites for initial setup. But when i upload my code to UNO, ESP is not responding back.Below is the code i have used.
#include<SoftwareSerial.h>
SoftwareSerial ESP(0,1); // RX, TX
//ESP RX-->1(UNO) TX-->0(UNO)
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
ESP.begin(9600);
}
void loop() {
ESP.write("AT\r\n"); //Normally ESP responds to AT command with "OK"
while (ESP.available()) {
char inData = ESP.read();
Serial.println("Got reponse from ESP8266: ");
Serial.write(inData);
}
}
My observation on this is
- ESP is blinking blue light when i reset UNO
- UNO TX onboard LED is blinking
- when i am trying to do
Serial.println("Goodnight moon!");
it is printing Serial.println("Got reponse from ESP8266: "); Serial.write(inData);
is not printing
My questions are:
- Is there any need to flash ESP with Firmware or is it default enabled.(i have 3 esp's with me all of them not responding with above code)
- If no need then what is the possible mistake i am doing.
Here is the screenshot https://i.stack.imgur.com/mOklg.png
Note: I haven't used breadboard for connection, directly connected UNO-TX -> ESP RX and UNO-RX -> ESP TX, 3.3v VCC and ground.In the above screenshot on upload nothing prints, only when i type something "Got reponse from ESP8266: " is printing