-
Notifications
You must be signed in to change notification settings - Fork 119
Socket Timeout after some time #14
Comments
You can just use;
|
Thank you for your answer! Does anybody know how to notice if the websocket connection is lost? Thanks in advance! |
I Use the if condition each time before listening/sending data over the On Sat, Apr 30, 2016 at 3:19 PM, Niklas Dörfler [email protected]
|
Yes, thats what I also do. But it only checks, if the WiFi connection is connected. I want to check, if the socket is still working. Therefore I need some method like this from the class 'WebSocketClient'... |
@niklasdoerfler Did you try using any other method to detect websocket connection lost? the client.connected() method works whenever I reset my server. i.e it detects that the server connection was completely dropped. But other than that if there is some random issue due to which socket connection is lost then this function call doesn't really help |
Hi everyone! I'm also having websocket timeout problem. Is there some WebSocketClient method that checks if websocket connection was lost? |
you can do a heart beat between server and client and if not working then disconnect and reconnect again |
I know it's late, but anyway, I'm gonna share how I solved this problem: I decided to use the native ESP firmware (it's written in Lua, but don't worry! It has a good documentation and it's simple to understand, trust me :D). There is a module to work with websocket and worked consistently well in my project. Here is the documentation about the module: https://nodemcu.readthedocs.io/en/master/en/modules/websocket/ I hope it helps! Hugs! |
hi @mauricioribeiro can you share your code or example how you actually solved this ? |
@modabasi @niklasdoerfler Connecting to Local_wifi_Network So there is just 2 or 3 Sec between "Handshake successful" and "Client disconnected" I need to try WSS (with port 443) |
Hey,
I'm using this library to listen to a websocket in client mode. I'm trying to control a led stip with the esp8266 module. Everything works fine, but after some time the socket doesn't get the data from the server. Is there a way to reset the controller if socket connection is lost?
Thanks in advance :)
My code:
The text was updated successfully, but these errors were encountered: