Using delay with WebServer handleClient

Posts: 4
Joined: Thu Apr 18, 2019 12:30 pm

Using delay with WebServer handleClient

Postby Emygma » Sun Jun 30, 2019 5:32 pm


I am using this library to run a simple webserver, with the ESP32 as AP ... Server.ino

Everything works fine, if there's only server.handleClient(); in the loop and nothing else.

But the problem is that i need to run another function in the loop that takes a about 150ms to complete.
So something like this:

Code: Select all


void test()
   digitalWrite(13, HIGH);
   digitalWrite(13, LOW);
   digitalWrite(13, HIGH);

And that causes a problem where when I POST an html form, i get an error page in my browser sometimes with a closed connection message.
Basically, sometimes the page loads and sometimes it does not.

So how can I make the server.handleClient() work properly with that delay?

Who is online

Users browsing this forum: No registered users and 22 guests