Home Project v1 How it works Cheerlights Blog Links

How it works



This year we have better hardware to host the database and web server and stream the camera .

The server is a Dell optiplex quad core running Debian Linux in a Oracle VM.

The camera this year is a raspberry pi camera using RPI cam interface using this nice software means we can fully control the camera frame rates etc , and no lag like ustream.

Webserver is apache2 and database is mysql.


Lights Control

When you go to the live tree you will see a video window and a button selection window.

Clicking on a button will change a state in a database, every 5 seconds the rasperry pi will scan this database and change its GPIO pins accordingly, a few seconds later you will see your selection change in the video window .

The code I used came from a instructables project here. (Project has been taken down )

The code was modified quite a bit by myself , removed things I didn’t need, added options to connect to a external sql database as I didn’t want to overload the pi with apache/mysql/php5.

The curcuit is very simple , the pi changes a state on a gpio pin to 3.3v, this wasn’t enough to drive the 5v arduino relay boards, so I made a simple transistor switch to take the stress off the pi and drive a status led as well.


Spamming the buttons will not change the states of the lights any quicker as its the pi reading the database that changes the lights .


So ideal operation is view the video stream , and click a button and wait a few seconds and your selection will change .



Copyright 2016 xmas4all.co.uk