gerbil failed 1/3 through print
Quote from davegalesr on December 16, 2017, 6:43 pmI was printing a picture at 15 pixels/mm at speed=1000 and about 1/3 through (about 4 hours) gerbil terminated with the following error:
Traceback (most recent call last):
File "raster2laser_gcode.py", line 762, in <module>
_main()
File "raster2laser_gcode.py", line 757, in _main
e.affect()
File "C:\Program Files (x86)\Inkscape\share\extensions\inkex.py", line 268, in affect
self.effect()
File "raster2laser_gcode.py", line 176, in effect
self.GcodetoController(port,pos_file_gcode,pos_file_log)
File "raster2laser_gcode.py", line 648, in GcodetoController
log.write("\n Error rate "+ str(error_count))
UnboundLocalError: local variable 'log' referenced before assignment
Any ideas?
I was printing a picture at 15 pixels/mm at speed=1000 and about 1/3 through (about 4 hours) gerbil terminated with the following error:
Traceback (most recent call last):
File "raster2laser_gcode.py", line 762, in <module>
_main()
File "raster2laser_gcode.py", line 757, in _main
e.affect()
File "C:\Program Files (x86)\Inkscape\share\extensions\inkex.py", line 268, in affect
self.effect()
File "raster2laser_gcode.py", line 176, in effect
self.GcodetoController(port,pos_file_gcode,pos_file_log)
File "raster2laser_gcode.py", line 648, in GcodetoController
log.write("\n Error rate "+ str(error_count))
UnboundLocalError: local variable 'log' referenced before assignment
Any ideas?
Quote from Paul on December 17, 2017, 2:56 amThis hard to get an idea of what happened, so the best you can do is breaking up the issue in smaller steps. I would suggest to write the gcode to a file and not stream it. Check it that works. If that is successful then use a g code sender to stream it to Gerbil. Again did it succeed or not? If not then it could be a gcode is. If it succeeds then it could the communication between inkscape and gerbil. If it is a comms issue then we can increase the timeout settings or replace the usb cable for a shorter one. If that all fails then we need to debug it a bit further. Hope this makes sense and let me know your findings. Thanks
This hard to get an idea of what happened, so the best you can do is breaking up the issue in smaller steps. I would suggest to write the gcode to a file and not stream it. Check it that works. If that is successful then use a g code sender to stream it to Gerbil. Again did it succeed or not? If not then it could be a gcode is. If it succeeds then it could the communication between inkscape and gerbil. If it is a comms issue then we can increase the timeout settings or replace the usb cable for a shorter one. If that all fails then we need to debug it a bit further. Hope this makes sense and let me know your findings. Thanks
Quote from davegalesr on December 17, 2017, 6:33 amFirst step completed - I always send to a file first to see how big it will get. This one is 86.3MB and is the largest I have tried to print so far. I will try to send the file through CNCjs since I saved it from the failed print. How would I change the timeout settings?
First step completed - I always send to a file first to see how big it will get. This one is 86.3MB and is the largest I have tried to print so far. I will try to send the file through CNCjs since I saved it from the failed print. How would I change the timeout settings?
Quote from Paul on December 18, 2017, 1:09 amTime out settings can be changed within the python script /raster2laser_gcode.py
it’s in the share/extensions folder and use notepad++ (txt editor) to modify and save.
around line 604:
verbose = False settings_mode = False check_mode = False f = open(pos_file_gcode, 'r') if verbose : log = open(pos_file_log, 'w') # Initialize s = serial.Serial(port[0],BAUD_RATE) s.writeTimeout = 0.2 <- increase s.timeout = 0.2 <- increase e.g 1.0 or 1.5 etc s.flushInput() s.flushOutput() #print "Initializing Grbl..."
Time out settings can be changed within the python script /raster2laser_gcode.py
it’s in the share/extensions folder and use notepad++ (txt editor) to modify and save.
around line 604:
verbose = False | |
settings_mode = False | |
check_mode = False | |
f = open(pos_file_gcode, 'r') | |
if verbose : | |
log = open(pos_file_log, 'w') | |
# Initialize | |
s = serial.Serial(port[0],BAUD_RATE) | |
s.writeTimeout = 0.2 <- increase | |
s.timeout = 0.2 <- increase e.g 1.0 or 1.5 etc | |
s.flushInput() | |
s.flushOutput() | |
#print "Initializing Grbl..."
|
Quote from davegalesr on December 18, 2017, 8:48 amThanks Paul. I have increased the timeout values to 1.5 - my laptop is dedicated to this process so it can't hurt.
Thanks Paul. I have increased the timeout values to 1.5 - my laptop is dedicated to this process so it can't hurt.
Quote from davegalesr on January 11, 2018, 9:05 amHi Paul,
I noticed that in raster2laser_gcode.py there are 2 instances of log.write that do not have a if verbose : qualifier and one of them is the error I am seeing. I have seen this twice now and I believe I should add the qualifier to the 2 log.write statements where it is missing - do you agree?
Also - can verbose be added to the raster2laser_gcode options panel in the Inkscape screen?
Hi Paul,
I noticed that in raster2laser_gcode.py there are 2 instances of log.write that do not have a if verbose : qualifier and one of them is the error I am seeing. I have seen this twice now and I believe I should add the qualifier to the 2 log.write statements where it is missing - do you agree?
Also - can verbose be added to the raster2laser_gcode options panel in the Inkscape screen?
Quote from davegalesr on January 15, 2018, 3:41 pmAfter several more failed prints, per your advice I swapped out my USB cable with a new 4 foot one and I have not had a failed print since. The old cable was several year old and the new one is shielded but the same length of 4 feet - a shorter one would not make the trip to the K40 from my laptop. Many strange things were happening with the old cable and all of those have vanished. Thanks for the advice and I am back to enjoying my enhanced engravings.
After several more failed prints, per your advice I swapped out my USB cable with a new 4 foot one and I have not had a failed print since. The old cable was several year old and the new one is shielded but the same length of 4 feet - a shorter one would not make the trip to the K40 from my laptop. Many strange things were happening with the old cable and all of those have vanished. Thanks for the advice and I am back to enjoying my enhanced engravings.