I connect my ESP to Arduino to my PC.
If I send AT commands from my serial monitor, I receive full response. I use 115200 and both NL & CR in my serial monitor.
ESP TX is connected to TX Arduino, same for RX.
The problem is when I try to send commands from my Arduino code. I don't receive any response. I use same 115200 both for serial and for ESP8266.
I user this code:
#include <SoftwareSerial.h>
SoftwareSerial esp8266(0,1);
void setup()
{
Serial.begin(115200);
esp8266.begin(115200);
}
void loop()
{
sendCommand("AT+GMR\r\n");
}
String sendCommand(String command, const int timeout, boolean debug)
{
String come = "";
while(esp8266.available())
{
char c = esp8266.read(); // read the next character.
Serial.write(c);
come += c;
}
Serial.println(come);
return come;
}
I can't see what is wrong here and why that works with just the Serial Monitor.
TX to TX
andRX to RX
in certain cases can be correct. See my answer.