PROBLEM - Problem with ESP8266EX

Hi Everyone,

I’m having troubles with ES8266EX Module… I’m using a 3.3V source for it …

This is what I receive with AT+RST command

AT+RST



busy p...

OK

 ets Jao  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000,0l6
t`il 0
chks]Y�ÂÙšj
loab 0x3ffe8000& len 776, rë«Âj
tail 0
chk®][‚ÂÁ3,

2r
 ze
s2¥	r
Œãœï“pƒŒóŒ

this is my sketch

#include <SoftwareSerial.h>
 
SoftwareSerial esp8266(4,5); // make RX Arduino line is pin 2, make TX Arduino line is pin 3.
                             // This means that you need to connect the TX line from the esp to the Arduino's pin 2
                             // and the RX line from the esp to the Arduino's pin 3
void setup()
{
  Serial.begin(9600);
  esp8266.begin(115200); // your esp's baud rate might be different
}
 
void loop()
{
  if(esp8266.available()) // check if the esp is sending a message 
  {
    while(esp8266.available())
    {
      // The esp has data so display its output to the serial window 
      char c = esp8266.read(); // read the next character.
          
      Serial.write(c);
    }  
  }
  
 
  
 if(Serial.available())
  {
    // the following delay is required because otherwise the arduino will read the first letter of the command but not the rest
    // In other words without the delay if you use AT+RST, for example, the Arduino will read the letter A send it, then read the rest and send it
    // but we want to send everything at the same time.
    delay(500); 
    
    String command="";
    
    while(Serial.available()) // read the command character by character
    {
        // read one character
      command+=(char)Serial.read();
    }
    esp8266.println(command); // send the read character to the esp8266
  }
}

any idea?

Serial data arrives slowly. The loop() function will iterate many thousands of times after you enter an AT command in the serial monitor and press send, before the final character is read. The characters will be sent to the ESP one at a time, NOT all at once.

SoftwareSerial can, under ideal conditions, operate at 115200 for short periods of time. It can not operate reliably at that speed sending and receiving lots of data.

Either use a slower speed, or get an Arduino with multiple hardware serial ports, and use on of the other hardware serial ports to talk to the ESP.