Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnecting after lost connection #149

Open
shardul10 opened this issue Oct 3, 2023 · 2 comments
Open

Reconnecting after lost connection #149

shardul10 opened this issue Oct 3, 2023 · 2 comments
Assignees

Comments

@shardul10
Copy link

Describe the bug
Based on #75 and #95 it appears there is no way to reconnect a WebSocket after connection is lost and restored. Does anyone have a workaround/solution for this?

To Reproduce
Connect through Wifi router
Disconnect router
Try to re-establish connection

Expected behavior
The Websocket needs to be able to reconnect.

I am using this library with matth-x's OCPP as it works with any client (not just Wifi). There is a lot invested in the code to get this working, but not being able to reconnect is major issue. Especially if the solution is to delete and reallocate new WebSocket, it won't work as the OCPP library is already initialised with Websocket object and cannot be initialised again.

@OrangeBox33
Copy link

websocket closes if there are no messages. run socket.ping() in a loop every 30 seconds. This is not a solution, but it may help

@AviStudio
Copy link

The problem is still actual, I'm working on a project (LilyGo Board with POE Eth), and yes, I simulate lost of internet (by pulling out the cable not from board, but from WAN port instead) and my device get in stuck...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants