SHA256
API:WiFi -> Error de handler
This commit is contained in:
1 parent
80a703673f
commit
6ca5f7f68d
7 files changed
+151
-4
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import struct
|
||||
|
||||
from websocket import create_connection
|
||||
|
||||
ws = create_connection("ws://10.42.0.100:81")
|
||||
|
||||
print("Conectado")
|
||||
|
||||
i = 0
|
||||
|
||||
try:
|
||||
while True:
|
||||
data = ws.recv()
|
||||
i += 1
|
||||
|
||||
if isinstance(data, bytes):
|
||||
# Convertir bytes -> uint16_t
|
||||
samples = struct.unpack(f"<{len(data) // 2}H", data)
|
||||
|
||||
print("ADC:", samples)
|
||||
|
||||
else:
|
||||
print("TXT:", data)
|
||||
|
||||
print(f"DEBUG {i}")
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("Cerrando conexión")
|
||||
ws.close()
|
||||
Reference in new issue
Block a user