chilipeppr / serial-port-json-server

Serial Port JSON Server is a websocket server for your serial devices. It compiles to a binary for Windows, Mac, Linux, Raspberry Pi, or BeagleBone Black that lets you communicate with your serial port from a web application. This enables web apps to be written that can communicate with your local serial device such as an Arduino, CNC controller, or any device that communicates over the serial port.
http://chilipeppr.com
GNU General Public License v2.0
321 stars 101 forks source link

Failed to get planning buffer" when sending Gcode to TinyG with small steps #67

Open bartona opened 4 years ago

bartona commented 4 years ago

I'm running into a problem where when I send Gcode to a TinyG V9 (Bantam/Othermill) using ChiliPepper and SPJS, and there are small steps in the Gcode (specifically that of a small arc around the teardrop of a through hold pad), my TinyG just crashes with a "failed to get planning buffer error". When I send the same gcode using another software (CNC.js for example), I don't get the same issue.

Also, is there any documentation on how the tinyg/tinygg2 bufferflow options work, and how serial data moves through SPJS at a high level? I was trying to dig into the code to see if I could find a resolution, but it was becoming difficult to follow.

I've also attached a debug log from SPJS when the crash happens.

Thank you! spjs tinygg2 crash.txt

chilipeppr commented 4 years ago

What computer are you running spjs on? It's written in Go, which is like C, and compiled, so it's screaming fast. Are you sure you're buffering enough Gcode to it ahead of time? Meaning, how big is the buffer in the serial port widget in lower right corner? I'd say keep it up in the 10's of 1000's. Maybe you're starving it there.

On the documentation, it's just the comments in the code, which is well commented. There is a tinyg buffer source code file.