I want to sent AT command into node mcu esp8266 module with arduino IDE through serial monitor.
I connect the node mcu to arduino uno board in following sequence:
RX to pin 2 of arduino
TX to pin 3 of arduino
Vin of node mcu to 3.3V of arduino
GND to GND
EN of node mcu to 3.3V of arduino
I send at commands in serial monitor but dont get any response.
I also checked different baud rates.
what is the problem? what thing I'm doing wrong?
#include <SoftwareSerial.h>
SoftwareSerial esp8266(2,3); //2 -->rx ,3 -->tx
void setup() {
Serial.begin(115200);
esp8266.begin(115200);
}
void loop() {
if (esp8266.available()>0)
{
char c = esp8266.read();
Serial.write(c);
}
if (Serial.available()>0)
{
delay(1000);
String cmd = "";
while (Serial.available())
{
cmd += (char)Serial.read();
}
esp8266.println(cmd);
}
}