API:WiFi -> Error de handler

This commit is contained in:
semarnat committed 2026-05-22 10:51:16 -06:00
1 parent 80a703673f
commit 6ca5f7f68d
7 files changed
+151 -4

No files matched your search

+29
View File
@@ -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()