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 @execute unpower_printer for example. That can be a simply python script toggling the pin.
  • I saw @execute 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 2017
    Cant get it to work :(

    I put @killprinter 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>
                <name>Shutdown Server</name>
                <execute>sudo /sbin/shutdown -h now</execute>
                <confirm>Really shut down the server?</confirm>






                <name>Reboot Server</name>
                <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):

        sleep 3
        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 @killprinter but

    @execute ;killprinter

    You say which commands can be executed with @execute 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.
Sign In or Register to comment.