Controlling lights

I have been googling and found a similar thread but it didn't help me.

I have set up 2 commands in externalcommands.xml.

        <command>
                <name>Light  On</name>
                <execute>bash /home/pi/scripts/lightOn.sh</execute>
        </command>
        <command>
                <name>Light off</name>
                <execute>bash /home/pi/scripts/lightOff.sh</execute>
        </command>

These both work, the externalcommands appear in the main menu and clicking them turns my light on and off which is set up as pictured.


My question is can I some how execute these commands through the UI light button


I know the answer lies in the ~/firmware/repetier.xml file or in my case ~/firmware/marlin.xml assuming of course it is actually possible. even if I have to combine my bash script into a single script that toggles the light (which I will work on while I wait for a Reply.

Thanks in advance.

Clint.

Comments

  • update now: I have one single script toggleLight.sh working
  • No, th elight button is used to toggle the firmware light on/off function. So unless you connect switch to printer board and set light function there this will not work.

    In next server release adding slug="printerslug" to command tag it will move the entry to the printer context menu instead of global menu.
  • iClint said:
    update now: I have one single script toggleLight.sh working
    can u post your single file script pls? :)
  • edited June 2017
    iClint said:

    These both work, the externalcommands appear in the main menu and clicking them turns my light on and off which is set up as pictured.

    Clint.

    You said that it appears in the main menu. Do you mean the Global Main Menu or the Printer Main Menu? Your code doesn't specify which you are directing it to.

    Edit: NVM, I just checked the instructions for using externalcommands and by default its in the Global Menu unless you specify a slugname.
  • Per printer commands only work in upcoming release!
Sign In or Register to comment.