-->
Page 1 of 3

Arduino ESP8266 garbage data received

PostPosted: Sat Oct 04, 2014 8:48 pm
by Samighi11
I have been struggling with getting some simple data back from my server. it appears the header works fine, but the http itself is garbage. I have tried this on Nano, Mini pro and out of frustration went back to the mega and the issue is still visible.

header is fine

Code: Select all+IPD,306:HTTP/1.1 200 OK
Date: Sun, 05 Oct 2014 01:33:44 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Content-Length: 113
Connection: close
Content-Type: text/html; charset=UTF-8


instead of getting this:
Code: Select all<B>SA office</B>&nbsp-&nbspLast Read at Dec 31 19:00<BR>Current Temp = 0<BR>Min = 1000&nbsp&nbsp&nbsp&nbspMax = 0

at best I get something like this
Code: Select all<B>SA offic/>np&bLsRa  e3 :0BCrn m 0BMn 0&s&s&s&sa 0


this is using SoftwareSerial on Nano and pro-mini. On Mega this is from serial1. on Pro-Mini I am using 922 with 19200. On Mega i am using .92, using Serial,1 at 115200.

I have spend several days on this without any success. I do write to sparkfun phant.io, and it returns a head +"1 success". and that works fine.

Any help would be appreciated. If this pattern has been seen before. Is this a buffer overrun on the ESP8266? at Serial?

SA

Re: Arduino ESP8266 garbage data received

PostPosted: Sat Oct 04, 2014 10:53 pm
by phantoxe
Hi,

Maybe ESP8266 is too fast sending data (after header) and overflows UART RX buffer ?

Don't think it's on the ESP side, as I never had such behavior...

Regards

Re: Arduino ESP8266 garbage data received

PostPosted: Sun Oct 05, 2014 6:55 am
by Samighi11
i even reduced my HTTP header and still garbage page displayed

Current HTTP response
Code: Select all+IPD,265:HTTP/1.1 200 OK
Date: Sun, 05 Oct 2014 11:51:52 GMT
Server: Apache
Content-Length: 113
Connection: close
Content-Type: text/html; charset=UTF-8

<B>SA office</B>&nbsp-&nbspLast Read at Dec 31 19:00<BRCrnTm 0BMn 00bpbpbpbpx=


Code
Code: Select allString  ESP8266::sendAndWait(String AT_Command, char *AT_Response, uint16_t wait) {
        serial.println(AT_Command);
        Serial.println("Sending " + AT_Command);
        delay(DELAY);
        String str = "";
        unsigned long time1 = millis();
        for (int i=0;i<20;i++) {
           while (Serial1.available()) {
                  str = str + serial.readString();   
                       Serial.println(str);         
             
        }
        if (str.indexOf(AT_Response) == -1)
           delay(300);
        else
           break;
       }
   
        if (str.indexOf(AT_Response) == -1)
           return "Not OK";
        else
          return "OK";
}

Re: Arduino ESP8266 garbage data received

PostPosted: Sun Oct 05, 2014 10:51 am
by villTech
i have not experienced garbage data when my hardware set up is all OK.
Have you tried connecting your esp module to a serial cable (usb to serial) and serial terminal to see what the esp module is actually transmitting?