Delayed HTTP Requests
Posted: Mon Aug 31, 2015 10:16 am
Hi all,
I've set up my ESP as an access point and am trying control a pwm duty cycle through GET and POST requests. I'm using the following jquery code on the html side:
The arduino side is using a server.on to call the function that parses the incoming data
Everything works and the data is being parsed correctly however I'm noticing a delay of ~2.5 seconds between the processing of each HTTP request if I send multiple ones. I've been searching around but I can't seem to find a solution for a faster response time.
Can anyone shed some light on this?
I've set up my ESP as an access point and am trying control a pwm duty cycle through GET and POST requests. I'm using the following jquery code on the html side:
Code: Select all
$.post("http://192.168.4.1:80/update", {
lc: inputRange.value,
lb: brightnessRange.value / 100
});
The arduino side is using a server.on to call the function that parses the incoming data
Code: Select all
server.on("/update", HTTP_POST, webUpdate);
Code: Select all
void webUpdate() {
output = server.arg("lc");
setLed(server.arg("lc").toInt(), server.arg("lb").toFloat());
Serial.println();
Serial.print(output);
output = server.arg("lb");
Serial.println();
Serial.print(output);
server.sendHeader("Connection", "keep-alive");
server.sendHeader("Access-Control-Allow-Origin", "*");
server.send(200, "text/plain", "");
}
Everything works and the data is being parsed correctly however I'm noticing a delay of ~2.5 seconds between the processing of each HTTP request if I send multiple ones. I've been searching around but I can't seem to find a solution for a faster response time.
Can anyone shed some light on this?