Comments on: ESP8266 NodeMCU WebSocket Server: Control Outputs (Arduino IDE) https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sat, 21 Jun 2025 12:08:33 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: kc tam https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/#comment-1059634 Sat, 21 Jun 2025 12:08:33 +0000 https://randomnerdtutorials.com/?p=99546#comment-1059634 initWebSocket();
// Route for root / web page
server.on(“/”, HTTP_GET, [](AsyncWebServerRequest *request){
request->send(200, “text/html”, index_html, processor);

above fct may typo error —-> i.e. missing _P
request->send_P(200, “text/html”, index_html, processor);

]]>
By: Ashutosh Yeole https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/#comment-915553 Wed, 15 May 2024 14:29:25 +0000 https://randomnerdtutorials.com/?p=99546#comment-915553 I am trying to use AutoconnectAP with this code but there are conflicts in these two libraries. Is there any example where this two libraries are used together?

]]>
By: Ambrosius https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/#comment-842406 Fri, 23 Jun 2023 09:25:46 +0000 https://randomnerdtutorials.com/?p=99546#comment-842406 hello…thank you very much for the tutorial that I really need. can you help how to change the toggle button to a temporary button (the button is active as long as I press the mouse) thanks for the help

]]>
By: Ghost Shadow https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/#comment-838468 Fri, 02 Jun 2023 15:10:34 +0000 https://randomnerdtutorials.com/?p=99546#comment-838468 In reply to Sara Santos.

Sorry if I insist, have you had the opportunity to verify the behavior of the page? Last thing, would you help me with a change, I should add another button, but I have to make sure that only one button at a time is ON, example: the first is on, the second is off, if the second is on the first goes off. I hope I have been able to explain what I should do and receive a kind answer to my problems. Thank you in advance.

]]>
By: Ghost Shadow https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/#comment-837173 Wed, 24 May 2023 15:19:14 +0000 https://randomnerdtutorials.com/?p=99546#comment-837173 In reply to Sara Santos.

Thanks for the reply, opening the console I do not receive any message outside of connection attempt and open connection. In the IDE console I only get connected by ID and IP when I log in from outside, while locally I also get the STATE. I insert the link of the remote server where the index page is running in case it can be useful. Thank you. http://185.182.186.170/arduino/

]]>
By: Sara Santos https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/#comment-836906 Mon, 22 May 2023 20:40:54 +0000 https://randomnerdtutorials.com/?p=99546#comment-836906 In reply to Ghost Shadow.

Hi.
Can you open the javascript console on your web browser, refresh the web page and check which messages do you get?
Regards,
Sara

]]>
By: Ghost Shadow https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/#comment-836545 Sun, 21 May 2023 20:47:07 +0000 https://randomnerdtutorials.com/?p=99546#comment-836545 Good evening, I have been trying to find a solution to my problem for days. I’m using your sketch, but I can not get me back the status of the LED if I refresh the page, the problem does not exist if instead I click on the toggle button, which after being pressed returns the status and updates from on to off and vice versa, I specify that the server is not on arduino but I loaded the index page on a remote server. Thank you for any reply.

]]>
By: Suraj Nukala https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/#comment-781557 Wed, 07 Sep 2022 12:48:04 +0000 https://randomnerdtutorials.com/?p=99546#comment-781557 hey… the code works great and all,
but then I tried using this with a react(next) app I made by my self

everytime I try to connect to the ws endpoint, it fails

]]>
By: Sara Santos https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/#comment-773476 Fri, 05 Aug 2022 20:50:36 +0000 https://randomnerdtutorials.com/?p=99546#comment-773476 In reply to Erik.

Hi.
Check this tutorial: https://randomnerdtutorials.com/esp32-esp8266-web-server-timer-pulse/
I think it might help.
Regards,
Sara

]]>
By: Erik https://randomnerdtutorials.com/esp8266-nodemcu-websocket-server-arduino/#comment-773461 Fri, 05 Aug 2022 19:31:28 +0000 https://randomnerdtutorials.com/?p=99546#comment-773461 Hi and thanks for this great tutorial! Do you have a suggestion on what to modify in the code so that pressing the button turns the LED on for 10 seconds and then it turns off automatically (without a need to press the toggle button)? I tried now for some time with a for loop in the loop section or modifying the handleWebSocketMessage function but all that results in wrong behavior. Could you please point me in the right direction? Thanks!

]]>