In the course “ESP8266 Home Automation” I want to see the Smoke Sensor & PIR Motion sensor status live notification instead of refreshing the page every time.
Your help is much appreciated. Thank you
Hi, you can use Ajax: circuits4you.com/2018/02/04/esp8266-ajax-update-part-of-web-page-without-refreshing/
<span id="LEDState"> //LEDSate holds your PIR Status, which is updated by
String t_state = server.arg("LEDstate");
Hope it helps
Derek is right.
You can use Ajax.
You can take a look at this tutorial: https://randomnerdtutorials.com/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide/
It updates automatically DHT sensor readings, but you can modify it to display the state of your sensors.
I hope this helps.
Thank you for your prompt response.
Can you quickly summarize other options aside AJAX. As I want it to be in my knowledge the total number of different ways I can handle the live readings aside AJAX.
Like AJAX is one way. If possible kindly reply as list form.
If you’re using the ESP as a standalone device to display a web server, you shouldn’t expect to have a full featured web server with all the functionalities.
If you were using another server like NodeJS, you could use socket.io for example…
I hope that helps!