Power off printer

Hi,

I own a Anet A8 printer. I have no possibilities to power off the machine. Now i bought an ALLNET ALL3072 socket. You can
switch this socket of an on via a URL you call. Example http://192.168.0.100/xml/jsonswitch.php?id=2
Is It possible to ad a button in the Repetier-Server page to do this? And is it possible to ad this to a "Print finished"-Script?

Kind regards andy

Comments

  • You need a bash script somewhere that sends the url via curl. Then read manual - advanced part about extcommands.xml allowing you to add new commands in top menu and also new @execute commands. With the definition of the @execute command you could just put that command in the finish script.
  • Thanks for your answer. Could you please tell how to do that bash script?
    I am running repetier server pro under linux and I'm not so good at linux.
    Can I add an extra button on the Website?
  • The server commands appear in the "Gear" main menu.

    bash script is just textfile with

    #!/bin/bash
    curl ......

    and permissions to execute
    chmod 755 filename

    That makes it executable like any other program. And it just contains commands like you enter in shell directly.
  • edited February 2017
    I managed to add the extcommands.xml. I also set
    # sudo -s
    # echo "repetierserver ALL=NOPASSWD: /sbin/shutdown" > /etc/sudoers.d/repetierserver-shutdown
    The two examples "Shutdown" and "Reboot" appear in the menu also the Security Question.
    But the Server neither reboots nor does a shutdown.
    Do I have to do anything else?
    And can i install Curl via apt-get install php5-curl?

  • curl is normally installed but if not use
    apt-get install curl

    we do not use the php5 library of curl:-)

    sudores file must be root write only. So check like this:
    pi@RepetierServer:~ $ ls -l /etc/sudoers.d/repetierserver-shutdown
    -rw-r--r-- 1 root root 44 Sep  3 11:08 /etc/sudoers.d/repetierserver-shutdown

    otherwise you get no permission to run shutdown and command fails. Your printer shutdown does not need root privieges, it must just be world executable/readable.

  • edited February 2017
    I get this answer:

    pi@Repetier-Server:~$ ls -l /etc/sudoers.d/repetierserver-shutdown
    -rw-r--r-- 1 root root 42 Feb 17 08:40 /etc/sudoers.d/repetierserver-shutdown

    I think 42 is wrong. How do I change this?



  • Please Ignore my last post. I am blind NOPASSWD.
    Sorry

Sign In or Register to comment.