I'm working on a project that involves streaming dynamically generated G-code to my RAMPS-based printer, which is currently running Marlin. I have been attempting to hijack Cura code (
daid/Cura codebase) and its USB printing support in order to communicate with Marlin. I've got it mostly working, but when I send any substantial amount of G-code to the printer, I start getting some really erratic behavior from my printer. It starts out fine, but after a few seconds it starts jumping all over the place as if it had mixed up the order of the G-code commands or dropped a bunch. Debug output from Cura's
MachineCom module indicates the G-code is being sent with line numbers and is being acknowledged by Marlin with immediate "ok" responses. I had assumed that the Cura code would be able to do proper flow control for communicating with Marlin, but now I'm wondering if it's allowing Marlin to get overwhelmed, resulting in the erratic printing. Is that likely? What else might cause the printer to behave like that?
I recently learned that the daid/Cura code has been superseded by Ultimaker/Cura because the daid/Cura code had become unmanageable. Should I be looking elsewhere for code that properly handles flow control over a USB connection?
Thanks in advance for any help!