I would like to exchange AT commands in between Pro Mini and ESP8266.
Recently I am working on a project with Pro Mini and ESP8266. I use Pro Mini to Serial.wirte("AT+ACK")
And once my ESP8266 detects this string it will send something back for e.g. ("AT+ACK"). The the Pro Mini
will do correspondent action once it detects the AT+ACK.
However, when I put the two chips together and try to do the automation it seems not working properly.
do I need to put \r\n when one chip tries to write the AT commands? "e.g.(Serial.wirte("AT+ACK\r\n") ) but at the other side
should I use the following format
void loop()
{
if (Serial.available())
{
String myString = Serial.readStringUntil('\n');
if (myString=="AT+ACK")
{
}
}
or
void loop()
{
if (Serial.available())
{
String myString = Serial.readStringUntil('\n');
if (myString=="AT+ACK\r\n")
{
the second scenario seems not working.
Hope someone can give me some suggestions.