This is my very first project with a Uno board and ESP module. I have some experience with 8051 uP. I'd like some guidance in addressing my issue.
Objective:
To connect ESP8266MOD to my wifi network and send a TCP message to my HOME_SERVER whenever required.
Hardware Module: UNO (Induino R5 Arduino R3 USB Clone Board) --> level shifter --> ESP8266MOD
As a first step, I am trying to send AT+RST command from the Uno to the connected ESP. But there is no response from the ESP. However, I am able to notice a LED blink on the ESP, whenever there is TXD operation in my Uno.
Hardware Connection:
UNO - Uses USB Power supply from laptop
ESP8266MOD- Uses 3 1.5V AA Batteries
||
UNO PINS TXD RXD 5V GND
|| || ||
LEVELSHIFTER >>RXI <<TXO HV,GND
|| ||
RXO<< TXI>> LV,GND
|| || ||
ESP8266MOD RXD TXD 3.3V,GND
ESP8266MOD Settings:
CH_PD ->> 3.3V
GPIO2 ->> 3.3V
GPIO0 ->> GND
GPIO15->> GND
Uno Code:
#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);
ESP8266.begin(9600); // Change this to the baudrate used by ESP8266
delay(3000); // Let the module self-initialize
}
void loop() {
Serial.println("Sending an AT command...");
delay(3000);
ESP8266.println("AT+RST");
delay(30);
String response = "";
while(ESP8266.available()) {
char c = ESP8266.read();
response+=c;
}
if(response != "") {
Serial.println(response);
} else {
Serial.println("Empty\r\n");
}
}
Output Video: Output video view