Print finished light/buzzer

How can setup repetier to output a signal to turn a light on when a print finishes?

Comments

  • Depends on how to control the light. Easiest solution is adding it to print finished script. Either send proper gcode or call a script with @execute to turn the light on.
  • How do you recommend controlling the light?

    I Purchased a 2 relay module ages ago but haven't looked into how to connect it to the RPI yet.

    https://www.google.com/search?q=5V+2/4/8+Channel+Relay+Board+Module+for+Arduino+Raspberry+Pi+ARM+AVR+DSP+PIC&oq=5V+2/4/8+Channel+Relay+Board+Module+for+Arduino+Raspberry+Pi+ARM+AVR+DSP+PIC&aqs=chrome..69i57.1149j0j4&client=ms-android-samsung&sourceid=chrome-mobile&ie=UTF-8

    If I connect this to the RPI will repetier server automatically see it to be able to use the @execute command?
  • That is electronics so not my field. All I know is that pi has 3.3V outputs not 5V so wonder if that works. But no @execute can only run commands you have entered in extcommands.xml - see manual advanced setup chapter.
  • edited August 2019
    Ok I just installed the relay board on another rpi I had laying around, which I use to use for running octoprint (prior Repetier Server) and I now have the relays turning on and off via a button click.

    Now I understand a little more on how the relay board is wired/switched ;-)

    I can't find anything in the Rep Serv Manual/advanced setup about switching a gpio pin on RPI.

    How do I tell Repetier server to switch/toggle a gpio pin on the RPI?

    Thanks
  • only Google info I can find shows a guy clicking on the settings icon (gear) at the top of the screen, and it shows a command per pin, but no description what code/file he edited/added.

    Is M42 a command to toggle a pin?
  • M42 toggles pins on the printer board, not on the pi.

    You need something like
    https://thepihut.com/blogs/raspberry-pi-tutorials/27968772-turning-on-an-led-with-your-raspberry-pis-gpio-pins

    There are many tutorials on setting gpio pins for pi but what I find is german, so better search in your language. Then call the script with @execute as described in manual.
  • oh k

    So it's not internal in Rep Serv.
    So RPI needs an external script and repetier just calls that script with @Execute.

    Thanks mate ;-)
  • I got a lil test rig running, switching 2 relays via the server commands on RPI and top right icon, in browser.

    Now just a matter of connecting test rig to the printer wiring lights/buzzer and setting up the @execute command

    Thanks again. :-)
  • edited August 2019
    Why does this not work in the extcommands.xml

    It shows up in the PC browser menus under the gear, and server commands in PI ui

            <command>
                    <name>PrintComplete-PlaySound</name>
                    <execute>sudo /usr/bin/omxplayer /home/pi/PrintComplete-Sound.mp3</execute>
                    <confirm>Really play sound?</confirm>
            </command>

    I get the security confirmation, but then nothign happens.

    If I use  sudo /usr/bin/omxplayer /home/pi/PrintComplete-Sound.mp3 in putty command line it works
  • If you run it you are user pi, if server runs it it is user repetierserver which might not be in sudoer list for /usr/bin/omxplayer. Add it like we shoewd for shutdown command in manual.
  • I did try earlier but I kept getting an error, so I edited the file manually with sudo visudo

    Now I have 2 buttons working, LEDS via GPIO pins and a MP3 playing with omxplayer via both the PC browser menus under the gear, and server commands in RPI ui

    Next step s to connect it to the Printer and add the @execute command to the finish print gcode :-)

    Cheers again
    Steve
  • Well I thought I had finally stopped bothering you for this project, but ;-(

    Sound plays and leds turn on via Browser gear menu, and server commands on RPI

    But do not play when printing.

    Here are screen caps of the files


  • Of course it does not work:-) The commands are only for gui. You missed the part in manual responsible for execute commands:

    <!--
            G-code files can contain
            @execute cmd param1 param2
            commands. To prevent external users from executing unwanted or dangerous commands,
            only commands defined here are allowed to execute. More over, only the shortcuts
            defined here are to be used as cmd in @execute. Prevent parameter where ever possible.
        -->
    <execute name="play" allowParams="true">/usr/bin/afplay</execute><!-- play the sound file on moc os x -->

    Put the <execute > tags below last <command> with same command line as in command and set name attribute to what you use in execute and it should work after server restart.
  • Hi Mate

    Finally got to tinker more.
    All Working now ;-)

    Thanks Again
Sign In or Register to comment.