[SOLVED] Can you benevolently MITM UART (thinking grbl jog pendant direct to ATMEGA328P)

Simon Merrett wrote 01/06/2018 at 21:42 0 points

Solution (for starters): https://hackaday.io/project/29627-grbl-man-in-the-middle-cnc-jog-pendant

I was looking at the options for putting a jog controller/pendant on a grbl machine. The latest versions of grbl have good support for a jog controller but it seems like you're dependent on the ability of your gcode sender program to receive keyboard strokes and send them to the ATMEGA328P. 

I know you _could_ put an ATMEGA32U4 in HID role and go through the computer but can't we get the command going more directly to the machine controller? 

I've had a quick crawl through stackexchange and it seems like you can't add two UART Tx sources to one Rx input. So can we put an ATMEGA between the computer and the grbl controller to receive computer gcode and forward it on to the grbl controller (using two serial ports). If a jog input is received, it buffers any incoming computer commands, tells the computer when the buffer is full, sends the jog command and then continues to send computer commands. 

Any thoughts?