ESP unable to read long Strings returned by HTTP GET request
Posted: Sun May 17, 2015 5:57 pm
Hello ESP world! I am working on getting the ESP to send a GET request and get reply back from website. I have been able to send the request but the reply from the website is always truncated, so I cannot extract any information from the HTML reply. My code accesses google.com, then waits 5 seconds and prints the HTTP GET reply to the Serial Monitor, but it always ends up being cut short!!! Here is the part of my code that handles the GET and reply
And here is some sample output to the Serial Monitor,
Any help appreciated I love this forum!~
Code: Select all
String cmd2 = "AT+CIPSTART=\"TCP\",\""; //make this command: AT+CIPSTART="TCP","107.180.3.137",80
cmd2 += DST_IP;
cmd2 += "\",80";
altSerial.println(cmd2); //send command to device
delay(1000);
if(altSerial.find("OK")) {
Serial.println("link good");
String cmd="GET http://www.google.com HTTP/1.0\r\n\r\n";
altSerial.print("AT+CIPSEND=");
altSerial.println(cmd.length());
if(altSerial.find(">")) {
//Serial.println(cmd.length());
//Serial.print(cmd);
delay(500);
altSerial.print(cmd);
}
delay(5000);
while(altSerial.available()) //get command line
{
char c=altSerial.read();
Serial.print(c);
}
Serial.println();
And here is some sample output to the Serial Monitor,
Code: Select all
Network recognized!
resetting . . . . .ready to go
link good
GET http://www.google.com HTTP/1.0
SEND OK
+IPD,1460:HTTP/1.1 200 OK
Da
resetting . . . . .ready to go
link good
GET http://www.google.com HTTP/1.0
SEND OK
+IPD,1460:HTTP/1.1 200 OK
Da
resetting . . . . .ready to go
Any help appreciated I love this forum!~