• 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

Asyncrounus web server input

Q&A Forum › Category: ESP32 › Asyncrounus web server input
0 Vote Up Vote Down
Luis Alejandro Domínguez González asked 5 years ago

Hi. do you have any example like GPIO digital output on Asynchronous web server but with digital input? I tried to do something similar, but i have some trouble to show an circle in web page that changing the colour when the input status change

Question Tags: asyncrounus web server, ESP32, input
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Luis.

At the moment, we just have web server examples that display sensor readings.

For your particular application, it would be a good idea to use server-sent events. When the input changes, the server (ESP32) sends an event to the client (the browser).

When that happens, use JavaScript to change the color of the circle. Learn more about changing the style of HTML elements using JavaScript: https://www.w3schools.com/js/js_htmldom_css.asp

At the moment, we don’t have any tutorial explaining server-sent events in detail. We have these two tutorials that use server-sent events. You can take a look at them for examples on how to implement them.
https://randomnerdtutorials.com/esp32-esp-now-wi-fi-web-server/
https://randomnerdtutorials.com/esp32-iot-shield-pcb-dashboard/

You can also take a look at the official AsyncWebServer documentation: https://github.com/me-no-dev/ESPAsyncWebServer#async-event-source-plugin

I hope this helps.

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.