WebThingsIO / gateway

WebThings Gateway - a self-hosted web application for monitoring and controlling a building over the web
http://webthings.io/gateway
Mozilla Public License 2.0
2.61k stars 339 forks source link

Broken Websocket #2678

Open atirage opened 3 years ago

atirage commented 3 years ago

I have a Gateway running on a LAN connection and a few WiFi connected WebThings. Recently I had WiFi stability issue, meaning that the WiFi was disconnecting and reconnecting automatically. Afterwards I realized that the Gateway GUI is not updating any more the WebThing properties. I suspect this is because I'm seeing the following in the log, multiple times:

2020-12-08 04:43:12.552 ERROR : WebSocket sendMessage failed: Error: write EPIPE

If I queried the WebThings directly through their REST API, the properties were returned correctly, so I solved the issue by rebooting the Gateway.

Would there be a way to automatically reconnect the Websocket or at least show on error on the GUI if the Websocket connection is broken?

mrstegeman commented 3 years ago

The UI is supposed to reconnect its WebSocket anytime it closes, via this class.