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
Thanks for a very nice api that works well for reading current values. But I haven't been able to read logs. I'm quite new to python, thus I have no idea how to use the api except the example codes with minor modifications. I tried the example log code with just IP number modified:
import asyncio
from vallox_websocket_api import Client
client = Client('192.168.1.213')
async def run():
data = await client.fetch_raw_logs()
from pprint import pprint
pprint(data)
asyncio.get_event_loop().run_until_complete(run())
I got:
root@OpenWrt:/mnt/sda1/Vallox# python v_logs.py
Traceback (most recent call last):
File "/mnt/sda1/Vallox/v_logs.py", line 10, in <module>
asyncio.get_event_loop().run_until_complete(run())
File "/usr/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
File "/mnt/sda1/Vallox/v_logs.py", line 6, in run
data = await client.fetch_raw_logs()
File "/mnt/sda1/usr/lib/python3.9/site-packages/vallox_websocket_api/client.py", line 276, in fetch_raw_logs
result = await self._websocket_request_multiple(payload, read_packets=2)
File "/mnt/sda1/usr/lib/python3.9/site-packages/vallox_websocket_api/client.py", line 153, in wrapped
return await request_fn(*args, **kwargs)
File "/mnt/sda1/usr/lib/python3.9/site-packages/vallox_websocket_api/client.py", line 248, in _websocket_request_multiple
return await asyncio.gather(*[ws.recv() for _ in range(0, read_packets)])
File "/mnt/sda1/usr/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 532, in recv
raise RuntimeError(
RuntimeError: cannot call recv while another coroutine is already waiting for the next message
I have tried this on three different platforms (CygWin, Termux/Android and OpenWRT router) with the latest python3.9 and module versions and also a long time api user got the same result. Should the example code work as is?
This discussion was converted from issue #29 on April 06, 2023 18:47.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thanks for a very nice api that works well for reading current values. But I haven't been able to read logs. I'm quite new to python, thus I have no idea how to use the api except the example codes with minor modifications. I tried the example log code with just IP number modified:
I got:
I have tried this on three different platforms (CygWin, Termux/Android and OpenWRT router) with the latest python3.9 and module versions and also a long time api user got the same result. Should the example code work as is?
Beta Was this translation helpful? Give feedback.
All reactions