Old Laptop –> Digital Picture Frame

November 16th, 2004

Filed under: Computers and Technology

Tags: , ,

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.

Sidenote: If you wish to use one of these old laptops as a “desktop computer” running Linux, then you would probably be best to use a light-weight window-manager such as ffwm or windowmaker instead of the KDE or Gnome window-managers that come as the defaults in most Linux distrobutions. Using a less resourse-intensive window manager can make these old computers quite usable, even “snappy”.

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:

  1. 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.
  2. 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.

The nice thing about Xandros is the good hardware detection, this can make for more painless OS installs if nothing else. The big caveat however is that my Xandros installation take up about 1G, half of my laptop’s little 2GB hard drive. A stripped down Debian install would leave more room with less manual cleanup.

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.

In Debian, one would just use:
apt-get install feh unclutter

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:

#!/bin/bash
# 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:

#!/bin/bash
# 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:

#!/bin/sh
# 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:

/etc/init.d/picframe start

and stopped with:

/etc/init.d/picframe stop

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:

ln -s /etc/init.d/picframe /etc/rc3.d/S99picframe

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 2 * * * /etc/init.d/picframe stop > /dev/null
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:

  1. 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, then

      perl Makefile.PL
      make
      make install

    • Download and install the User::Utmp perl package with the same commands as above.
  2. Edit /etc/inittab to make qlogin automatically log in to the first tty:
    replace
    1:23:respawn:/sbin/getty 38400 tty1

    with

    1:23:respawn:/sbin/qlogin –command=”/bin/bash” /dev/tty1 pictureframe
  3. 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
  4. Reboot and enjoy.

Hardware

Laptop with slideshow software running on it
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.

Hinge-end of the laptop showing extended cables.
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.

Side-view of laptop with the screen epoxied to the bottom of the laptop. The hole seen is where the dead battery used to live.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 display/laptop standing on a shelf with matting in front of it. The power and network cables are sneaking around behind the booksThe 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.

20 Responses to “Old Laptop –> Digital Picture Frame”

  1. Geek Gather » Linux LCD Picture Frameon 21 Jan 2007 at 2:50 pm

    [...] I have an old laptop. It’s a PIII 733Mhz Dell Inspiron 5000, which you may recall weighs about as much as a small Yugo. This laptop is old enough that I don’t use it, but good enough for some use. So I’ve decided to attempt the creation of a Linux based LCD picture frame. I’m not the first to attempt this and this guy has some good guidance.So far, I’ve managed successful disassembly, and the bits and pieces still boot. The system is currently running Fedora Core 5 off an IBM Travelstar HD. Considerations for the future are: [...]

  2. David Woleveron 03 Feb 2007 at 1:28 pm

    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).

  3. paper shredderon 08 Feb 2007 at 1:33 am

    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.

  4. Adam Nofsingeron 21 Mar 2007 at 9:26 am

    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!

  5. LeoNeoon 19 Jun 2007 at 1:18 pm

    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…..

  6. Ian Corbitton 13 Aug 2007 at 2:03 pm

    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

  7. Sofia Camposon 24 Aug 2007 at 5:06 pm

    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

  8. Matt Jon 26 Aug 2007 at 7:23 pm

    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?

  9. Matt Jon 04 Sep 2007 at 2:38 pm

    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.

  10. Kat Von Don 21 Sep 2007 at 9:22 am

    Kat Von D…

    I Googled for something completely different, but found your page…and have to say thanks. nice read….

  11. Lioon 30 Oct 2007 at 8:15 am

    I’ve done a prety similar work… but under dos :)

  12. VCSekhar Parepallion 30 Mar 2008 at 1:06 pm

    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

  13. Stephenon 22 May 2008 at 7:29 pm

    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

  14. [...] Linux Digital Picture Frame – Adam Franco’s blog post on how he converted a laptop into a digital picture frame Linux Thinkpad FrameLinux Wireless FrameLinux Dell Inspiron 3500 FrameLinux Dell Latitude CSx Frame – This one was mounted on the wall thus called the WallTopDamn Small Linux Digital Photo Frame [...]

  15. Adam Francoon 31 May 2008 at 11:00 pm

    @Stephen

    Thanks for the notice. I must have deleted the images when doing some house-cleaning on the server. They are back now.

    - Adam

  16. Sluggyon 16 Jun 2009 at 10:32 pm

    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?

  17. Adam Francoon 17 Jun 2009 at 6:59 am

    @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:

    In-place editing
    Rotate images in place for quick re-orientation. *new* For jpegs, rotation is lossless using the lossless JPEG rotation algorithms. Exif information is also preserved.

    As to whether or not the lossless rotation can occur based on EXIF tags; I have no idea.

  18. Jessicaon 29 Jul 2009 at 10:46 am

    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

  19. [...] on August 26, 2010 by JuanTheDesigner The method I’m using right now on my iBook is from this blog post.  I’m using Debian Linux, FEH, and a shared folder. On my PC, I have mapped the [...]

  20. Jose Antonioon 14 Jan 2012 at 4:38 pm

    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

Trackback URI | Comments RSS

Leave a Reply