Pi Face HTTP Interface

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

About

The HTTP PiFace interface provides an method of controlling the Raspberry Pi from another computer (or
even another Raspberry Pi!) through a web browser.

Dependencies and Installation


The web interface uses the Django web framework (written in Python), which you can learn more about
here. JSON is also used to transfer data between the server and the web browser so a the Python
simplejson libraries will also have to be installed.
$ sudo apt-get install python-django python-simplejson
After this you will also need to install an Apache web server and configure it to work with Django by
placing the following lines into /etc/apache2/conf.d/django (create the file if it doesnt exist):
Alias /static/ /home/pi/piface/django/projects/httpi/static/
<Directory /home/pi/piface/django/projects/httpi/static>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / /home/pi/piface/django/projects/httpi/httpi/wsgi.py
WSGIPythonPath /home/pi/piface/django/projects/httpi
<Directory /home/pi/piface/django/projects/httpi/httpi>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
The path to the httpi project directory (home/pi/piface/django/projects/httpi/) is correct on the assumption
that we are using the website directly from the piface project directory cloned from the github. You can
change this to whatever directory you like though.
After a reboot the web server should be ready to run. To disable the web server from starting up at
boot (this is desirable since a web server is fairly resource intensive) then disable it with the update-rc.d
command:
$ sudo update-rc.d apache2 disable

Usage
To start the Raspberry Pi web interface simply start up the apache web server. Starting and stopping the
web server can be helped by using the start/stop scripts provided in the piface/scripts/ directory (from
piface on github).

To access the web interface, simply navigate to the Raspberry Pis IP address from within the web
browser on another computer. You should be presented with a web page offering controls for the
Raspberry Pi.

You might also like