Octoprint end-codes?

I’m trying to setup Octopi once which is going well but I like to see the printer move to it’s park-position after the print is done/canceled.
In Repetier, there’s a separate option for that (X: 200, Y:200, Z min: 50), does anybody have an idea on how to do this in Octoprint?

Thanks
Erik

Not sure what you mean by ‘park position’, but I like my platform to descend 150mm after the print has finished. Easy way to do this is change the Zmin position in the Printer Settings in Repetier Host. Then after slicing, save your gcode and make sure it includes the start and end gcode option. This should add the gcode park commands so after printing with RPi / Octoprint it’ll park where you told it to.

If you are slicing in Cura
You could put the following in the end code

M106 S255 ; Turn on fan
I don’t want the fan off while the head it hot
G0 X190 Y190
I didn’t want to go all of the way home but just get the head out of the way.
I don’t move the Z axis.
If the print is at 175mm (very rare in my case) but if you move the Z axis to 150mm there is a chance the project could run into something (not a chance I’m willing to take)

Thanks for your tips. I will do some more research and post here what I found.
Erik

This is what i do.

In my end code i have

G1 Z150 F300 ; lower platform to “bottom”
G28 X Y; home X-axis Y-Axis

The Repeitier switch for go to parking position after print or after aborted print only does this

G90 ; sets absolute positioning
G1 X200 Y200 F4800 ; moves x and y to 200

with the Z axis at the last print position.

I modified repetier a while back for this because i wanted the Z axis to go down and home the head instead of using a absolute position location. So i could very simply remove the buildplate. what i did was remove the switch setting and add the code to the script “gcode end”

I finally have some time to do some tests today :).

I’ll add those positioning codes to my octoprint scripts first (./octoprint/scripts/gcode/afterPrintDone) and see if I can make that work.
I like to see the benefits of using scripts in Octoprint as well :wink:

Does this statement makes sense?:
Adding the codes to the Repetier end-gcodes works fine but then every gcode file that you want to print should be created by your (properly configured) Repetier Host. Do people exchange gcode files to have them printed at ‘any’ printer? If that is the case, does it make more sense to add those ‘end-codes’ to your Octoprint scripts?

Erik

Njae. The endcode function in octopi is if you use the cura engine slicer in octoprint. It is actualy possible to slice the stl file in octoprint instead of using a diferent software. It wont use any of it if you use repetier or something else and then upload the gcode file.

Thanks for the feedback Marlark, I guess that is also the reason that my scripts are not fired from within Octoprint?

If I understand correct, a gcode file is just executed by Octoprint and only if you slice via Octoprint/Cura the scripts can be used?
Some day I do like to get this working though, when I cancel a print via Octoprint, I like the head to move back home…

Erik

Your correct. Myself i use mostly simplify3d as a slicer due to the more freely use of support structures and then upload it to my OctoPi but i have for simpler things just sliced it with the cura engine in octoprint.

There is scripts that can be triggered but they are like push button scripts or if you would like to call it hotkey scripts. There is a plugin system for octoprint that can be used to program just about what ever you would have liked but that require a litle programming skills and learning the API for octoprint. Sometime down the road im gonna start toying with that API. But for now i have other projects that need to be finished before i move on to the next one.