Tools for playing with a pan & tilt on the Raspberry Pi
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Tools for playing with the Raspberry Pi camera on a pan & tilt mount.

How to setup the pan & tilt is detailed in the Dawn Robotics blog

sudo apt-get install python-dev python-pip
sudo pip install RPIO

The browser based joystick comes from



sudo pip install websocket-client

The excellent SimpleWebSocketServer As this is just one file with no install, I've included in this repo.

To Use

  • joystick.html a joystick websocket client for a browser
  • which controls the servos. It is a websocket client. can be run on a seperate pi (server) than since connects via websockets to get its requested vectors. This also means that, which is run as root, can be seperated from the evils that lurk on the internet.

To run with the socket server as part of

sudo python --host= --driver=rpio

To invert the pan use the -P flag

sudo python --host= --driver=rpio -P

To invert the tilt use the -T flag

sudo python --host= --driver=rpio -T

A virtual pan & tilt is availble if pygame is installed. (sudo apt-get install python-pygame) Choose the "cube" driver with the -d (--driver) option

sudo python --host= -T -P --driver=cube

To run the websocket server in a seperate process:

python --host=

then run with the -S flag

sudo python --host= --driver=rpio -S

(Your host ip address may/will be different)

Then open joystick.html in a browser, preferably via a touch screen.

The joystick represents the position of the camera so it does not spring back to center when released.