Monday 10 June 2013

Controlling GPIO with WebIOPi

Using the http://code.google.com/p/webiopi/ software.

Follow the installation instructions (http://code.google.com/p/webiopi/wiki/INSTALL). This can take a few minutes depending on internet speed and SDCard speed (lots of Python and SSL libs downloaded IIRC).

The instruction page is easy to follow, but to replicate the instructions here:

$ wget http://webiopi.googlecode.com/files/WebIOPi-0.6.0.tar.gz
$ tar xvzf WebIOPi-0.6.0.tar.gz
$ cd WebIOPi-0.6.0
$ sudo ./setup.sh

Once installed, run the sudo webiopi command as follows:

pi@raspberrypi ~/WebIOPi-0.6.0 $ sudo webiopi
2013-06-10 21:33:45 - WebIOPi - INFO - Starting WebIOPi/0.6.0/Python3.2
2013-06-10 21:33:46 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2013-06-10 21:33:46 - WebIOPi - WARNING - Access unprotected
2013-06-10 21:33:46 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.70:8000/
2013-06-10 21:33:46 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2013-06-10 21:33:46 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.70:5683/

Now you can log in to the web app: http://raspberrypi:8000/app/gpio-header. This page looks like:

Using this site for reference (https://projects.drogon.net/raspberry-pi/gpio-examples/tux-crossing/gpio-examples-1-a-single-led/), connect

GND (Pin 6) -> LED -> 330Ω resistor -> GPIO-17 (Pin 11)

I have connected this up rather flimsily by jabbing the resistor and LED into a ribbon cable.

And here it is in use. Look for the underwhelming LED in centre screen!

(Video roated using the nifty YouTube editing capabilities - http://www.youtube.com/editor).

No comments:

Post a Comment