From e37e41d7660cddbbb6139ce04b0d7feffaf87de4 Mon Sep 17 00:00:00 2001 From: Andrey Zabolotnyi Date: Sat, 16 Apr 2022 09:53:55 +0300 Subject: [PATCH] Fixed streamer to remove comments starting with ';' too before feeding to Grbl. This fixes the problem with comments containing non-ASCII characters, which can be interpreted as immediate control chars by Grbl (jogging etc). --- doc/script/stream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/script/stream.py b/doc/script/stream.py index 4a637ab9..29f62847 100755 --- a/doc/script/stream.py +++ b/doc/script/stream.py @@ -132,7 +132,7 @@ def periodic_timer() : print "SETTINGS MODE: Streaming", args.gcode_file.name, " to ", args.device_file for line in f: l_count += 1 # Iterate line counter - # l_block = re.sub('\s|\(.*?\)','',line).upper() # Strip comments/spaces/new line and capitalize + # l_block = re.sub('\s|\(.*?\)|;.*','',line).upper() # Strip comments/spaces/new line and capitalize l_block = line.strip() # Strip all EOL characters for consistency if verbose: print "SND>"+str(l_count)+": \"" + l_block + "\"" s.write(l_block + '\n') # Send g-code block to grbl @@ -157,7 +157,7 @@ def periodic_timer() : c_line = [] for line in f: l_count += 1 # Iterate line counter - l_block = re.sub('\s|\(.*?\)','',line).upper() # Strip comments/spaces/new line and capitalize + l_block = re.sub('\s|\(.*?\)|;.*','',line).upper() # Strip comments/spaces/new line and capitalize # l_block = line.strip() c_line.append(len(l_block)+1) # Track number of characters in grbl serial read buffer grbl_out = ''