Sunday August 31, 2008
I originally built my digital picture frame over a year ago. The process is remarkably easy if you have an old laptop lying around:
1. Disassemble the laptop
2. Find or have someone make the actual frame. The frame should be deep, so it covers your parts.
3. Create a mat (in Norway this is called the “passepartout”) that fits the monitor you will be putting in.
4. Mount the laptop parts you need in the picture frame.
5. Install OS.
Originally my picture frame ran a version of Windows Vista. While it may sound stupid, it really isn’t; when I was around I used the picture frame as a digital media player through Windows Media Center, and was operated using a WMC remote. The downsides to this was of course the amount of power used. So when I moved this summer, I decided to install some sort of Linux on it, and use it exclusively as a picture frame.
If you haven’t built yourself a picture frame yet, make sure the field of view on the monitor you will be using is acceptable. You should be able to see the picture clearly from strange angles. The monitor I have is not very easy to see. Ideally, a LCD monitor from a desktop computer should be better to see from multiple angles.
Installing Xubuntu should be very straightforward. I set up a separate user, dubbed auto, which is set to auto-login. You will also need feh, which can be installed by doing:
sudo aptitude install feh
All my pictures are stored on a home server I have, and is shared via Samba. The share is mounted on the picture frame using the following fstab-entry:
//server/mediacenter /mnt/server smbfs username=mediacenter,password=secret,uid=auto,gid=users 0 0
This means my pictures will show up in the /mnt/server/pictures-folder (there is other stuff in that share as well).
My picture frame is connected to the network through its built in wireless. This has one problem — the network does not work until some time after the user has logged in. This can probably be fixed through some clever hack, but I decided that I’d work around it. So, to avoid accessing the network straight after booting, I decided to cache the images locally.
This is achieved through rsync. My picture frame is equipped with a hard drive, and thus has a lot of free space. So syncing the pictures aren’t really an issue. If you want to be completely noise free, go with a memory stick and skip the rsync-ing.
So, the following script is set to auto-execute when the picture frame reboots:
#!/bin/bash
export DISPLAY=:0
feh --quiet --recursive --randomize --hide-pointer --full-screen --slideshow-delay 300 /home/auto/pictures &
This simply starts showing the pictures which are already on the picture frame when it boots. You don’t need to wait for the network, as the pictures are local.
To synchronize the pictures, a separate script is used. It looks like this:
#!/bin/bash
export DISPLAY=:0
sleep 300
rsync -raz /mnt/server/pictures/* /home/auto/pictures
killall feh
feh --quiet --recursive --randomize --hide-pointer --full-screen --slideshow-delay 300 /home/auto/pictures/ &
Before doing anything, it sleeps for 5 minutes. This makes sure the wireless is up and running before running rsync. When rsync has finished, feh is restarted, and starts showing all the pictures.
Turning on and off the picture frame at night is accomplished using two separate scripts, screen_off.sh and screen_on.sh:
#!/bin/bash
export DISPLAY=:0
xset +dpms
xset dpms force off
#!/bin/bash
export DISPLAY=:0
xset +dpms
xset dpms force on
You can guess which is which.
The scripts are run as a cronjob at different times of the day. Depending on your personal schedule, you would change the contents of your cron file. Mine looks like this (it is called /etc/cron.d/feh):
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
# Mon-Friday on
00 07 * * 1-5 auto /home/auto/screen_on.sh
# Sat-Sunday on
00 09 * * 0,6 auto /home/auto/screen_on.sh
# Mon-Friday off
00 23 * * 1-5 auto /home/auto/screen_off.sh
# Sat-Sunday off
30 0 * * 1,6 auto /home/auto/screen_off.sh
# Restart slideshow daily to fetch new images
0 0 * * * auto /home/auto/start_feh.sh
The result? One nice-looking picture frame.

Comments