Help on code explanation for ESP8266 AdvancedWebServer Example


I have been working through the ESP8266 AdvancedWebServer Example as found in the Arduino IDE and was wondering why the webpage takes 5 -> 7 secs to update.

Is it just because of the network protocol doing its stuff or is there a time delay somewhere which I can't find?

The code can be found:


To put your code in a code box, use the </> icon in the far left of the post tool bar and paste your code between the two bracket sets that appear.

To go back and put your code in a code box, in the bottom right of your post, select “more” and click modify. When the modify post opens, high light your code and click the </> in the far left of the post tool bar. This will put you code in code brackets. Then save the changes.

I loaded the advanced web server code from the esp8266 examples in the IDE and it compiled, loaded, and runs. It actually loaded very quickly on my router setup and the page updates every 5 seconds. Don't see any issues here with the IDE example code. Not sure if it is the same as yours.

I had no problem compiling and running. I just thought the page would update faster since there is not much on the page. Maybe I am expecting too much or my router is a bit slow passing info to my laptop…

I found why it updates every 5 secs.

There is a line in the html code section which does the refresh.

    <meta http-equiv='refresh' content='5'/>\
    <title>ESP8266 Demo</title>\

Handy to know for future projects…


"Handy to know for future projects..

You can use iframes in a page and just the frame contents refresh instead of the whole page.

Thanks ..

I will look into that....