Possibility to execute Python-Script with light button

My board doesn't support a light pin. So want to do it with a simple Python-Script on the raspi.
Is there a possibility to use the light button to execute my script instead of extending the top right menu?

Comments

  • I think it is. Make a @execute command for toggling light. In install directory is a folder firmwares with xml files for each firmware. Open your firmware and exchange the toggle light command with your @execute command.
  • Unfortunately I found a lot of entries with the word light in it:

    <command type="caseLightsOn">M355 S1</command>

    <command type="caseLightsOff">M355 S0</command>

    <response type="caseLights" value="1">^Info:Case lights on</response>

    <response type="caseLights" value="0">^Info:Case lights off</response>

    <response type="toggleLightsSupported">^Cap:TOGGLE_LIGHTS:(\d)</response>

    <setting type="CaseLights">^Config:CaseLights:(\d)</setting>


    Could you tell me which one I have to modify with my code below and how it looks like?

    <command>

      <name>Licht ein</name>

      <execute>sudo /usr/bin/python /home/pi/programme/gpio-on.py</execute>

    </command>


    Thank you

  • The two command tags "caseLightsOn" and "caseLightsOff" are the gcodes getting executed. Since server commands are valid there replace them with @execute LichtEin and add a
    <execute name="LichtEin" allowParams="true">/usr/bin/sudo /usr/bin/python /home/pi/programme/gpio-on.py</execute>

    after the command tag. command tag is not for @execute but for server menu. Also make sure sudo for repetierserver user works.
Sign In or Register to comment.