Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected interaction with OctoPrint "before each print" gcode setting #124

Closed
Tarinaky opened this issue Oct 4, 2022 · 5 comments
Closed

Comments

@Tarinaky
Copy link

Tarinaky commented Oct 4, 2022

Describe the bug
Using @Pause as the bed clearing script does not work - printer immediately continues printing.

To Reproduce
Steps to reproduce the behavior:
Set the bed clearing script to @pause
Add two gcode files to the print queue.
Run the queue / Click start managing

Expected behavior
Printer should pause when the first print is completed - so that a human can reset the build plate manually.

@Tarinaky Tarinaky added the bug Something isn't working label Oct 4, 2022
@smartin015
Copy link
Owner

smartin015 commented Oct 4, 2022

Hi @Tarinaky - thanks for your report. @pause commands have been pretty thoroughly tested at this point, so I'm surprised you're seeing trouble here.

Can you please fill out the rest of the issue template, especially generating a sysinfo bundle so that I can look at the logs, check for plugin conflicts, get version info, etc?

I'd also like a copy of your bed clearing script so I can run some tests.

@smartin015
Copy link
Owner

Hey @Tarinaky, are you still having issues? If so, could you please grab that sysinfo bundle? Thanks.

@Tarinaky
Copy link
Author

Tarinaky commented Oct 18, 2022

Hi. Sorry, I've been struggling to find the time to get back to you on this and haven't had the time to get the sysinfo bundle but wanted to share some later debugging I did:

I queued up some empty gcode files to test this, but I think Continuous Print is running the 'before each print' gcode script (I can't remember the exact setting name in octopi, appologies but it's under GCode Scripts in settings) inserted into the start of the bed clearing script, which in my case is where I put my autobed levelling sequence - rather than having my slicer insert it into the gcode files individually. It then pauses after performing that bed levelling - but in practice this would cause a print head crash for me so I was previously hitting the emergency stop.

Is there any way to toggle this behavior perhaps, so that the bed clearing script isn't having that global gcode inserted? This might be desired behavior for some configurations. I think the previous version (several years old) of the plugin I was using did not have this behavior - I think there's been a change in how the scripts are stored and executed? But I haven't been able to look into that.

Appologies for the hastily written reply.

@smartin015
Copy link
Owner

I see, thanks for digging into the problem. It makes sense that 'before each print' is triggering, as from Octoprint's perspective the bed clearing script is a "print". I can see where this is undesirable, but AFAIK there's no way to change this behavior without a major overhaul (and probably modifying Octoprint itself).

One way you could address this without any plugin changes is by putting your auto leveling sequence into your gcode directly - for whatever slicer you use, there's usually a "gcode header" setting where you can paste in some custom code before the body of the file. That way, your autoleveling would only happen when your gcode file is run, and not before the clearing/finishing scripts.

It's a bit brittle - if you change your slicer settings, the autoleveling might get accidentally removed. I could imagine a "before each queue item" equivalent in CPQ settings which functions similarly to octoprint's "before each print", just only with CPQ items. I'll add that onto #126 as it's in the category of "run gcode when happens", and needs a bit of refactoring before it can be done well.

LMK if the header workaround is sufficient, and we can close this out in favor of tracking event-scripting in #126. Thanks!

@smartin015 smartin015 changed the title @pause in bed clearing script does not work Unexpected interaction with OctoPrint "before each print" gcode setting Oct 19, 2022
@smartin015 smartin015 removed the bug Something isn't working label Oct 19, 2022
@smartin015
Copy link
Owner

I'm going to close this out since discussion has stalled; will work on event-scripting suggestion in #126.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants