readString() missing characters

Hi guys,

I am trying to host configuration website over ESP8266, which itself has MCU. Communication between this Wi-Fi module and Arduino (Mega) is handled over Serial line, simply by AT commands. But when I started to interpret some kind of request listnerer, I came to this problem.

In the loop() is something like this:

if(Serial1.available() > 0) {
  delay(200);
  if(Serial1.find("+IPD,")) {
    String esp_ipd = "";
    esp_ipd = Serial1.readString();
    Serial.println(esp_ipd);
    // stuff
  }
}

And when I was checking the HTTP request sent to me, I've found that some characters in the middle of the message are missing (see attachment).

I've tried to use while loop for reading character by character but that was even worse (recieved only beginning of the request and messed up).

So if someone figure something out how to handle this weird situation, I would be very happy for any advice.

bug.png

Hello and welcome,

Remove the delay(200)

You've saved my life, sir! Or project at least but very important one. So thank you a lot!

You may find the examples in Serial Input Basics useful.

...R

mrKastan:
You've saved my life, sir! Or project at least but very important one. So thank you a lot!

It "works" but for wrong reason. Check your PM.