Raspberry Pi RESTful tutorial
In order to have dizmo communicate with the physical outside world, you will need to learn how to install WebIOPi on the Raspberry Pi and use it with the RESTful dizmo.
What you need
- Raspberry Pi with NOOBS installed http://www.raspberrypi.org/wp-content/uploads/2012/04/quick-start-guide-v2_1.pdf
- SSH needs to be enabled on the Raspberry Pi
- Led (any color), 270 Ohm Resistor
- Breadboard, Jumper Cables
Connect your Raspberry to your network (ideally via the onboard network socket, optionally via a wifi usb dongle) and take note of its ip-adress.
Connect to your Raspberry via ssh, then issue the following commands to download and install webiopi:
$ wget http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz -O WebIOPi-0.7.1.tar.gz $ tar xvzf WebIOPi-0.7.1.tar.gz $ rm WebIOPi-0.7.1.tar.gz $ cd WebIOPi-0.7.1 $ sudo ./setup.sh
sudo /etc/init.d/webiopi start (to start webiopi) sudo /etc/init.d/webiopi stop (to stop webiopi) sudo /etc/init.d/webiopi status (to check the status of webiopi)
Make sure that you have started webiopi using the above commands
open Tiny Browser and enter the ip-adress of the raspberry pi open port 8000.
Default user is “webiopi” and password is “raspberry”
You can click on GPIO Header to get a overview over all your GPIO Pins and the state.
Auto Run (at boot)
$ sudo update-rc.d webiopi defaults (to run webiopi at boot) $ sudo update-rc.d webiopi remove (to no longer run webiopi at boot)
Start RESTful dizmo go to settings insert
into URL (change ip for).
Press [SET URL] and [DONE]
On the content side you can use [POST] to execute your POST code.
Reference WebIOPi RESTAPI https://code.google.com/p/webiopi/wiki/RESTAPI
To turn the LED off you can change the POST URL to
or open a second RESTful dizmo to use it as turn off interface.