Comments on: ESP32/ESP8266: Control Outputs with Web Server and a Physical Button Simultaneously https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Mon, 17 Mar 2025 12:13:38 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Valentin https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/#comment-970261 Thu, 10 Oct 2024 17:39:56 +0000 https://randomnerdtutorials.com/?p=96150#comment-970261 In reply to Alessandro.

For anybody who might stumble accross this with the same problem:
You might just have switched the values in the javascript section of the webcode:

function toggleCheckbox(element) {
var xhr = new XMLHttpRequest();
if(element.checked){ xhr.open(“GET”, “/update?state=0”, true); }
else { xhr.open(“GET”, “/update?state=1”, true); }
xhr.send();

replace the state=0 with state=1 and vice versa or just replace the original script section with above code, where this is already taken care of.

]]>
By: Geraldo https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/#comment-919079 Wed, 29 May 2024 00:18:26 +0000 https://randomnerdtutorials.com/?p=96150#comment-919079 Hi Sara and Rui. Very nice tutorial. Regarding to an exampel using multiple switches ans leds, any news?
Thanks

]]>
By: bimal https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/#comment-900016 Thu, 21 Mar 2024 15:18:38 +0000 https://randomnerdtutorials.com/?p=96150#comment-900016 thank you ma’am.how to combine on/off button and push button together.
https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/
https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/

]]>
By: Robert https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/#comment-890781 Tue, 13 Feb 2024 13:11:15 +0000 https://randomnerdtutorials.com/?p=96150#comment-890781 Hi, is it possible to controll multiple output by multiple buttons? What I have to change in code setInterval( …. ?

]]>
By: T https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/#comment-875475 Sat, 02 Dec 2023 20:49:28 +0000 https://randomnerdtutorials.com/?p=96150#comment-875475 In reply to Marcio.

You need to move the function String outputState() above the function String processor(const String& var) then it should compile in the example above the function String processor(const String& var) is calling a not yet defined function

]]>
By: Mike https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/#comment-867678 Tue, 24 Oct 2023 18:38:59 +0000 https://randomnerdtutorials.com/?p=96150#comment-867678 Hi – What is the easiest way to duplicate the controls on the webpage if I wanted to create like 10 toggle buttons in a grid? 5 top / 5 bottom

]]>
By: Marcio https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/#comment-867304 Sun, 22 Oct 2023 17:09:17 +0000 https://randomnerdtutorials.com/?p=96150#comment-867304 Hello, the code does not compile in VS Code with PlatformIO
error:

src/main.cpp:105:28: error: ‘outputState’ was not declared in this scope
String outputStateValue = outputState();
^~~~~~~~~~~
src/main.cpp:105:28: note: suggested alternative: ‘OutputState’
String outputStateValue = outputState();
^~~~~~~~~~~
OutputState
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1

Can you help me?

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/#comment-838435 Fri, 02 Jun 2023 08:26:53 +0000 https://randomnerdtutorials.com/?p=96150#comment-838435 In reply to Ford.

Thanks for the suggestion once again.
I’ll take a look at it.
Regards,
Sara

]]>
By: Ford https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/#comment-838161 Wed, 31 May 2023 07:58:37 +0000 https://randomnerdtutorials.com/?p=96150#comment-838161 In reply to Sara Santos.

Hi Sara, I’m keen too please to see this tutorial and the web socket tutorial have added a code example of multiple buttons. Its easy to learn and modify your code but knowing exactly what to change or add, and what not to touch to expand beyond one IO is difficult. Thankyou.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-web-server-physical-button/#comment-838090 Tue, 30 May 2023 21:19:58 +0000 https://randomnerdtutorials.com/?p=96150#comment-838090 In reply to Roman.

Hi.
I’m sorry.
I didn’t make that yet.
I already have post lined up for the next month.
Maybe in July… but I can’t promise it..
Regards,
Sara

]]>