Keeping the web client alive while looping on an input
Posted: Mon Jan 23, 2017 10:03 pm
My application makes the ESP8266 into an access point and is designed to be used interactively by a user with a smart phone. One of the functions of the app waits for a digital input to go high before reacting. The code is the following:
And this works - it does its thing when the input goes high, no matter how long it takes for that to happen. But while waiting, the client on the smart phone loses the connection and the user has to reboot the ESP8266 to regain access. But so far I haven't found a way to keep the client alive. Any ideas on how to do this?
Code: Select all
while(digitalRead(DIGITAL_IN) != 1){
delay(1);
}
doYourThing( );
And this works - it does its thing when the input goes high, no matter how long it takes for that to happen. But while waiting, the client on the smart phone loses the connection and the user has to reboot the ESP8266 to regain access. But so far I haven't found a way to keep the client alive. Any ideas on how to do this?