User mini profile

I am trying to get a dynamic website from my ESP8266 server. It should update the runtime of the ESP every second. I have prepared some code that doesn't work ... yet. It hangs in the javascript part where it tests for 'readyState==4' and 'status==200'. This test fails and it triggers an alert.

The ESP does serve xml-data. The ulr 'http://192.168.xxx.yyy/xml' returns a proper xml-formatted page.

User mini profile

I got it to work!! I had a Eureka-moment when I replaced the 'GET' method by the 'PUT' method. Now the website remains static and only the desired parts are updated. I think this is awesome. It gives me a wireless alternative to the serial monitor. Now I can watch variables (switches, temperatures, IR-sensors etc.) in realtime and in a browser without having to refresh it all the time.

Below is the code I wrote. It is complete and should work in your ESP, so check it out. It seems pretty stable and it works in Chrome, Firefox, IE and on my phone (Android). It only crashes when there are multiple browsers accessing the ESP at the same time.

If you have any ideas to make my code better or to solve the multiple-access-crashing problem, please leave a message here.

User mini profile

- Sun Aug 02, 2015 11:22 am#24831
Hi,Your ESP8266 AJAX web server is very impressive. Please give me the link for correct type of library files ESP8266WiFi.h ,ESP8266WebServer.h. I tried using the one in (esp8266-Arduino-master) and it does not recognize and says No such file or directory. Please Help.Best Regards,Ragothamann R.

User mini profile

- Sun Aug 02, 2015 1:33 pm#24834
Dude !You are a fricking legend .. I have so many uses for this as I want to use them for simple debugging at times...now .. just need to make it into a rs232 bridge and I will be in heaven..