grbl/grbl — Issue #50: Case for updating communications (XON/XOFF flow control)
Author: chamnit
Created: 2012-01-25 04:37:49+00:00
State: open

Here I'd like to start a discussion whether or not software xon/xoff flow control should be integrated into grbl's serial interface. There are both benefits and drawbacks in terms of use, and it is easy to implement.

The primary and greatest benefit is that any standard serial terminal program supports xon/xoff software flow control. This really simplifies streaming g-code to grbl, as a user can just send/upload the file and grbl should execute it to the end of file. A second important benefit is that grbl can access the next g-code block command immediately from the serial read buffer without having to perform the 'ok' handshake and wait for a response. This really speeds things up and prevents planner starvation.

The primary drawback is that it limits the streaming interface and can limit control, since the serial port is the only software connection to grbl. In the status report discussion, the question was raised: how do would you send run-time commands, like feed holds and abort, while streaming the g-code program at the same time? If the XOFF flag is sent from grbl when its receive buffer is full, this effectively blocks transmit communication to grbl, unless a special streaming interface is designed to force transmit run-time command characters. At this point, a specialized streaming interface negates the simplicity benefit.

Right now, the _stream.py_ script does a pseudo-XON/XOFF flow control by counting and tracking the sent characters to grbl's buffer. Not exactly clean and simple, but effective.

So I guess my question is: where do you all see the primary interface of grbl going? Does it make sense to keep the 'ok' and 'error:' response interface or should we begin to look into efficient alternatives for replacement or enhancement? This should all come with a consideration of not dropping current user support and messing with their interfaces without good reason.