• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP8266 Home Automation Course Live Alarm and PIR Notification/Status

Q&A Forum › Category: Home Automation › ESP8266 Home Automation Course Live Alarm and PIR Notification/Status
1 Vote Up Vote Down
Hassaanshah016 asked 6 years ago

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

Question Tags: ESP8266, home automation, MQ2, PIR, Smoke sensor
4 Answers
1 Vote Up Vote Down
DK answered 6 years ago

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

1 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

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
 

1 Vote Up Vote Down
Hassaanshah016 answered 6 years ago

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

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

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!

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.