Post topics, source code that relate to the Arduino Platform

User avatar
By Samighi11
#1195 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
User avatar
By Samighi11
#1227 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";
}
User avatar
By villTech
#1241 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?