chiark / gitweb /
Add a thread lock to the machineCom _sendCommand
This is the real cause for the serial WriteTimeout on Windows.
It looks like the win32 pyserial has a concurrency issue and is not
thread-safe, so when we receive commands from the UI (such as 'print',
'pause', 'resume', 'temp' or custom gcode), they get executed from the
main thread and if we receive an 'ok' from the firmware on the serial
monitor thread, it can cause the next command to be sent from the monitor
thread causing data to be written to serial from two threads, which causes
pyserial to just cancel both writes with a WriteTimeoutException.
Fixes T332