import asyncio import websockets import struct import numpy as np INITIAL_INFO = 1 SESSION_STARTED = 2 SESSION_STOPPED = 3 SESSION_NEW_DATA = 4 async def hello(): uri = "ws://192.168.178.110:81" async with websockets.connect(uri) as websocket: while True: res = await websocket.recv() msg_type = struct.unpack("