Hi,
I have being writing a code for my device and the end output is a g-code generated after an interpolated array.
The device running my code is a Teensy 4.1 and the one running GRBL is an Arduino NANO.
A command key sends the Teensy's Gcode output via serial, adding a header and footer to it.
Both devices are connected by their tx1/rx1 pins amd grounded together. Baud is 115200.
The output polyline g-code is simple, and seems correct, also communication with GRBL is there.
Problem arise when streaming. Somehow the stream stops (which I understand my be buffer full and waiting to ok response), and when it starts to get codes again, the machine gives error 24 and motors come to a halt.
It does not seem to happen when generating just a short code, but if the file has more than 10 or so lines the error will appear.
Also if I force a delay if about 1 sec between each line is sent, there are no errors, but the machine will work faster than it will receive lines making it stop between each next point (as it waits for next line)
I tried copying the generated output to notepad, save as .gcode and run from PC using UGS. No problems at all, even with larger files.
I wonder if there is any thing that may indicate this is an issue with grbl sending OK's when it's not fully ready yet. Is this possible?
I am quite puzzled and wonder if that can also be caused by arduino code being in loop / blocking.
I am thinking to try out the esp32 grbl fork and see if it's any improvement but I am almost out of ideas.
My code does lots of other things before and is huge but I can post the communication bits if it can be anything related to my side of the streaming.
I hope someone has any idea if what may be going on and could shed some light in these dark debugging days