title: Arduino missing data Serial.println()
body: <p>I'm using an ESP8266 connected to an Arduino Uno via SoftwareSerial to make a post request to an API of temperatures values captured by the module DHT22.
  I'm having problems with sending data over the TCP connection and I think it comes from the way the data is constructed (variable postRequest).</p>
  
  <pre><code>void httppost(){
    String postRequest = String("POST " + uri + " HTTP/1.1\r\n" +
        "Host: " + server + ":" + port + "\r\n" + 
        "Accept: *" + "/" + "*\r\n" + 
        "Content-Length: " + data.length() + "\r\n" + 
        "Content-Type: application/x-www-form-urlencoded\r\n" + 
        "\r\n" + data + "\r\n");
    Serial.println(postRequest);
    delay(3000);
    Serial.flush();
    String tcpStart = "AT+CIPSTART=\"TCP\",\"" + server + "\",\"" + port + "\"";
    String sendCmd = "AT+CIPSEND=" + String(postRequest.length());
    esp.println(tcpStart); //start TCP connection
    delay(3000);
    if(esp.find("OK")){
      Serial.println("TCP connection OK");
      esp.println(sendCmd); //send the data over TCP connection
      delay(3000);
      if(esp.find("&gt;")){
        Serial.println("Sending data");
        esp.println(postRequest);
        delay(3000);
        if(esp.find("SEND OK")){
          Serial.println("Packet sent");
          while(esp.available()){ //number of bytes/char available for reading
            char tmpResp = esp.read(); //read one char at the time
            Serial.print(tmpResp);
            if (tmpResp == '\0') continue; //terminate the while when end of the data
          }
          esp.println("AT+CIPCLOSE"); //close TCP connection
        }else{
          Serial.println("--&gt; An error occured while sending packet");
        }
      }else{
          Serial.println("--&gt; ESP8266 is not listening for incoming data");
      }
    }else{
      Serial.println("--&gt; Cannot initiate TCP connection");
    }
  }
    Serial.flush();
  </code></pre>
  
  <p>I'm always getting as output: "--> ESP8266 is not listening for incoming data".
  Another thing that makes me think the problem is from postRequest variable it's because when I try to print the variable to Serial.monitor some lines are missing from the string.
  I already try to solve this problem adding Serial.flush(), delays but none of this is the solution.</p>