External Server command on Rpi not working
Hey Everyone
Im new to Repetier Server and working with Raspberry Pi.
I got my Server up and running.
I want to setup an Relays, with which I can turn on my 3D Printer (switching the power of the USB connection via the relay)
I know that it is possible to define custom commands, which can be accessed from the webinterface.
So I edited the extcommands.xml to add two aditional commands:
___________________________________________
rampsOn.sh:
---------------------------
rampsOff.sh:
---------------------------
Can someone please tell me what I am doing wrong?
Thanks a lot in Advance
Im new to Repetier Server and working with Raspberry Pi.
I got my Server up and running.
I want to setup an Relays, with which I can turn on my 3D Printer (switching the power of the USB connection via the relay)
I know that it is possible to define custom commands, which can be accessed from the webinterface.
So I edited the extcommands.xml to add two aditional commands:
___________________________________________
<command>
<name>Turn Printer ON</name>
<execute>bash /home/pi/scripts/rampsOn.sh</execute>
<confirm>Do you really want to turn ON the Controller?</confirm>
</command>
<command>
<name>Turn Printer OFF</name>
<execute>bash /home/pi/scripts/rampsOff.sh</execute>
<confirm>Do you really want to turn OFF the Controller?</confirm>
</command>
_____________________________________________
and I put the corresponding scipts in the /home/pi/scripts folder:_____________________________________________
rampsOn.sh:
---------------------------
#!/bin bash
gpio -g mode 24 out
gpio -g write 24 1
---------------------------
---------------------------
rampsOff.sh:
---------------------------
#!/bin bash
gpio -g mode 24 out
gpio -g write 24 0
---------------------------
I can start the commands from the webinterface and they also show up in the log:
17:53:48: Starting external command bash with 1 parameters.
I cant see the problem, but If I mesure the voltage between GPIO 24 and GND I get 0V , no matter what I do (I expect 3.3V)
---------------------------
I can start the commands from the webinterface and they also show up in the log:
17:53:48: Starting external command bash with 1 parameters.
I cant see the problem, but If I mesure the voltage between GPIO 24 and GND I get 0V , no matter what I do (I expect 3.3V)
Can someone please tell me what I am doing wrong?
Thanks a lot in Advance
Comments
I didnt Install the GPIO Programm so that the bash file could execute my code...
I folowed a guide for that:
http://raspberrypiguide.de/howtos/raspberry-pi-gpio-how-to/
-pi@raspberrypi ~ $ sudo apt-get update
- pi@raspberrypi ~ $ sudo apt-get install git-core
- pi@raspberrypi ~ $ git clone git://git.drogon.net/wiringPi
- pi@raspberrypi ~ $ cd wiringPi
I had to install build essential here, because I didnt have that eighter:
- pi@raspberrypi ~ $ sudo apt-get install build-essential
after that I could finish the Installation:
- pi@raspberrypi ~/WiringPi $ ./build
And after all that everything was working as intended
I hope this helps anyone else who wants to setup his printer like mine...