What you are trying to do is PUSH data from the server to a browser client.
Try searching Google for "HTML PUSH"
Have a look here to get you started :- http://www.instructables.com/id/Push-Data-From-ESP-Webserver-to-Client/
Explore... Chat... Share...
server.sendHeader("Location", "/file", true);
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
server.sendHeader("Pragma", "no-cache");
server.sendHeader("Expires", "-1");
server.send(302, "text/plain", "");
server.client().stop(); // Stop is needed because we sent no content length
freddy-a wrote:The webserver does not actively push pages.
Your browser has to request a page from the webserver.
If you upload a new page to your webserver, nothing is going to trigger your browser (or the webserver) to refresh the page.
You could put a command in your page (the you've opened with your browser) that refreshes the page every ## seconds.
This is the HTML command:
<meta http-equiv="refresh" content="30">
And this would (probably) be the string in your ESP8266 code:
ptr +=" <meta http-equiv=\"refresh\" content=\"30\">\n";
This should be placed within the HEAD tag!
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]