Delayed shutdown after finished print, possible?!

Hello.

I have an Anycubic i3 Mega. When i print "offline" via SD-Card and the print is finished, the PSU Fan and Mainboard Fan are cooling down the printer for about 5 minutes after the print. Is it possible to add a delay in the Automatic Shutdown Plugin? Where you have multiple options, e.g. "Shutdown printer 5 minutes after print is finished" ; "Shutdown printer 2 minutes after print is finished" and so on.

It would be very nice if someone can help me! :slight_smile:

Thanks and best regards

Sven

I moved this over to the Plugins area since you're asking for help with the Automatic Shutdown plugin itself.

you can do this yourself rather easily ...

the "shutdown" is usually done trough G-CODE (mostly disabling the printer with M18 or M84 or both) ... so all you want to do is find where you are injecting this M18 or M84 (end of print in octoprint or end of script in your slicer or ...) and remove it :slight_smile: ..

then you at the scripts part of the gcode edit "ending scripts" and add something like

M400 ; wait for queue to be empty
G4 S300 ; wait 300seconds 
M84 ; disable steppers

I do this with PSU Control plugin, that turns off the printer power supply after x minutes.

1 Like

I use a "sonoff POW" for remotely turn on/off my Printer.
Under Settings / Octoprint / Server I added a shellscript e.g. /home/pi/scripts/myShutdownScript.sh
So each time the system is shutdown (via plugin or web-menu) this script is executed.
The script looks like this:

#!/bin/bash
echo "Shutdown System and power of after a short delay"
echo "...Sonoff call..."
curl "http://192.168.178.38/cm?cmnd=Backlog%20Delay%20250;Power%20Off"
echo "...shutdown..."
sudo shutdown -h now

You can replace the sonoff-call with something like sleep 5m

BR
Olli

Hi.

Ok. So i created an script and "imported" it into Octoprint. Sadly itΒ΄s not working, and i donΒ΄t have any idea whats the problem. Can you have a look at these please?

I would be very happy if you can help me to fix this problem.

So i would like to create a script, that shuts down the printer (and maybe the Raspberry too) after a finished print, then wait (for example) 5 minutes and then shut it down.

Could you execute the script directly?
Maybe a permission problem: chmod 777 filename.sh
Also try to add sudo in the web UI like the other calls.

1 Like

ΜΆeΜΆΜΆdΜΆΜΆiΜΆΜΆtΜΆΜΆ:ΜΆΜΆ ΜΆΜΆtΜΆΜΆhΜΆΜΆeΜΆΜΆ ΜΆΜΆeΜΆΜΆrΜΆΜΆrΜΆΜΆoΜΆΜΆrΜΆΜΆ ΜΆΜΆiΜΆΜΆnΜΆΜΆ ΜΆΜΆlΜΆΜΆiΜΆΜΆnΜΆΜΆeΜΆΜΆ ΜΆΜΆ5ΜΆΜΆ ΜΆΜΆiΜΆΜΆsΜΆΜΆ ΜΆΜΆaΜΆΜΆlΜΆΜΆrΜΆΜΆeΜΆΜΆaΜΆΜΆdΜΆΜΆyΜΆΜΆ ΜΆΜΆfΜΆΜΆiΜΆΜΆxΜΆΜΆeΜΆΜΆdΜΆΜΆ!ΜΆΜΆ!ΜΆ

ΜΆiΜΆΜΆ ΜΆΜΆgΜΆΜΆeΜΆΜΆtΜΆΜΆ ΜΆΜΆtΜΆΜΆhΜΆΜΆeΜΆΜΆsΜΆΜΆeΜΆΜΆ ΜΆΜΆeΜΆΜΆrΜΆΜΆrΜΆΜΆoΜΆΜΆrΜΆΜΆsΜΆΜΆ ΜΆΜΆwΜΆΜΆhΜΆΜΆeΜΆΜΆnΜΆΜΆ ΜΆΜΆiΜΆΜΆ ΜΆΜΆtΜΆΜΆrΜΆΜΆyΜΆΜΆ ΜΆΜΆtΜΆΜΆoΜΆΜΆ ΜΆΜΆrΜΆΜΆuΜΆΜΆnΜΆΜΆ ΜΆΜΆiΜΆΜΆtΜΆΜΆ ΜΆΜΆdΜΆΜΆiΜΆΜΆrΜΆΜΆeΜΆΜΆcΜΆΜΆtΜΆΜΆlΜΆΜΆyΜΆΜΆ ΜΆΜΆfΜΆΜΆrΜΆΜΆoΜΆΜΆmΜΆΜΆ ΜΆΜΆtΜΆΜΆhΜΆΜΆeΜΆΜΆ ΜΆΜΆpΜΆΜΆuΜΆΜΆtΜΆΜΆtΜΆΜΆyΜΆΜΆ ΜΆΜΆsΜΆΜΆeΜΆΜΆsΜΆΜΆsΜΆΜΆiΜΆΜΆoΜΆΜΆnΜΆΜΆ,ΜΆΜΆ ΜΆΜΆpΜΆΜΆlΜΆΜΆeΜΆΜΆaΜΆΜΆsΜΆΜΆeΜΆΜΆ ΜΆΜΆhΜΆΜΆaΜΆΜΆvΜΆΜΆeΜΆΜΆ ΜΆΜΆaΜΆΜΆ ΜΆΜΆlΜΆΜΆoΜΆΜΆoΜΆΜΆkΜΆΜΆ:ΜΆ

ΜΆhΜΆΜΆtΜΆΜΆtΜΆΜΆpΜΆΜΆsΜΆΜΆ:ΜΆ//ΜΆpΜΆΜΆiΜΆΜΆcΜΆΜΆlΜΆΜΆoΜΆΜΆaΜΆΜΆdΜΆΜΆ.ΜΆΜΆoΜΆΜΆrΜΆΜΆgΜΆ/ΜΆvΜΆΜΆiΜΆΜΆeΜΆΜΆwΜΆ/ΜΆdΜΆΜΆcΜΆΜΆiΜΆΜΆdΜΆΜΆwΜΆΜΆdΜΆΜΆcΜΆΜΆiΜΆ/ΜΆoΜΆΜΆcΜΆΜΆtΜΆΜΆoΜΆΜΆpΜΆΜΆiΜΆΜΆ3ΜΆΜΆ.ΜΆΜΆjΜΆΜΆpΜΆΜΆgΜΆΜΆ.ΜΆΜΆhΜΆΜΆtΜΆΜΆmΜΆΜΆlΜΆ

Edit2:

When i start the script directly from the putty session via "./ShutdownScript.sh" it runs like it should. But from the octoprint web UI itΒ΄s not working. I also added "sudo" to the command. But what is the problem?

BTW: Is there an option to add an Marlin Command to a shell script? And if yes, how?

Give it the full path as run from OctoPrint.