Site icon Renzo Mischianti

ES8266 convert ESP8266webserver to ESPAsyncWebServer

Good day I am very new in this forum. I realized a small project using the ES8266 and the ESPAsyncWebServer to control a couple of relays. I created a web page that has the push buttons which change their color when the relevant relay is On or OFF. I used the follwing line of code to auto refresh the page: webPage ="<meta http-equiv='refresh' content='5'>"; The page update is working well but there is a problem because when the page is update the Browser send to the server the command that was last activated. The relay comes ON and OFF at 5 secs rate !(e.g: the browser sends:" 192.169.1.80/relay1 "that toggles the relay state). In the past I used the ESP8266webserver.h and the following line of code instructed the browser to engage the wanted IP with no command : server.sendHeader("Location",String ("http://")+"192.168.1.80",true); Could you please indicate to me the equivalent code to be used with ESPsyncWebServer ? Thanks in advance for any reply / help . Bye
Exit mobile version