raspberry pi + 17 inch monitor = awesome picture frame

I recently bought a Raspberry Pi because I had seen some really cool things done with one and have some plans to do things with one involving amateur radio. But first I wanted to just get a feel for how it worked so I decided to do what a lot of people have done, and built a digital picture frame.

My wife and I had been looking at just buying an off the shelf picture frame, but they all seemed to have some kind of show stopper issue, errors with the software, problems with the view angle, limited storage, etc.

I ordered my raspberry pi and related hardware from amazon.com. This includes:

  • raspberry pi model B, rev 2.0, $43.17
  • a case, $11.49
  • 16GB class 10 SD card, $16.77
  • USB power adapter, $9.95
  • USB cable, $5.79
  • USB wifi adapter, $9.99
  • HDMI cable, $4.99
  • HDMI to DVI adapter, $4.00

I picked up a 17" Dell monitor from the local university surplus for $35.

I used the Debian Wheezy raspbian image.

The software to run the slideshow for the picture frame is 'feh'.

Subsonic is installed to act as a jukebox.

To sync data to the 'piframe' I used btsync.

The directory structure looks like this:

pi@piframe ~ $ ls -l piframe
total 36
drwxr-xr-x  2 pi pi  4096 Jul 24 14:52 archive/
drwx------  2 pi pi  4096 Jul 24 14:51 files/
drwxr-xr-x  2 pi pi 12288 Jul 24 15:10 images/
drwxr-xr-x  2 pi pi  4096 Jul 24 16:31 restart/
-rw-r--r--  1 pi pi    44 Jul 24 16:20 restart.bat
drwxr-xr-x  2 pi pi  4096 Jul 24 16:23 scripts/
drwxr-xr-x 16 pi pi  4096 Jul 24 14:51 tunes/

This is the script that does most of the work. It kills off any existing feh processes, sets the delay to be 15 seconds, and passes the options to feh. If the restart/restart_slideshow file exists, the file is deleted.


# PiFrame feh start script

export DISPLAY=:0

/usr/bin/killall feh


/usr/bin/feh --quiet \
--hide-pointer \
--recursive \
--randomize \
--full-screen \
--slideshow-delay ${DELAY} \
${HOME}/piframe/images/ &

if [ -f ${HOME}/piframe/restart/restart_slideshow ];then
   rm ${HOME}/piframe/restart/restart_slideshow

This file is added to ~/.config/autostart to call the slideshow.sh script on boot up.

[Desktop Entry]
mkdir .config/autostart
ln -s ~/piframe/scripts/slideshow.desktop ~/.config/autostart/

After installing incrond:

sudo apt-get install incrond 

Then edit /etc/incrond.allow and add 'pi' or the username the slideshow will run under.

incrond is configured to monitor the piframe/restart directory. If any files are created in that directory, the piframe/scripts/slideshow.sh script is run.

/home/pi/piframe/restart IN_CREATE /home/pi/piframe/scripts/slideshow.sh

Since this is being setup to manage the slideshow from windows boxes, there is a bat file that creates a file in the restart directory. Once images are added or deleted to the piframe/images folder, run the restart.bat file and the slideshow will get restarted once btsync copies the files around.

echo restart > restart\restart_slideshow

I will have another post going into more detail on setting up btsync, as I am in the process of replacing Dropbox and SpiderOak sync with it.