Comments on: ESP32/ESP8266 Web Server: Control Outputs with Momentary Switch https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Fri, 02 May 2025 13:03:20 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Don Potbury https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/#comment-1033243 Fri, 02 May 2025 13:03:20 +0000 https://randomnerdtutorials.com/?p=96089#comment-1033243 In reply to Sara Santos.

Thanks so much for your prompt replies. If this question is bothersome to folks, please feel free to delete the whole thread.

Respectfully
Don

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/#comment-1032629 Wed, 30 Apr 2025 21:07:24 +0000 https://randomnerdtutorials.com/?p=96089#comment-1032629 In reply to Don Potbury.

Hi.
That’s the same ESP8266 board and libraries we use.

Unfortunately, I don’t know why you’re getting the issue and needed to make those changes.

Regards,
Sara

]]>
By: Don Potbury https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/#comment-1032235 Tue, 29 Apr 2025 16:54:01 +0000 https://randomnerdtutorials.com/?p=96089#comment-1032235 In reply to Sara Santos.

Hi Sara

Thanks for your response. I am using an ESP8266 NodeMCU
Also I double checked the libraries which appear to be by ESP32Async.
I created a document showing my stuff…
https://github.com/DonaldPotbury/DonaldPotbury.github.io/blob/main/ESP8266%20Trouleshoot/Troubleshooting.md

Respectfully
Don

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/#comment-1032219 Tue, 29 Apr 2025 16:19:29 +0000 https://randomnerdtutorials.com/?p=96089#comment-1032219 In reply to Don Potbury.

Hi.
I just tested the code and it is working as expected.
Which board are you using?
Are you using the libraries by ESP32Async?

Regards,
Sara

]]>
By: Don Potbury https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/#comment-1031846 Mon, 28 Apr 2025 13:40:30 +0000 https://randomnerdtutorials.com/?p=96089#comment-1031846 Hello,

Thank-you for your excellent article! It was quite helpful and I learned so much.

When I paste your sketch as posted, the following exception was thrown as soon as the browser hits the page.

Exception (3):
epc1=0x4000bf64 epc2=0x00000000 epc3=0x00000000 excvaddr=0x4023f4dd depc=0x00000000

This may be due to my setup or my ignorance. But it appears that there is something going on with how index_html[] is setup.

Looking at other examples published by the author of the ESPAsyncWebServer library you are using, I made a few slight changes that seemed to work…

const char index_html[] PROGMEM = R”rawliteral(
was changed to..
static const char *index_html PROGMEM = R”rawliteral(

I added this line after the html…
static const size_t html_length = strlen_P(index_html);

Lastly I changed command in the server on “/” section.

server.on(“/”, HTTP_GET, [](AsyncWebServerRequest *request){
request->send(200, “text/html”, index_html);
});

was changed to…
server.on(“/”, HTTP_GET, [](AsyncWebServerRequest *request){
request->send(200, “text/html”, (uint8_t *)index_html, html_length);
});

Thank-you so much for this article.

]]>
By: Viji Michael https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/#comment-896246 Mon, 04 Mar 2024 01:15:56 +0000 https://randomnerdtutorials.com/?p=96089#comment-896246 In reply to Sara Santos.

Thank you Sara

]]>
By: Viji Michael https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/#comment-896245 Mon, 04 Mar 2024 01:14:38 +0000 https://randomnerdtutorials.com/?p=96089#comment-896245 In reply to Sara Santos.

Thank you Sara.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/#comment-895974 Sat, 02 Mar 2024 11:18:31 +0000 https://randomnerdtutorials.com/?p=96089#comment-895974 In reply to Viji Michael.

Yes.
You can continue running things in the loop.
Regards,
Sara

]]>
By: Mohd Usman https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/#comment-895969 Sat, 02 Mar 2024 10:31:33 +0000 https://randomnerdtutorials.com/?p=96089#comment-895969 In reply to Sara Santos.

Thanks for your reply.
No, ESP32 is connected to my home Wi-Fi and my mobile phone is connected to its mobile network.

]]>
By: Viji Michael https://randomnerdtutorials.com/esp32-esp8266-web-server-outputs-momentary-switch/#comment-895822 Fri, 01 Mar 2024 15:31:47 +0000 https://randomnerdtutorials.com/?p=96089#comment-895822 In reply to Sara Santos.

Thank you, Sara for the prompt reply.
Can I write some code in the loop() ? For example –
if (….. ) {digital write (…) ; }
etc ?

]]>