From d777cf6f61f35cf02fa27206e509010eaecd143c Mon Sep 17 00:00:00 2001 From: Eilon Zohar Date: Fri, 20 Jun 2025 14:44:59 +0200 Subject: [PATCH] First commit - interlock python script --- interlock/Interlock_socket_script.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 interlock/Interlock_socket_script.py diff --git a/interlock/Interlock_socket_script.py b/interlock/Interlock_socket_script.py new file mode 100644 index 0000000..10a024b --- /dev/null +++ b/interlock/Interlock_socket_script.py @@ -0,0 +1,21 @@ +import socket +import time + +ip = "0.0.0.0" # Listen to all channels +port = 5005 # Should match .ino + +time.sleep (5) + + +with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + s.bind((ip, port)) + s.listen() + print(f"Listening") + + while True: + conn, addr = s.accept() + with conn: + data = conn.recv(1024) + if data: + print(f"Received from {addr}: {data.decode().strip()}") +