1

I'm successfully running AT commands via the Serial Monitor. But now I'm issuing AT commands via Arduino code and facing problems getting the correct response.

Goal: After issuing AT commands programatically, knowing whether these run successfully or not.

Microcontroller: Arduino Uno

#include<string.h>
#include<SoftwareSerial.h>

#define OK "OK"
#define SERVER_PORT 1234
#define RX_PIN 2
#define TX_PIN 3

SoftwareSerial ESP(RX_PIN, TX_PIN);

void setup() {
  Serial.begin(115200);
  Serial.println("First serial");
  while(!Serial);
  ESP.begin(115200);
  Serial.println("Second serial");
  while(!ESP);
  //Enabling multiple connections
  ESP.println("AT+CIPMUX=1\r\n");
  while (!ESP.available());
  String muxResponse = ESP.readString();
  Serial.print("muxR:");
  Serial.println(muxResponse);
}

void loop() {
  if (ESP.available()) {
    String val = ESP.readString();
    Serial.println(val);
  }
}

After running the above code I get the response in the Serial Monitor like:

muxR:AT+CIPMUX=1


busy p../

OK

I'm getting special characters too.

8
  • You could try lowering the baud rate to see if the problem goes away: ESP.begin(9600); then increase in increments. I guess you are using some sort of level shifting between the Uno and the ESP8266 device. Commented Feb 26, 2017 at 9:34
  • Ok. I'm just using arduino uno R2, ESP8266 and breadboard, nothing else. Commented Feb 26, 2017 at 10:55
  • @6v6gt I changed the baud rate of ESP8266 to 9600 by AT+CIOBAUD=9600. Baud successfully changed but getting same response. Getting this busy p.. :( Commented Feb 26, 2017 at 11:09
  • busy p../ error not going even after factory reset (AT+RESTORE). Commented Feb 26, 2017 at 11:40
  • Maybe you find something here. I's a similar case: arduino.stackexchange.com/questions/18575/… Commented Feb 26, 2017 at 11:44

1 Answer 1

1

change

AT+CIPMUX=1\r\n

to

AT+CIPMUX=1
1
  • Explain that, what was the mistake and how your answer correct it. As it, it solve the problem at hand without educating the OP. Commented Feb 17, 2018 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.