Introduction
With the rapid increase of computer power and the growing software power-requirements that go with them, it is often easy to find old Pentium 100, 133, and 166 (or similar generation) laptops for little if any cost. Machines of this generation generally ran MS Windows 95, which can’t cope with new hardware such as wireless PC cards and such, limiting their usefulness. While machines are woefully underpowered for running a new version of MS Windows, they will often run just fine with Linux.
The laptop I am using for this Linux picture frame project is an old Dell Inspiron 3000 with a Pentium chip that I got for free since the battery had died and the keyboard didn’t work. It turns out that the keyboard works fine in Linux, just not in the MS Windows 95 that had been installed on the machine.
Even if you can’t find one of these for free, they can usually be had for VERY cheap. To save even more cost, look for ones with broken keyboards/dead batteries, broken touchpad, etc. Just plug in a PS/2 keyboard and mouse for the install, then access the machine through the network (ssh) after that.
The one addition I made to my laptop is a Xircom “Cardbus Ethernet 10/100 + Modem 56” PCMCIA ethernet card. All you generally need is an ethernet card that will work with Linux, for the purposes of the picture frame, speed isn’t much of an issue.
Software Overview
When searching around for info on turning a laptop into a digital picture frame, the tutorials I found all focused on modifying the hardware (removing extra plastic, mounting the screen, etc) and made just a passing mention to the software setup involved. This tutorial will start with software for several reasons:
- Its a lot easier to install Linux on a computer with a keyboard and mouse than on a stripped down motherboard/screen packed into a picture frame.
- You might as well set up Linux and make sure that all of your hardware and software is working well together before modding the hardware. This helps isolate problems.
Operating System
I chose to put Xandros Desktop on my laptop for this project. I had initially tried a Knoppix hard-drive install of “straight” Debian, but had some problems with the network card or something. I don’t quite remember what the problem was, but I tried Xandros as well as replaced my network card with the above mentioned Xircom one. Xandros happend to be the distro that was on the machine when I got networking up, so I didn’t bother to change it.
You can use any Linux distribution to build your digital pictureframe, but the placement of a few of the initialization scripts may be different on a distribution such as Fedora or SUSE which are not based on Debian (as are Knoppix and Xandros Desktop).
Displaying the Pictures
I chose to use the “feh” image viewer for displaying a slideshow of the photos. “feh” has several big advantages:
- Full-screen mode
- Reliable image stretching
- lots and lots of options for delays, sizing, ordering, etc
- can be run from the command-line without needing a window manager (I’m not sure if this true of other slideshow programs or not)
Starting/Stopping the Slideshow
I wrote a few little-tiny bash scripts to call the slideshow and initiallize it. Their paths and contents are listed below in the like-named section.
Setting up the Display Software
Assuming that you have successfully installed and are running Linux on the laptop, install the “feh” program from LinuxBrit.co.uk. Also install the “unclutter” program to hide the mouse cursor after several seconds of inactivity.
Make a script to start feh with the images from a certain directory
As mentioned in the use case above, I want to have feh automatically started with all the images in a folder. To be able to do that with one command, i put the following script at /usr/local/bin/slideshow.sh:
# This file is located at /usr/local/bin/slideshow.sh
#
# Copyright 2004 Adam Franco
# Licensed under the GNU GPL v1.2+ (http://www.gnu.org/licenses/gpl.html)
killall feh unclutter
unclutter &
feh -zZFr -D 300 /home/afranco/Photos/
The options I used are as follows:
-z — randomize the order of images
-Z — zoom images to fit the window
-F — make the window full-screen
-r — recursively search the target directory for images
-D — Delay (in seconds) between images
Be sure to change “afranco/Photos/” to your actual image location.
If you now call “slideshow.sh” from a console in an X-session, feh should run.
Running slideshow.sh from the command-line without an X-session.
I wanted to be able to start the slideshow on boot, and to be able to restart/stop it with the cron schedualer or manually from a remote terminal. Even though I could set the KDE environment to automatically log in and start feh from within the X-session, that wouldn’t allow for easy enough control.
To start/restart the slideshow, I put the following script at /usr/local/bin/reloadslideshow.sh:
# I put this file at /usr/local/bin/reloadslideshow.sh
#
# Copyright 2004 Adam Franco
# Licensed under the GNU GPL v1.2+ (http://www.gnu.org/licenses/gpl.html)
# make sure none of our parts are running and are in the way.
killall feh unclutter X kdm;
#run the slideshow
/usr/bin/X11/xinit /usr/local/bin/slideshow.sh &
In Xandros (and other distros that use a graphical login screen like “kdm”) it is important to free up the X-window so that you can put the slideshow there. This is accomplished by killing kdm and X. To prevent the graphical login screen from apearing at all on boot, remove all links that contain “kdm” from /etc/rc2.d/ and /etc/rc3.d/.
Starting the Slideshow on Boot
To start the slideshow on boot, I first made an init script in /etc/init.d/ to control the starting and stopping of the slideshow. Looking back, I could have put the scripts listed above right in this init script, but that wasn’t how I approached it, so I will leave it. Feel free to put the commands from the above scripts right into the init script instead.
The init script at /etc/init.d/picframe:
# Start/stop the pictureframe
#
# Copyright 2004 Adam Franco
# Licensed under the GNU GPL v1.2+ (http://www.gnu.org/licenses/gpl.html)
test -f /usr/local/bin/reloadslideshow.sh || exit 0
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin
export HOME=/root
case “$1” in
start) echo -n “Starting pictureframe”
# pass something to the mouse to wake up the display if its asleep
echo “Hello there mousey.” > /dev/mouse
echo “Hello there mousey.” > /dev/mouse
sleep 5
echo “Hello there mousey.” > /dev/mouse
setterm -blank 0
# The XF86Config-4 should have Option “BlankTime” “0”
# start the slideshow
/usr/local/bin/reloadslideshow.sh
;;
stop) echo -n “Stoping pictureframe”
killall feh X
# make sure the display will go to sleep
setterm -blank 1
;;
restart) echo -n “Restarting pictureframe”
/usr/local/bin/reloadslideshow.sh
;;
*) echo “Usage: /etc/init.d/picframe start|stop|restart”
exit 1
;;
esac
exit 0
Now that the init script is in place, the slideshow can be started with the command:
and stopped with:
To get the start the slideshow on boot, make a link in either/both of /etc/rc2.d/ or /etc/rc3.d/. All of the links in /etc/rc2.d/ are called with “start” when booting into runlevel 2 or higher. The links in /etc/rc3.d/ are called with “start” when booting into runlevel 3 or higher. The runlevel is set in /etc/inittab. Anyway, I am running the machine at runlevel 3 and I made a link called “S99picframe” that links to my init scrip. The command to do this is:
You can reorder the call sequence in the /etc/rcX.d/ directories, by renaming the links (they are executed in alpha-numeric order). The slideshow should now start on boot.
Starting and stopping on schedual with cron
I wished to save both power and screen-life by turning off the screen when I am asleep/not home. To do so, I put the following lines in my crontab:
0 17 * * 1-5 /etc/init.d/picframe start > /dev/null
0 9 * * 0,6 /etc/init.d/picframe start > /dev/null
The first line stops the slideshow at 2am every night. The second one starts it every weekday at 5pm. The third line starts the slideshow every sunday and saturday at 9am.
Blanking the screen when the slideshow is stopped.
It seems that a user has to be logged into a local tty terminal on the machine and have “setterm -blank 1” run in order for the screen to be turned off when the slideshow is stopped. You could manually log in to a tty. Another way to do this is follow the directions on this site for automatically loging into a tty and running the setterm command. Alternatively, it may work to modifiy the terminial creation piece in /etc/inittab to just run the setterm command before showing the login prompt.
How I finally got the screen to blank automatically:
- Followed these directions for installing qlogin and the two libraries it needs.
- Download qlogin into a convenient directory such as /usr/local/src/.
- copy the “qlogin” program in the archive to something like /sbin/qlogin
- Install the setgroups extention:
…it comes with Qlogin. To build that, cd to the “setgroups” subdirectory
in the Qlogin source tree, thenperl Makefile.PL
make
make install - Download and install the User::Utmp perl package with the same commands as above.
- Edit /etc/inittab to make qlogin automatically log in to the first tty:
replace1:23:respawn:/sbin/getty 38400 tty1with
1:23:respawn:/sbin/qlogin –command=”/bin/bash” /dev/tty1 pictureframe - Add “setterm -blank 1” to the rc.local file.
If you are using Debian and therefore don’t have an rc.local file, you can make the equivalent as follows:
- make a script with the following at /etc/init.d/local
#!/bin/bash
/usr/bin/setterm -blank 1 > /dev/console
- make that script executable
chmod a+x /etc/init.d/local
- add that to the startup:
update-rc.d local defaults 80
- make a script with the following at /etc/init.d/local
- Reboot and enjoy.
Hardware
My rule of thumb for the hardware side of this project was to do as little modification as necessary to achieve the desired form and function. My main reason for this is that I wished to retain as much of the basic functioning of a normal laptop as possible to facilitate future modifications and upgrades to my picture-frame system. By retaining the general laptop form-factor, keyboard, CDROM, etc, reinstalling the operating system, other devices, etc is much easier. As seen in the picture at right, I started this project in “laptop form”, getting the software working first for exactly this reason.
Once I had gotten the software worked out as described in the sections above, it was time to modify the hardware of the laptop to get it into “picture frame” form-factor.
I was initially hoping to be able to simply unscrew the hinges and remount the display backwards so that it closed with the back of the screen on top of the keyboard, a la “tablet PC”. This configuration would be strong — since the screen would still be screwed to the body of the laptop, just backwards — as well as simple and extensible — since it could easily be returned to “laptop” form-factor.
Unfortunately, the orange data-cable/strip (shown in the picture above/left) was not flexible enough to twist around to an inverted configuration. Since that wasn’t going to work, I decided just to pull the data-cable/strip out as far as it would go and epoxy the back of the screen to the “bottom” of the laptop with wood spacers to allow for airflow. In addition to the gluing, I had to solder a 3-inch extension into the display power-cable-bundle so that it could reach around the back of the laptop.
The only remaining job is to obtain a frame and hang the display on the wall. In the mean-time I am just standing the machine on a shelf with a piece of matting leaning against it. The power and network cables that sneak back through the books on the shelf allow me to ssh into the display and update/change the pictures in the slideshow.
Pingback: Geek Gather » Linux LCD Picture Frame
I came across this site as I was doing a similar project and thought I may be able to make things a little bit easier on some people. Blanking the screen is as simple as xset dpms force off (and then to turn it back on, xset dpms force on).
I just finished a write up on how I did much the same thing. The laptop turned picture frame now runs Damn Small Linux and sync with a central file server.
Hey, thanks for this! I needed to make a quick Kiosk type project at work and I had already decided on DSL and feh, but I wanted to get rid of the mouse cursor and found out how to do that from your article. Also picked up some other information. Thanks again!
Heeeeeeeeeeeyyyyyyyyyy, thanks for this my friend, then a will sent to you some pictures of my proyect, im will try to put this in my living room, see you, and thanks again…..
Thanks for this man. I had a little bit of bump getting unclutter working and the init script, as I’m running this on an older Redhat 7.3 system, but other than that, works perfectly.
Thanks again,
Ian
Hi Adam,
I couldn’t figure it out where to find your email, so here I am leaving you a quick note. I was reading this article and I want to talk to you about sponsorship so if you are interested send me an email.
Thanks
Excellent write up. Are you able to turn the DPF on and off without hurting the filesystem? Are you able to turn it on and the script runs on boot up as well as with cron?
I’m getting syntax errors on your picframe script.
Everytime I do /etc/init.d/picframe start its comes up with a syntax error that says the stop command does not exist.
Pingback: Kat Von D
I’ve done a prety similar work… but under dos 🙂
Hi Adam,
I came across your article via Google Search results. I have an old Digital HiNote VP laptop with Pentium 100 Mhz CPU on it and a total HDisk space of 1G on it and RAM of 32 MB on it.
Could you please help me point to any steps on turning this into a Digital Photo Frame?
I could follow yours but looks like you have a 2 G HDisk unlike mine, so am not sure how to proceed here. Also just to let you know-> the pictures at http://www.adamfranco.com/archives/category/computers-and-technology/hardware are not downloading and are showing X place holders in place of the images.
Thanks in advance,
VC
I cannot see any of the images on this page. I have tried Firefox and IE. Do I have a problem or is it the page?
Stephen
Pingback: Linux - Based Digital Picture Frames | iChat Do It Yourself
@Stephen
Thanks for the notice. I must have deleted the images when doing some house-cleaning on the server. They are back now.
– Adam
Hi,
I was able to create my own picture frame from an old Celeron Thinkpad using Slitaz Linux. With feh, is there an option that allows auto rotating of images based on the EXIF information?
@Sluggy
My picture frame fell off the wall a few years ago and is not currently operational, so I haven’t tested this out. The Feh Features page does list the following abilities:
As to whether or not the lossless rotation can occur based on EXIF tags; I have no idea.
Hey!
I have an old Dell inspiron 8100 I want to use, but have a few questions.
Do I delete everything by right clicking on the hard drive then clicking format??
How would I use this OS and set up something so I can wirelessly add photos from my current laptop? instead of using a USB key…
e-mail me back if you have time, or answers.
Thanks!
-Jess
Pingback: Using FEH and Linux for slideshow | DIY DPF Reference Guide
I read the article, 100 th , and not foun solution, for Blanking the screen when the slideshow is stopped. I have Debian 5, and installed with gdm… i remove gdm with apt-get remove gdm, and always when slideshow finish screen blank!. Can you help me….thanks!
BEST REGARDS