I am working on a project where the ESP 8266 sends a very long string about 3000 chas over http as client. Likewise sensor data are determined. The loop repeats itself every 250ms. Now I noticed that my server gets the data of the ESP often slower. In rare cases it takes up to a minute until the server receives something.
How do these delays occur and why are they not constantly the same? Does the length of the string have something to do with it or how much does it affect the delay? Are calculation and sensors processed only after sending?
The ESP works with this function.
String http_GET(String value){
String payload = "non_Message";
if (WiFi.status() == WL_CONNECTED) { //Check WiFi connection status
//WiFiClient client;
HTTPClient http; //Declare an object of class HTTPClient
String send_data = "http://" + web_conect + value;
//http.begin(client, send_data);
http.begin(send_data);
//http.begin("http://" + address + ":" + port + "/" + path +"?" + param + "=" + value); //Specify request destination
int httpCode = http.GET(); //Send the request
if (httpCode > 0) { //Check the returning code
payload = http.getString(); //Get the request response payload
Serial.println(payload); //Print the response payload
cut_time_date(payload);
}
http.end(); //Close connection
}
return payload;
}