• 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

[Full Project] ESP32 Asynchronous Web Controlled Thermostat

Q&A Forum › Category: ESP32 › [Full Project] ESP32 Asynchronous Web Controlled Thermostat
0 Vote Up Vote Down
Steph asked 5 years ago

Hello,

This project came out of a discussion I had with Yves Bourdon, here on the RNT Lab forum, on how to implement an updated web interface to control an ESP32, without the need to reload the entire page. In other words, the idea here is to perform asynchronous requests from the client browser to query the microcontroller on the status of the data to be displayed, and then to perform local updates of the user interface as soon as the data provided by the ESP32 is received.

There are several techniques to achieve this, including the use of WebSockets, which I much prefer to traditional methods that rely on AJAX. Nevertheless, Yves wanted to understand how to implement this technique with AJAX. This is the purpose of this project. Another one will follow to illustrate how to proceed with WebSockets…

I propose two techniques to implement asynchronous exchanges between the client browser and the web server running on the ESP32:

– a classical method that uses the XMLHttpRequest object of Javascript
– a more modern method that uses the Async/Await protocol of Javascript

So you have the choice to use one or the other.
The first is the one used by Rui and Sara in their tutorials.

The full project is available on GitHub.

I have carefully commented on the entire code to make it easier for you to understand. Don’t hesitate to come back and ask questions by answering this post dedicated to the project.

Here’s a glimpse of what’s in store for you:

Circuit Overview Web User Interface

Each time the current temperature reading is taken, the interface is updated in a totally transparent way, without the need to reload the page. And the temperature display automatically adapts to the situation by changing colour to indicate if everything is fine or if you’re out of the permitted range. A reading error on the sensor can also occur. The display will take this into account:

1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Stéphane.
Great project! Thank you so much for sharing.
I’ll take a look at the complete project on GitHub. I’m sure I’ll learn something new and that it will be very useful for our readers.
Thank you so much.
Regards,
Sara

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.