Power off printer after print finishes
How can i run a shell script after a print job finishes? I want to power off the printer via GPIO.
See manual advanced setup how to define programs you can execute. Define a command you can run with
unpower_printer for example. That can be a simply python script toggling the pin.
but where do i put that?
Printer settings, g-codes, event dependent?
I think event dependen for print finished event as last command would be a good place. At least if you want it after every print. If it should just be a menu entry just add it to commands.
edited March 3
Cant get it to work
in Run after job and have the following extcommands.xml:
<name>Power on Printer</name>
<execute>gpio write 8 0</execute>
<name>Power off Printer</name>
<execute>gpio write 8 1</execute>
<confirm>Really power off the printer?</confirm>
<execute>sudo /sbin/shutdown -h now</execute>
<confirm>Really shut down the server?</confirm>
<execute>sudo /sbin/shutdown -r now</execute>
<confirm>Really reboot the server?</confirm>
<execute name="killprinter" allowParams="false">/var/lib/Repetier-Server/killprinter.sh</execute>
killprinter.sh (it is executable and readable by the repetier-server daemon user and gpio pins are accessible because the menu commands to power on and off the printer do work):
gpio write 8 1
I also tried sudo -u repetierserver /var/lib/RepetierServer/killprinter.sh manually after finishing a print and it shut the printer down like it should.
You know the command is not
You say which commands can be executed with
not the names itself.
Still not working with that command..
Just saw there is a semicolon in my example which is of course wrong an only a type.