AndersMalmgren / FreePIE

Programmable Input Emulator
649 stars 144 forks source link

I Cant write to freeTrack #146

Open baseru opened 6 years ago

baseru commented 6 years ago

import socket import time sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) server_address = '0.0.0.0' server_port = 5555 server = (server_address, server_port) sock.bind(server) print("Listening on " + server_address + ":" + str(server_port)) global x1 global y1 global z1 while True: localtime = time.asctime( time.localtime(time.time()) ) message, address = sock.recvfrom(8192) try: a = message.decode("utf-8") x,y,z = a.split(", ") x1=float(x) y1=float(y) z1=float(z) freeTrack.x=x1 freeTrack.y=y1 freeTrack.z=z1 diagnostics.watch(freeTrack.x) diagnostics.watch(freeTrack.y) diagnostics.watch(freeTrack.z) print(localtime + " x: " + x[:9] + " " + "y: "+ y[:9] + " " + "z: "+z[:9]) except: print("couldn't get data")

In watch window my data is changing but in real freetrack data nothing is happining.

AndersMalmgren commented 6 years ago

I'm not sure, but the both writing and reading from freetrack can confuse it. But you do write first so maybe the code is smart enoguht to understand it should only write.. Wasn years since I was in that code

AndersMalmgren commented 6 years ago

I checked the code, writing should have priority over reading