-->
Page 1 of 4

[Solved] After "Serial.begin" ESP8266 doesn't respond

PostPosted: Sat Jan 02, 2016 3:03 pm
by Joel
Just got my ESP8266 and I can successfully talk with it in the Serial Monitor with a Arduino uno r3. I have connected it to a network and it seems to be stable. I haven't done anything with the firmware (AT version:0.25.0.0 and SDK version:1.1.1). I can only talk with it over baud rate 115200. When I was going to start to write my project I found out that as soon the Arduino reads "Serial.begin(115200)" the ESP8266 doesn't respond anymore.

Do I have to use any library to be able to talk with the ESP8266 through a sketch? I've seen several guides without any libraries. Or have I just missed something important to get it to work



Code: Select alllong milli;

void setup() {
  milli = millis();
}

void loop() {
  //As long as as start(); isn't executed I can talk to ESP8266
  if(milli+10000 < millis()){
  start();
  }
}

void start(){
  Serial.begin(115200);
  Serial.println("AT");
  //After Serial.begin I can't talk to it anymore and it doesn't respond with OK
  delay(5000);
 
  if(Serial.find("OK")){
    //Do something
    Serial.println("OK");
  }
}


//First 10 seconds when I can talk to it
AT


OK
//After Serial.begin
AT
AT
AT
AT
AT
AT

Re: After "Serial.begin" ESP8266 doesn't respond

PostPosted: Sat Jan 02, 2016 7:05 pm
by pipi61
Hi!
serial.begin don't call periodically, only call once in setup routine

Re: After "Serial.begin" ESP8266 doesn't respond

PostPosted: Sat Jan 02, 2016 7:32 pm
by Joel
pipi61 wrote:Hi!
serial.begin don't call periodically, only call once in setup routine

Ohh yeah that's true. Just wrote something together to show my problem. But regardless it doesn't work. Just something simple as this still doesn't give me any response
Code: Select allvoid setup()
{
  Serial.begin(115200);
  Serial.println("AT");
  delay(5000);
  if(Serial.find("OK")){
    Serial.println("OK");
}
}

void loop(){
}

Re: After "Serial.begin" ESP8266 doesn't respond

PostPosted: Sun Jan 03, 2016 6:27 am
by schufti
Hi,
the esp8266 AT firmware is very sensitive about CR/LF.
Maybe serial.println doesn't send the "correct" order or only one of CR/LF ...