Jump to content

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
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
  • 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.


     

     

     

     

  • 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
    Link to post
    Share on other sites

    • 6 months later...
    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.  

  • 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.

  • 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. 

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.9 stable released!
        Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
          • Like
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Heart
          • Thanks
          • Like
        • 4 replies
    ×
    ×
    • Create New...