-->
Page 1 of 1

ESP8266 doesn't respond to AT command in AP Mode

PostPosted: Fri Jul 28, 2017 9:46 am
by kubaork
Hi! I made a circuit with Arduino and ESP8266. My program is based on this tutorial: http://allaboutee.com/2015/01/02/esp8266-arduino-led-control-from-webpage/
I wrote simple sketch in Arduino IDE, which makes ESP as AP and prints IP in Arduino IDE Serial Console. Everything was okey, but this Arduino program worked only once. Now, when i connect Arduino via USB, ESP will have two LED's always active (red and blue), will work as AP (i can connect to it via wifi from smartphone), but ESP now doesn't respond to Arduino AT commands. I thought that AT command: AT+CWMODE=2 will work only once, and if I disconnect Arduino, ESP will reset too. Now it doesn't even respond with "OK" command after sending "AT" command. I haven't changed my sketch. Do i need to reset ESP or flash firmware?

Here is my program:
Code: Select all#include <SoftwareSerial.h>
 
SoftwareSerial esp8266(2,3);
void setup()
{
  Serial.begin(9600);
  esp8266.begin(115200);
  while(!Serial);
  Serial.println("Testing serial output");

  sendAT("AT",500); //respond: OK

  sendAT("AT+IPR=9600",500); //change baud rate, because SoftwareSerial don't like 115200
  esp8266.begin(9600);
  sendAT("AT+CWMODE=2",1000); //change mode to AP
  sendAT("AT+CIFSR",2000); // show IP Address

}
void loop()
{

}
boolean sendAT(String commandAT, int time_){
  Serial.print("Sending AT command:");
  Serial.println(commandAT);

  esp8266.println(commandAT);
  delay(time_);
  String response = "";
  while(esp8266.available()){
    response = esp8266.readString();
  }
  Serial.println("Message from ESP:");
  Serial.println(response);
  return 1;
}

Re: ESP8266 doesn't respond to AT command in AP Mode

PostPosted: Sun Jul 30, 2017 5:08 pm
by tele_player
My previous reply was an error, I didn't realize the original poster was actually using ESP8266 over serial from Arduino.

I would still recommend dropping the Arduino, and use the ESP8266 Arduino core instead.

Re: ESP8266 doesn't respond to AT command in AP Mode

PostPosted: Fri Dec 06, 2019 10:20 am
by hangover
I have the same problem.