markwal / OctoPrint-GPX

An OctoPrint plug-in to use GPX as the protocol layer underneath rather than replacing g-code to talk to s3g/x3g machines, for example, a FlashForge.
GNU Affero General Public License v3.0
104 stars 25 forks source link

afterPrintCancelled Script not running on Creator Pro #87

Open HakuG opened 3 years ago

HakuG commented 3 years ago

For some reason, I'm not able to get the afterPrintCancelled script to run on the Creator Pro. This is a problem, as it can leave the nozzle to clog unless done manually. Any advice?

2020-09-17 16:39:15,686 - octoprint.filemanager.analysis - INFO - Starting analysis of local:cur_print.gcode 2020-09-17 16:39:15,690 - octoprint.filemanager.analysis - INFO - Invoking analysis command: /opt/octoprint/venv/bin/python -m octoprint analysis gcode --speed-x=6000 --speed-y=6000 --max-t=10 --throttle=0.0 --throttle-lines=100 /home/octoprint/.octoprint/uploads/cur_print.gcode 2020-09-17 16:39:15,693 - octoprint.util.comm - INFO - Force-sending M108 to the printer 2020-09-17 16:39:15,722 - octoprint.printer.standard.job - INFO - Print job cancelled - origin: local, path: cur_print.gcode, owner: _api, user: _api 2020-09-17 16:39:15,744 - octoprint.events - INFO - Executing system command: /opt/octoprint/venv/bin/python ~/scripts/handle_event.py --file cur_print.gcode --status PrintCancelled --progress 0 2020-09-17 16:39:15,746 - octoprint.plugins.GPX - WARNING - Cancelling build by OctoPrint 2020-09-17 16:39:17,065 - octoprint.plugin - ERROR - Error while calling plugin GPX Traceback (most recent call last): File "/opt/octoprint/venv/lib/python2.7/site-packages/octoprint/plugin/init.py", line 224, in call_plugin result = getattr(plugin, method)(*args, **kwargs) File "/opt/octoprint/venv/lib/python2.7/site-packages/octoprint_GPX/init.py", line 178, in on_event self.printer.cancel() File "/opt/octoprint/venv/lib/python2.7/site-packages/octoprint_GPX/gpxprinter.py", line 202, in cancel self._append(gpx.abort()) Timeout: Timeout 2020-09-17 16:39:17,098 - octoprint.util.comm - INFO - Externally triggered heatup detected 2020-09-17 16:39:17,148 - octoprint.events - INFO - Executing system command: /opt/octoprint/venv/bin/python ~/scripts/handle_event.py --file cur_print.gcode --status PrintFailed --progress 0

markwal commented 3 years ago

Hmmm... This indicates that GPX sent the "cancel" to the printer, which is actually a reset. GPX wasn't able to reconnect with the printer after the reset and so sent a Timeout to OctoPrint which fails the print. OctoPrint doesn't send the afterPrintCancelled because it sees a failure, not a cancel. I wonder why your printer takes longer to respond after a reset than mine...