I managed to also write a python code to send signals to the servers which looks a bit like this :
import RPi.GPIO as GPIO
Now that is great but what would have been better would be to access to the GPIO pin remotely via a REST API for example and here is where Webiopi kicks in which basically provides you a WEB and a REST interface to connect to you GPIO pins of your PI :
As a first setup you need to follow the instructions from the Webiopi install page above .
Note: that current version , WebIOPi-0.7.1 ,didn't work straight off with my Raspberry Pi 2 I had to do the following changes to the following c files once the Webiopi setup was completed:
1.python/native/cpuinfo.c,change "BCM2708" to "BCM2709";
2.python/native/gpio.c, change "#define BCM2708_PERI_BASE 0x20000000" to "#define BCM2708_PERI_BASE 0x3f000000";
3.run setup.sh again.
The above solution was found from RaspberryPi forums .
Now you should be up and running after having re-run the setup for WebIOPI. You launch the server using command:
sudo /etc/init.d/webiopi start
Then you go to navigate to the following location on your PI :
Note that you can get the IP_ADDRESS_OF_YOUR_PI using ifconfig command .
To quickly test the setup navigate to :
For those pins on which servos are connected change them from IN to OUT and click on the number corresponding to the pin to execute .
Note that WebIOPI is supported by Weaved which provides you to install a package on your Raspberry PI that allows you to control your RaspberryPi WebIOPI from anywhere as long as you and your PI are connected to the internet .
What nice is that this is a free service and I justed it works .