Status and Limit Switches on GRBL 13.2 M035 Model
-
I am trying to read the limit switches and other configuration data from the module using the Module_GRBL_13.2.h library. I wrote a simple script to read commands from Serial and write them to the module with driver.sendGcode(cmdBuffer); I then read the response with driver.readLine() return some info that looks like a mixture of corrupted plus valid data. If I use driver.readStatus() I only get "IDLE" or "BUSY" back. Here is a example of what I get after sending a command:
Sending command: ?
Raw response.length() 134 response=<Idle,MPos3�o�!�?��?:0.000,0.03�o�!�?��?00,0.000,W3�o�!�?��?Pos:0.000,3�o�!�?��?0.000,0.003�o�!�?��?0>Sending command: $$
Raw response.length() 271 response=$0=80.000 3�o�!�?��?(x, step/m3�o�!�?��?m)
$1=80.3�o�!�?��?000 (y, st3�o�!�?��?ep/mm)
$23�o�!�?��?=80.000 (z3�o�!�?��?, step/mm)3�o�!�?��?
$3=10 (s3�o�!�?��?tep pulse,3�o�!�?��? usec)
$43�o�!�?��?=250.000 (3�o�!�?��?default fe3�o�!�?��?ed, mm/I happen to have two modules stacked in the Core2 AWS and both 70 and 71 do this.
Any help appreciated.
Kurt
-
I have determined that this is a problem in the library. Probably a buffer overrun. It reads exactly 10 bytes at a time, always, and uses a fixed-length buffer (char data;). If more data is pending, it might clobber/lose lines. Almost all I2C read code in the library cannot cope with variable-length GRBL output. I am rewriting those parts of the library.