You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run the real time example on Debian 11 with Python 3.9 and keep getting a 404
/usr/bin/python3.9 /nas/projects/electronic/mybus/tibber/tibtest.py
Traceback (most recent call last):
File "/nas/projects/electronic/mybus/tibber/tibtest.py", line 33, in
loop.run_until_complete(run())
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/nas/projects/electronic/mybus/tibber/tibtest.py", line 27, in run
await home.rt_subscribe(_callback)
File "/usr/local/lib/python3.9/dist-packages/tibber/tibber_home.py", line 448, in rt_subscribe
await self._tibber_control.rt_connect()
File "/usr/local/lib/python3.9/dist-packages/tibber/init.py", line 110, in rt_connect
await self.sub_manager.connect_async()
File "/usr/local/lib/python3.9/dist-packages/gql/client.py", line 632, in connect_async
await self.transport.connect()
File "/usr/local/lib/python3.9/dist-packages/gql/transport/websockets_base.py", line 490, in connect
self.websocket = await asyncio.wait_for(
File "/usr/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
return fut.result()
File "/usr/lib/python3.9/asyncio/tasks.py", line 690, in _wrap_awaitable
return (yield from awaitable.await())
File "/usr/local/lib/python3.9/dist-packages/websockets/legacy/client.py", line 659, in await_impl_timeout
return await asyncio.wait_for(self.await_impl(), self.open_timeout)
File "/usr/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
return fut.result()
File "/usr/local/lib/python3.9/dist-packages/websockets/legacy/client.py", line 666, in await_impl
await protocol.handshake(
File "/usr/local/lib/python3.9/dist-packages/websockets/legacy/client.py", line 332, in handshake
raise InvalidStatusCode(status_code, response_headers)
websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 404
Process finished with exit code 1
It doesn't matter whether i use my own access token or the demo one.
This happens on 26.13 and also on main 28.2 with the following patch to make it jibe on python 3.9
`diff --git a/tibber/realtime.py b/tibber/realtime.py
index 5da2ea3..d6070ad 100644
--- a/tibber/realtime.py
+++ b/tibber/realtime.py
@@ -196,7 +196,7 @@ class TibberRT:
)
The URL in init is wrong. It should be wss://websocket-api.tibber.com/v1-beta/gql/subscriptions
(or rather, it should be acquired by asking for websocketSubscriptionUrl.
I'm trying to run the real time example on Debian 11 with Python 3.9 and keep getting a 404
/usr/bin/python3.9 /nas/projects/electronic/mybus/tibber/tibtest.py
Traceback (most recent call last):
File "/nas/projects/electronic/mybus/tibber/tibtest.py", line 33, in
loop.run_until_complete(run())
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/nas/projects/electronic/mybus/tibber/tibtest.py", line 27, in run
await home.rt_subscribe(_callback)
File "/usr/local/lib/python3.9/dist-packages/tibber/tibber_home.py", line 448, in rt_subscribe
await self._tibber_control.rt_connect()
File "/usr/local/lib/python3.9/dist-packages/tibber/init.py", line 110, in rt_connect
await self.sub_manager.connect_async()
File "/usr/local/lib/python3.9/dist-packages/gql/client.py", line 632, in connect_async
await self.transport.connect()
File "/usr/local/lib/python3.9/dist-packages/gql/transport/websockets_base.py", line 490, in connect
self.websocket = await asyncio.wait_for(
File "/usr/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
return fut.result()
File "/usr/lib/python3.9/asyncio/tasks.py", line 690, in _wrap_awaitable
return (yield from awaitable.await())
File "/usr/local/lib/python3.9/dist-packages/websockets/legacy/client.py", line 659, in await_impl_timeout
return await asyncio.wait_for(self.await_impl(), self.open_timeout)
File "/usr/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
return fut.result()
File "/usr/local/lib/python3.9/dist-packages/websockets/legacy/client.py", line 666, in await_impl
await protocol.handshake(
File "/usr/local/lib/python3.9/dist-packages/websockets/legacy/client.py", line 332, in handshake
raise InvalidStatusCode(status_code, response_headers)
websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 404
Process finished with exit code 1
It doesn't matter whether i use my own access token or the demo one.
This happens on 26.13 and also on main 28.2 with the following patch to make it jibe on python 3.9
`diff --git a/tibber/realtime.py b/tibber/realtime.py
index 5da2ea3..d6070ad 100644
--- a/tibber/realtime.py
+++ b/tibber/realtime.py
@@ -196,7 +196,7 @@ class TibberRT:
)
"""Get subscription endpoint."""
return self._sub_endpoint
`
I would try to debug this myself, but am getting utterly lost in the async world.
The text was updated successfully, but these errors were encountered: