Comments on: ESP32 WebSocket Server: Display Sensor Readings https://randomnerdtutorials.com/esp32-websocket-server-sensor/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sun, 30 Mar 2025 18:01:06 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: George https://randomnerdtutorials.com/esp32-websocket-server-sensor/#comment-1021238 Sun, 30 Mar 2025 18:01:06 +0000 https://randomnerdtutorials.com/?p=130716#comment-1021238 Hello. Thanks for the great project. In my case, I access the web page from the browser when the computer is connected to the network via wifi. When I connect the computer with a network cable, I cannot access the web page. The browser shows ERR_CONNECTION_TIMED_OUT. Can you help me?

]]>
By: Anthony https://randomnerdtutorials.com/esp32-websocket-server-sensor/#comment-1012674 Mon, 03 Mar 2025 04:53:04 +0000 https://randomnerdtutorials.com/?p=130716#comment-1012674 Hi,
Thanks for the tutorial. It has been very helpful but I had some issues and I thought I would put up my changes for anyone else that has similar issues as it looks like there are some updates to code that make some changes necessary. Luckily, it looks like all the libraries can now be downloaded in the arduino ide now. One change is that instead of AsyncTCP its ESPAsyncTCP. These includes:
#include <WiFi.h>
#include <AsyncTCP.h>
Change to:
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
And then this line:
if (!LittleFS.begin(true)) {
Changes to:
if (!LittleFS.begin()) {
This made the sections of code I was looking at work. YMMV as I am setting up a softAP and not using any of the BME stuff since I’m only trying to read voltage.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-websocket-server-sensor/#comment-1002084 Thu, 23 Jan 2025 10:50:58 +0000 https://randomnerdtutorials.com/?p=130716#comment-1002084 In reply to M. Soares.

Hi.
There’s probably something wrong with the way you edited the code.
But, without further information, it’s very difficult to find out what might be wrong.
Regards,
Sara

]]>
By: M. Soares https://randomnerdtutorials.com/esp32-websocket-server-sensor/#comment-1002066 Thu, 23 Jan 2025 08:40:41 +0000 https://randomnerdtutorials.com/?p=130716#comment-1002066 Hello

Thanks for the tutorial.
But I can’t get it to work on my setup, although it successfully compiles.
The only thing I have changed is that I removed the BME sensor (don’t have one), an replaced the calls to the sensors by fixed values. Should actually work.

I have no readings and the console is showing me that the connection was interrupted while loading.
rehost.diberie.com/Picture/Get/f/344461

Could you please give-me some hints how to debug it?

Thank you

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-websocket-server-sensor/#comment-967684 Mon, 07 Oct 2024 08:20:58 +0000 https://randomnerdtutorials.com/?p=130716#comment-967684 In reply to summer.

Hi.
You can learn how to use an LCD with the ESP32 on this tutorial: https://randomnerdtutorials.com/esp32-esp8266-i2c-lcd-arduino-ide/
Regards,
Sara

]]>
By: Miroan https://randomnerdtutorials.com/esp32-websocket-server-sensor/#comment-967586 Mon, 07 Oct 2024 00:23:15 +0000 https://randomnerdtutorials.com/?p=130716#comment-967586 Whenever I need something I stumble to your tutorial thanks to search engine, I’ve changed async lib’s to work on esp8266. Thanks a lot once again, you have best tutorials on the net!

]]>
By: summer https://randomnerdtutorials.com/esp32-websocket-server-sensor/#comment-966690 Sat, 05 Oct 2024 01:39:59 +0000 https://randomnerdtutorials.com/?p=130716#comment-966690 good.
how to display the data on a LCD?

]]>
By: iwan https://randomnerdtutorials.com/esp32-websocket-server-sensor/#comment-966382 Fri, 04 Oct 2024 02:27:29 +0000 https://randomnerdtutorials.com/?p=130716#comment-966382 great job sara
god bless you

]]>
By: Michael https://randomnerdtutorials.com/esp32-websocket-server-sensor/#comment-928803 Fri, 21 Jun 2024 11:15:39 +0000 https://randomnerdtutorials.com/?p=130716#comment-928803 In reply to Stein Arve Lovik.

I know it’s a late response but I ran into the same “error” or better behavior. I checked the webpage (I’m using Firefox) using the “Website Inspector”, moved to the “Console” tab and saw that the sensor readings data was delivered to the webpage but not displayed. Then I used the “Debug” tab and clicked on the “script.js” entry on the left side (“main thread” – “192..” . script.js. On the right side you can see the content of the script. BUT: that was some old content I used half an hour before. Firefox didn’t update the script.js file and for a short test I used Chrome instead – and the sensor readings were displayed. Happy coding, Michael

]]>
By: MeisterQ https://randomnerdtutorials.com/esp32-websocket-server-sensor/#comment-924498 Wed, 12 Jun 2024 07:15:42 +0000 https://randomnerdtutorials.com/?p=130716#comment-924498 Thank you very much for this tutorial.

Can you explain how to set up websockets including the port when using portforwarding?

If i forward my ESPs port 80 and websockets start on /ws, it cant receive ws data.

On browsers debug window it says an error on line Socket = new WebSocket(ws://${window.location.hostname}/ws);

Error is “WebSocket connection to ‘ws://myurlishiddentokeepprivacy/ws’ failed:”

Any idea how to set this up?

]]>