Unable to read Arduino+ESP8266 full get Response Using below code I am able to invoke HTTP Get request, but I am not able to read full HTTP Response. Observing only output like( +IPD,0,141:HTTP/1.7. ). Please let me know how can I read full response?
Any Idea what is the issue?
#include &lt;SoftwareSerial.h&gt;

#define RX 2
#define TX 3
String WIFI_SSID = &quot;xyz&quot;;       // Your WiFi ssid
String PASSWORD = &quot;xys&quot;;         // Password


String HOST = &quot;192.168.0.156&quot;;
String PATH = &quot;/test&quot;;
String PORT = &quot;8080&quot;;

int countTrueCommand;
int countTimeCommand;
boolean found = false;

SoftwareSerial esp8266(RX, TX);


void setup() {
  Serial.begin(9600);
  esp8266.begin(9600);
  esp8266.println(&quot;AT&quot;);
  Serial.println(esp8266.read());
  sendCommandToESP8266(&quot;AT&quot;, 5, &quot;OK&quot;);
  sendCommandToESP8266(&quot;AT+CWMODE=1&quot;, 5, &quot;OK&quot;);
  sendCommandToESP8266(&quot;AT+CWJAP=\&quot;&quot; + WIFI_SSID + &quot;\&quot;,\&quot;&quot; + PASSWORD + &quot;\&quot;&quot;, 20, &quot;OK&quot;);
}

void loop() {
  String postRequest = &quot;GET &quot; + PATH  + &quot; HTTP/1.1\r\n&quot; +
                       &quot;Host: &quot; + HOST + &quot;\r\n&quot; +
                       &quot;Accept: *&quot; + &quot;/&quot; + &quot;*\r\n&quot; +
                       &quot;\r\n&quot;;

  sendCommandToESP8266(&quot;AT+CIPMUX=1&quot;, 5, &quot;OK&quot;);
  sendCommandToESP8266(&quot;AT+CIPSTART=0,\&quot;TCP\&quot;,\&quot;&quot; + HOST + &quot;\&quot;,&quot; + PORT, 15, &quot;OK&quot;);
  String cipSend = &quot;AT+CIPSEND=0,&quot; + String(postRequest.length());
  sendCommandToESP8266(cipSend, 4, &quot;&gt;&quot;);
  sendData(postRequest);
  readESP8266(8000);
  sendCommandToESP8266(&quot;AT+CIPCLOSE=0&quot;, 5, &quot;OK&quot;);
}

void sendCommandToESP8266(String command, int maxTime, char readReplay[]) {
  Serial.print(countTrueCommand);
  Serial.print(&quot;. at command =&gt; &quot;);
  Serial.print(command);
  Serial.print(&quot; &quot;);
  while (countTimeCommand &lt; (maxTime * 1))
  {
    esp8266.println(command);
    if (esp8266.find(readReplay))
    {
      found = true;
      break;
    }

    countTimeCommand++;
  }

  if (found == true)
  {
    Serial.println(&quot;Success&quot;);
    countTrueCommand++;
    countTimeCommand = 0;
  }

  if (found == false)
  {
    Serial.println(&quot;Fail&quot;);
    countTrueCommand = 0;
    countTimeCommand = 0;
  }

  found = false;
}

void sendData(String postRequest) {
  Serial.println(postRequest);
  esp8266.println(postRequest);
  delay(1500);
  countTrueCommand++;
}

void readESP8266(const int timeout)
{
  String reponse = &quot;&quot;;
  long int time = millis();
  while( (time+timeout) &gt; millis())
  {
    while(esp8266.available())
    {
      reponse+=esp8266.readString();
    }
  }
  Serial.print(reponse);   
}

Output:
Success
1. at command =&gt; AT+CWMODE=1 Success
2. at command =&gt; AT+CWJAP=&quot;xyz&quot;,&quot;xys&quot; Success
3. at command =&gt; AT+CIPMUX=1 Success
4. at command =&gt; AT+CIPSTART=0,&quot;TCP&quot;,&quot;192.168.0.156&quot;,8080 Success
5. at command =&gt; AT+CIPSEND=0,56 Success
GET /test HTTP/1.1
Host: 192.168.0.156
Accept: */*


 

busy s...

Recv 56 bytes

SEND OK

+IPD,0,141:HTTP/1.7. at command =&gt; AT+CIPCLOSE=0 Success
Finally the HTTP Get request with Arduino Uno + ESP8266 Wifi shield which is working is below:
// This is a demo example using a public http server for testing both GET and POST requests
#include &lt;Arduino.h&gt;
#include &lt;LiteESP8266Client.h&gt;

#define PACKET_MTU 1500    // Standard network MTU is 1500 bytes

LiteESP8266 radio;

const char ssid[] PROGMEM = &quot;xyz&quot;;    //change it to your wifi SSID
const char password[] PROGMEM = &quot;abc&quot;;    //change it to your wifi password
const char host[] PROGMEM = &quot;192.168.0.156&quot;;
const int port = 8080;

const char http_get_request[] PROGMEM = &quot;GET /test HTTP/1.1\r\n&quot;;
const char http_useragent[] PROGMEM = &quot;User-Agent: Arduino-stm32/0.1\r\n&quot;;
const char http_content_type_json[] PROGMEM = &quot;Content-Type: application/json\r\n&quot;;
const char http_host[] PROGMEM = &quot;Host: 192.168.0.156\r\n&quot;;
const char http_close_connection[] PROGMEM = &quot;Connection: close\r\n\r\n&quot;;
const char http_content_length_header[] PROGMEM = &quot;Content-Length: &quot;;
const char success[] PROGMEM = &quot;success&quot;;
const char failed[] PROGMEM = &quot;failed&quot;;
const char CRLF[] PROGMEM = &quot;\r\n&quot;;
const char error_data_null[] PROGMEM = &quot;Error: data came back null.&quot;;

void setupStationMode() {
  Serial.print(&quot;Setup station mode... &quot;);
  if (radio.set_station_mode()) {
    Serial.println(&quot;success&quot;);
  } else {
    Serial.println(&quot;failed&quot;);
  }
}

void joinAP() {
  Serial.print(&quot;Join AP &quot;);
  Serial.print(ssid);
  Serial.print(&quot;... &quot;);
  if (radio.connect_to_ap(ssid, password)) {
    Serial.println(&quot;Success&quot;);
  } else {
    Serial.println(&quot;Failed&quot;);
  }
}

void establishTcpConnect() {
  Serial.print(&quot;Establish TCP Connection... &quot;);
  if (radio.connect_progmem(host, port)) {
    Serial.println( &quot;Success&quot;);
  } else {
    Serial.println( &quot;Failed&quot;);
  }
}

void getHttpPacket() {
  char *data;
  while ((data = radio.get_response_packet(PACKET_MTU, 5000))) {
    if (data) {
      Serial.println(&quot;Packet Received...&quot;);
      Serial.println(data);
    } else {
      Serial.println(error_data_null);
    }
  }
  free(data);
}

void httpGet() {
  Serial.println(&quot;Sending GET request... &quot;);
  radio.send_progmem(http_get_request);
  radio.send_progmem(http_useragent);
  radio.send_progmem(http_host);
  radio.send_progmem(http_close_connection);
}
void setup() {
  delay(2000);
  radio.begin(9600,2,3);
  Serial.begin(9600);
  while (!Serial) {};

  setupStationMode();
  joinAP();
}

void loop() {
  establishTcpConnect();

  httpGet();
  getHttpPacket();
  }

Output:
Setup station mode... success
Join AP ⸮... Success
Establish TCP Connection... Success
Sending GET request... 
Packet Received...
HTTP/1.1 200 
Content-Type: text/plain;charset=UTF-8
Content-Length: 27
Date: Fri, 07 Aug 2020 13:04:03 GMT
Connection: close

Greetings from Spring Boot!

But one issue I am facing is after few call the HTTP invocation is getting stopped probably memory being full. Will check this.