• 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

ESP32 Webserver, how to avoid HTML page refresh

Q&A Forum › Category: ESP32 › ESP32 Webserver, how to avoid HTML page refresh
0 Vote Up Vote Down
Vito Lamarca asked 5 years ago

Hi to everyone,
I am newbie on the ESP32, and I would like to create a simple HTML page that I can use for different projects.
The page shall include:

  • user authentication;
  • real-time plots for telemetries;
  • toggle switches (to send telecommand);
  • some buttons (to send telecommand);
  • some textbox with related submit buttons (to pass same input values to the server).

With this structure, I could easily customize the HTML page for different applications.
Currently, following your tutorials, I succesfully integrated together the highcharts (different telemetries on the same plot), the toggle switches, but I am facing a lot of problems with buttons and textbox; the tutorial that I have followed are these:

  • ESP32 Async Web Server – Control Outputs with Arduino IDE (ESPAsyncWebServer library)
  • ESP32/ESP8266 Plot Sensor Readings in Real Time Charts – Web Server
  • Input Data on HTML Form ESP32/ESP8266 Web Server using Arduino IDE

I would like to avoid the page refreshing when I push a button, in order to not reset the real-time plots.

Here, the Arduino code:
https://pastebin.com/embed_js/kMbtXuEs

Here, the HTML code:
https://pastebin.com/embed_js/peg8Kd5w

Thanks in advance for any suggestion!

Question Tags: Asynchronous WebServer
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Vito.
I recommend that you use websockets to control your outputs and to display its state. There’s no need to refresh the web page to keep things updated.
We have this free tutorial about websocket protocol and how to build a web server with it: https://randomnerdtutorials.com/esp32-websocket-server-arduino/
I hope this helps.
Then, let me know if you need further help.
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.