Dear All,
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
Regards,
M.H.S
Hi, you can use Ajax: circuits4you.com/2018/02/04/esp8266-ajax-update-part-of-web-page-without-refreshing/
Basically
index.h
<span id="LEDState"> //LEDSate holds your PIR Status, which is updated by
Server Code
String t_state = server.arg("LEDstate");
Hope it helps
Yes.
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.
Regards,
Sara
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.
[1] AjAX
[2]
[3]… etc
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.
The only way to update readings without refreshing the web page on an ESP web server is using JavaScript (AJAX).
If you were using another server like NodeJS, you could use socket.io for example…
I hope that helps!