Websocket not connecting properly since November
Closed this issue · 3 comments
I've used gardena2influxdb successfully for years and never had any major issues. This November I ran into some issue, possibly auth token expired or something, and the script kept retrying enough to trigger the max requests per month limit. I have now waited a month, recreated the API keys but still fail to connect to the websocket.
I get:
Create Influxdb database...
Kvdb content...
xxxx-xxxxx-xxxx-xxxx-xxxxxxx sensor-xxxxx
xxxx-xxxxx-xxxx-xxxx-xxxxxxx mower-xxxxx
refresh_token xxxx-xxxxx-xxxx-xxxx-xxxxxxx
Logging into authentication system using refresh_token...
Logged in (xxxxxxxx), getting WebSocket ID...
WebSocket ID obtained, connecting...
But I never get the expected following "### connected ###" and any messages. Is it working for other users? Any ideas on what can be wrong and/or how I can debug this further?
Thanks!
Ahoj, I added a dry-run opt to the script so debugging gets a bit easier.
Websocket handling was updated/fixed in version v0.3 just in case you have not updated.
You can enable trace logs for the websockets by uncommenting line 246 in the script:
websocket.enableTrace(True)
Let me know if you found the issue or if i can assist you further
Thanks! I see the following errors:
error from callback <bound method Client.on_open of <main.Client object at 0x7fb292138a00>>: on_open() missing 1 required positional argument: 'ws'
File "/usr/lib/python3/dist-packages/websocket/_app.py", line 333, in _callback
callback(*args)
error from callback <bound method Client.on_message of <main.Client object at 0x7fb292138a00>>: on_message() missing 1 required positional argument: 'message'
File "/usr/lib/python3/dist-packages/websocket/_app.py", line 333, in _callback
callback(*args)
I managed to fix it by installing an older version of the websocket client:
pip3 install websocket-client==0.48.0
There seems to be a compatibility issue with the default version (0.53.0)
Glad to hear that you found the issue :)
Indeed, I retested your issue using websocket-client v0.53.0 and connecting to a websocket is broken :X
Using the lastest version 1.2.3, the compatibility issues do not occur 👍