reamenagement

This commit is contained in:
Nathan-rek
2024-11-20 16:39:17 +01:00
parent e02d1d0bba
commit 12a249e478
142 changed files with 18858 additions and 18858 deletions

View File

@@ -0,0 +1,24 @@
import threading, websocket, time
ws = websocket.WebSocket()
ws.connect("ws://192.168.0.1:81")
# Reception needs to be done in a separate thread; you cannot
# assume that a given command will always result in exactly one
# response at a predictable time
# def receiver():
# while True:
# for l in ws.recv().splitlines():
# if isinstance(l, str):
# print(l)
# else:
# print(str(l, 'utf-8'))
# t = threading.Thread(target=receiver)
# t.start()
# ws.send("?") # realtime characters need no line terminator
# ws.send("$/axes/x\n") # line-oriented commands need \n at the end
ws.send("\r\n\r\n")
print(ws.recv())
ws.send("G0 X10\n")
print(ws.recv())