How about using it to play music, capture and display the action, and saving evidence for the days to come?

Sound good? Well read on.

There are four main parts to this accomplishing this.

1) Playing music

2) Capturing the action

3) Displaying the action

4) Saving the evidence

But first there’s step zero, that is, set up the beast.

As mentioned in the attached video, the included XBMC SD card did not play nicely with my network settings (for some reason, things wouldn’t stick).

Tried a few backend tweaks, but I ended up going to a bog standard install of Raspbian. There are plenty of guides available if you’re going to do this yourself so I won’t cover it here.

So lets get into it.

After installing Raspbian I enabled ssh using the raspi config editor, expanded the file system to fill the entire SD card, and set it to boot straight to the desktop.

For the music player I installed OMXplayer and a freely available front end. It was then simple to play a set of files off the inserted USB flash drive.

Capturing the action and saving the evidence.

I was using the PiCam. More specifically, the PiCam that had the IR filter removed. This was enabled in the raspi config. Using a python script I took a photo once per minute, set the filename to the current time/date, and made a copy called latest.jpg

I originally intended to have a looping slideshow going, however this didn’t eventuate. Instead I installed a lightweight webserver (nginx) to show a simple auto-refreshing page pointed at the latest.jpg file which gave the effect of a slideshow, but only when the image updated.

The other displaying shown in the video was on the LCD display.

This was the PiFace CAD. Although I didn’t use the CA part, the display was perfectly reasonable for my task.

Using a second python script the PiFace CAD display was updated with the current image count, as well as the disk/SD card usage.

The python script was an edited version of the script distrbuted with the piface samples to show system info.

There is a lot of unneeded code in the above, but I couldn't be bothered trimming it down.

Both of these python scripts were coordinated using the crontab set as follows

use sudo crontab -e to edit this

* * * * * python3 /usr/share/nginx/www/<folder-name>/cap.py

*/5 * * * * python3 /usr/share/nginx/www/<folder-name>/photostaken.py

This runs both scripts at startup, takes and stores one image per minute (or rather, on the minute, every minute), and refreshes the LCD display every five minutes (every time a minute occurs which is a multiple of 5).

Now for the TV display. This was controlled using the below php file, which was placed in the folder that contained my scripts, which happened to be a folder in the web server directory.

index.php

<?php header("refresh: 10;");?>

<html>

<head>

<title>MERRY CHRISTMAS</title>

</head>

<body>

<?php exec("sudo -u root -S python3 cap.py < pass"); ?>

<Center>

<img src="images/latest.jpg" width="1280" height="960">

</center>

</body>

</html>

‘pass’ is the path to a text file containing your sudo password. This means you can run it even though it required sudo access.

This particular code runs the python code to capture/name/save an image, and displays an image. If using this code, the line relating to cap.py in the crontab is not really required.

So what about this video?

Initially you see the physical setup, then the LCD display, a timelapse generated from some images taken using the python code (and turned into a movie using mencoder), and finally a few snippets of NYE. I didn’t have the pi capturing the party though.