Jump to content
Adam324

Post processing script for Octoprint's @pause feature

Recommended Posts

Posted (edited) · Post processing script for Octoprint's @pause feature

Post processing script for Octoprint's @pause feature

 

None of the existing pause at height scripts use the @pause feature for Octoprint to handle the pause and resume so I made a new script based off of the existing 'Pause at height' script to do that.  You can give it a height in mm or layer number to pause after printing the layer specified.  It does not add any commands like M or G for example.  It only inserts an @pause into the gcode just before the layer height or layer number which tells Octoprint to handle the pause using Octoprint's 'PAUSE and RESUME scripts.  By default Octoprint doesn't define any commands for the pause and resume scripts so you would need to put that in yourself in the Octoprint config under the PRINTER settings.  This does not use any of Cura's pause and resume scripts as it is intended to use Octoprint for the pause and resume.

 

99.9% of the work for this script was already done and I didn't have to add much code so a big thank you for the developer of the original script.  I removed a lot more code than added as this script only adds one @pause line to the gcode for each pause.

 

If you combine this with the Telegram plugin for Octoprint, you can get notifications to your phone through Telegram when your printer pauses which is really handy so that I don't have to keep monitoring the printer at the right time.

 

I have attached the PauseAtHeightOctoprint.py script.  On Windows you can put the PauseAtHeightOctoprint.py script in your user data directory below for Cura 3.4 and restart Cura.  I only tested this on Cura 3.4.1 but I suspect that this script would work for quite a few older versions of Cura too.  There is an api version 2 specified in the script I created this from but I don't know when Cura starting supporting version 2 of the post processing scripts.

 

Cura 3.4:
%USERPROFILE%\AppData\Roaming\cura\3.4\scripts\

 

Other Cura versions configuration directories...
https://github.com/Ultimaker/Cura/wiki/Cura-Preferences-and-Settings-Locations

 

History:

 1.3  (2018-08-23)

     Fixed a major bug where I put an incomplete version in the zip file.  It was missing an import line for UM.Application.

 1.2  (2018-08-20)

     Pulled in bug fixes from upstream PauseAtHeight script. See
    https://github.com/Ultimaker/Cura/commit/6740c2bee9a0732daf77224cd4ef34f0eb736364
 1.1  (2018-08-12)
     Fixed script to use layer counts like Cura does.  Cura starts counting layers
     as 1 even for negative layers like for the raft so we need this plugin to match the
     layer numbers as shown in Cura.
 1.0  (2018-08-12)
     Initial release 

 

PauseAtHeightOctoprint-v1.3.zip

Edited by Adam324
  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited) · Post processing script for Octoprint's @pause feature

Updated to v 1.1 to make sure the layer number you use for the plugin matches the layer number in Cura's layer view.  The script was not including negative layers (raft for example) so that I could easily calculate half of the layers in my head when deciding what layer to pause at but not realizing that the layer number would not match what Cura shows in the layer view.  The original script was doing the right thing from Cura's perspective when showing the layers in the layer view so I made it calculate layers like the original script did.

Edited by Adam324

Share this post


Link to post
Share on other sites
Posted · Post processing script for Octoprint's @pause feature

Updated to v1.2.  I synced to pull in changes to the original pause at height script upstream in github.  There was a bug fix to the original pause at height script as well as some minor sentence changes to the config settings.

 

From the github bugfix in github:

https://github.com/Ultimaker/Cura/commit/6740c2bee9a0732daf77224cd4ef34f0eb736364#diff-3e58768c03d7c85bf31b60e0ed2d51eb

 

 

Quote

 

Fix offset of initial layer height


It would detect the height of the raft by looking at what the first Z coordinate is that it encounters on layer 0. This Z coordinate also includes the initial layer height though. If you pause lower than the initial layer height (but higher than 0), you'd expect to pause in the initial layer.


 

 

 

 

Share this post


Link to post
Share on other sites
Posted · Post processing script for Octoprint's @pause feature

Updated to v1.3 to fix a major issue with it not working properly.  I put an incomplete copy of what I was working on in the zip on accident.  It was missing an import of UM.Application in the code.

  • Like 1

Share this post


Link to post
Share on other sites
Posted · Post processing script for Octoprint's @pause feature

Hi Adam324, 

 

first of all, great work with this script. I have been researching how to add other material inside a model that is currently printing without pausing the print (as it often leaves weird layer start after the pause). I have no programming experience but would it be hard for you to write the script to check for a specific z height and have telegram send a notification 2-3 layers before it reaches the desired layer? This way one would be able to be pre notified before the nozzle moves out of the way and you can be prepared to insert whatever material into your print without having to keep an eye on the print. Thank you in advance.  

Share this post


Link to post
Share on other sites
Posted · Post processing script for Octoprint's @pause feature

I only knew enough to modify an already existing script.  I don't know if the feature you are asking is possible or not.  I do get notified when the pause is issued through Telegram.  That works for me.  I usually get to it within a minute or two.

Share this post


Link to post
Share on other sites
Posted · Post processing script for Octoprint's @pause feature
8 hours ago, Adam324 said:

I only knew enough to modify an already existing script.  I don't know if the feature you are asking is possible or not.  I do get notified when the pause is issued through Telegram.  That works for me.  I usually get to it within a minute or two.


Thank you for your response. The feature does not exist unfortunately but I found a workaround instead which uses the Z height change info to notify me. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Our picks

    • Ultimaker Cura 4.0 | Stable available!
      Ultimaker Cura 4.0 is mainly focused on the improved user interface and cloud integration.
      As always, we want to collect your user feedback for this release. If there are any improvements you can think of, feel free to mention it here and help us to shape the next release.
      • 86 replies
×
×
  • Create New...

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!