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.
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.
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?
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.
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.
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 :-)
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.
Comments
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?
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
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.
So it's not internal in Rep Serv.
So RPI needs an external script and repetier just calls that script with @Execute.
Thanks mate ;-)
Now just a matter of connecting test rig to the printer wiring lights/buzzer and setting up the @execute command
Thanks again. :-)
It shows up in the PC browser menus under the gear, and server commands in PI ui
If I use sudo /usr/bin/omxplayer /home/pi/PrintComplete-Sound.mp3 in putty command line it works
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
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
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.
Finally got to tinker more.
All Working now ;-)
Thanks Again