a side remark to make it a bit a faster
Why not:
- Arduino takes continuous sensor readings
-Computer #1 sends out a 'trigger' to the arduino, asking the arduino to send latest sensor measurement.
-The arduino sends latest reading to Computer #2
-Computer #2 takes an action (TBD) based off of the received reading.
This way there is always a sensor reading ready to be send to Computer #2, otherwise (depending on the sensor) it can take many milliseconds before #2 is triggered!
The receiving computer does a
output = conn.recv(2048);
Does this block until it has 2048 bytes (or timeout)?
If you make a (python) loop that receives per character instead of a wait for a full buffer, would that help?