Skip to content

Handle connection drop #23

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

Open
alexwohlbruck opened this issue Mar 16, 2022 · 2 comments
Open

Handle connection drop #23

alexwohlbruck opened this issue Mar 16, 2022 · 2 comments

Comments

@alexwohlbruck
Copy link
Owner

If the connection drops to the lamp, it should attempt to auto reconnect on an interval after about 5-10 attempts. If it still fails, then it should fallback to setup mode.

@alexwohlbruck
Copy link
Owner Author

alexwohlbruck commented Apr 15, 2022

uPy error traceback #1

#ff0090
Sending PONG
Connection closed
Reconnecting to server (Attempt 0)
Unhandled exception in thread started by <bound_method>
Traceback (most recent call last):
  File "app/server.py", line 35, in listen
  File "app/server.py", line 65, in reconnect
  File "app/server.py", line 19, in connect
  File "app/uwebsockets/client.py", line 23, in connect
  File "app/uwebsockets/protocol.py", line 42, in urlparse
RuntimeError: maximum recursion depth exceeded
Failed to send data: {"name": "SEND_LAMP_COMMAND", "data": {"lampId": "625b2a4390519cae452d2140", "state": {"color": "#000000", "touching": false}}}

@alexwohlbruck
Copy link
Owner Author

uPy error traceback #2

motion = 0
motion = 1
Unhandled exception in thread started by <bound_method>
Traceback (most recent call last):
  File "app/server.py", line 33, in listen
  File "app/uwebsockets/protocol.py", line 184, in recv
  File "app/uwebsockets/protocol.py", line 91, in read_frame
OSError: [Errno 104] ECONNRESET
motion = 0
Failed to send data: {"name": "SEND_LAMP_COMMAND", "data": {"lampId": "624cc0e6168796dd6d614190", "state": {"color": "#ff0000", "touching": false}}}
Failed to send data: {"name": "SEND_LAMP_COMMAND", "data": {"lampId": "624cc0e6168796dd6d614190", "state": {"color": "#ff0000", "touching": true}}}
Failed to send data: {"name": "SEND_LAMP_COMMAND", "data": {"lampId": "624cc0e6168796dd6d614190", "state": {"color": "#ff0000", "touching": false}}}
motion = 1
motion = 0
motion = 1

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

1 participant