Category Archives: Networking

TechClicker Clinic: A Functional Raspberry Pi Digital Photo Frame

We’ve written about digital photo frames in the past.  While the concept of a digital photo frame is fantastic in this era of ubiquitous personal digital photography, the implementation of these devices by consumer electronics companies has failed to create a market with mass appeal for consumers.  The best digital photo frames remain the creations of hobbyists, and even in that realm complications and misinformation can lead even the technically proficient astray.

We’re going to provide a functional and relatively inexpensive way to create  a digital photo frame using a Raspberry Pi computer.  The Raspberry Pi is an small bare-bones computer that runs a version of the Linux operating system.  For those unfamiliar with Linux, use of the Raspberry Pi and its native command line interface could be daunting, but our step-by-step instructions will guide readers through the process of setting up and configuring the Raspberry Pi and its software.  Items needed to build this Raspberry Pi digital photo frame include the following (substitutions are acceptable, but the items listed were used when we built our Raspberry Pi digital photo frame):Raspberry Pi

(1)  Raspberry Pi 2 Computer (Model B, Revision 2, 1GB RAM)

(1) Raspberry Pi Clear Case

(1) Edimax EW-7811Un 150Mbps Wireless USB Adapter

(1) SD Card (2GB or greater, Class 10 or greater)

(1) HDMI to VGA Converter (only needed of the display device doesn’t have a HDMI interface)

(1) HDMI Cable

(1) VGA Cable

(1) 5V USB power supply (used to power the Raspberry Pi)

(1) micro USB Cable (used to power the Rasbperry Pi)

(1) Ethernet cable (used in initial setup only)

(1) Computer Monitor (VGA input, 17″ or larger)

(1) SD card reader

The Raspberry Pi based digital photo frame described below operates as a wirelessly networked device on the users home network.  No photos are stored locally on the the Raspberry Pi digital photo frame.  Rather, photos displayed via continuous slideshow on the frame are read from a shared storage location on the users network, such as another computer or NAS device.  Having photos stored remotely allows the user to easily update the content of the Raspberry Pi digital photo frame without having to manually handle it once its installed.   By simply changing the photos stored in the shared network directory, the digital photo frame contents are updated when the frame is rebooted.

This guide describes the steps required to setup a networked Raspberry Pi digital photo frame.  Upon completion, the user will have a system that boots automatically into a slideshow of photos.  Packaging the electronics into a presentable frame is left to the creativity of the builder.  Enjoy!

Step 1:  Prepare the SD Card for use in the Raspberry Pi Digital Photo Frame

It’s important to start with a freshly formatted SD card.  Using an SD card reader attached to a PC, it’s easy to format an SD card.  There’s a free program called SD Formatter (available here) that detects an SD card and formats it.

SD Formatter

After formatting the SD card, download the most recent version of the Debian Linux based Raspberry Pi “Raspbian” operating system (available here) from the official Raspberry Pi website.  This site and its moderated forums are an incredible resource for anyone, including beginners, working with a Raspberry Pi.

Under the heading “Raw Images”, download the latest release of the Wheezy Raspbian OS (the filename format is  This file is nearly 2GB and will take several minutes to download.

You’ll need software to flash the Raspbian disk image to the SD card.  One freely available possibility is Win32 Disk Imager (available here).

Win32 Disk Imager

After installing Win32 Disk Imager and completing the Raspbian OS image download, you can unzip the Raspbian image file and direct the Win32 Disk Imager software to its path.  With the SD card still in the card reader and attached to the PC, make sure it is properly selected as the device.  Click the “Write” button and the Raspbian OS image will be written to the SD card.  Upon completion, insert the SD card into the appropriate slot on the Raspberry Pi.

The Raspbian OS is pre-configured and ready to boot when installed within the Raspberry Pi.

Step 2:  Make Initial Connections to the Raspberry Pi

Before powering up the Raspberry Pi, make all the necessary connections of cables and devices for its proper operation.  Install the Edimax EW-7811Un 150Mbps Wireless USB Adapter into one of the two USB ports.  Insert the SD card into its slot.  Connect the Raspberry Pi to a router via an Ethernet cable (this connection is temporary and only for initial setup).  Connect the Raspberry Pi to the HDMI to VGA Converter via an HDMI cable.  Connect the LCD monitor to the HDMI to VGA converter via a VGA cable.  Connect a micro USB cable to the Raspberry Pi.  At this point, power can be applied to both the HDMI to VGA converter and the Raspberry Pi.  The Raspberry Pi should begin to boot and display information on the monitor.

We’ve had success with the devices listed, but substitutions may be used.  Be aware that non-powered HDMI to VGA converters and poor quality 5V USB power supplies proved troublesome in our initial Raspberry Pi digital photo frame prototypes.  For some VGA to HDMI converters, it may be necessary to edit the config.txt file on the SD card (located at /boot/config.txt) to manually set the resolution of the monitor and force HDMI mode.  This is done by un-commenting the hdmi_drive, hdmi_group, and hdmi_mode parameters accordingly for your specific application.

Step 3:  Get an IP address for the Raspberry Pi and Connect via SSH

After power is applied to the Raspberry Pi via the micro USB cable, it will boot automatically into a default state that includes SSH support.  Although the boot process can be seen on the monitor, since neither a keyboard nor mouse are connected to the Raspberry Pi, the only way to interface with it is via an SSH connection.  This requires an SSH client, such as the freely available Putty client.  Download it and run it on the host PC.

The only piece of information required to establish a connection via SSH with the Raspberry Pi is its IP address.  The can be obtained directly from the router it is connected to, or via other networking software.  There’s free apps for both iOS and Android that will poll a local network for the IP addresses of the devices connected to it.  Obtain the Raspberry Pi’s IP address on the network, and enter it into the Host Name field in the Putty SSH client.  The port number is 22 if it’s not there by default.

Putty SSH Client

Step 4:  Log into and Configure the Raspberry Pi

When connecting to the Raspberry Pi via an SSH client, a login prompt is presented.  The default username is “pi” and the default password is “raspberry”.  Enter these to gain access to the command prompt.  A Linux command prompt can be daunting for those unfamiliar with it, so we’ll provide the exact commands you’ll need to enter to configure the Raspberry Pi digital photo frame.

First, you’ll want to configure some basic aspects of the Raspberry Pi.  There’s a configuration menu built in that can be accessed by typing

 sudo raspi-config

at the command prompt.  Within this menu, select “Expand root partition to fill SD card”.  If the SD card onto which the Raspbian OS image file was written is larger than then the 2GB OS image file, this menu selection will automatically expand the usable partition on the SD card to be as large as the actual SD card in use.  So if you’re using an 8GB card, all 8GB will be available after initiating this command.

raspi-config menu

Next select the “Start desktop on boot” menu item, and enable it.  This will force the Raspberry Pi to boot into a desktop GUI environment rather than a command prompt similar to the one presented by the SSH client.  It’s from this GUI desktop environment that we’ll be launching the slideshow software that will present our images.

Finally, if there are any geographic specific settings such as timezone information, those can be established from this configuration menu.  After this initial configuration is complete, select “Finish” to save the settings and return to the command prompt.  Reboot the Raspberry Pi by typing

 sudo reboot

Step 5:  Establish the Raspberry Pi’s Wireless Network Connection

When the Raspberry Pi is finished booting, connect to it again via SSH (see step 4).  At the command prompt, type

sudo nano /etc/network/interfaces

The contents of this file should look like the following, where SSID and PASSWORD are replaced by the actual SSID and WPA key for the network into which the Raspberry Pi digital photo frame is being installed.  The quotes surrounding the SSID and PASSWORD must be included in the file.

 auto lo
 iface lo inet loopback
 iface eth0 inet dhcp
 auto wlan0
 allow-hotplug wlan0
 iface wlan0 inet dhcp
 wpa-ssid "SSID"
 wpa-psk "PASSWORD"

To exit the text editor and save the contents of the file, press <CTRL-X> and <S>.  At the command prompt, shutdown the Raspberry Pi by typing

 sudo shutdown -h now

Remove the Ethernet cable from the Raspberry Pi.  Restart the Raspberry Pi by unplugging the micro USB power cable and re-inserting it into the Raspberry Pi.  Confirm that the network’s wireless router has given the Raspberry Pi an IP address using the methods and tools described in step 3.  If the IP address is different than that used for the wired connection, update the IP address in the SSH client.

A dropped wireless connection can disconnect the Raspberry Pi from the network, making it unreachable via SSH.  To make the wireless connection persistent in the event of a brief network outage, we can add and execute a script that checks the wireless connection at short time intervals to confirm its health.  Begin by creating a file for the script by typing

sudo nano

from the home directory of the Raspberry Pi.  Type the following into the file, referenced from here.

while true ; do
   if ifconfig wlan0 | grep -q "inet addr:" ; then
      sleep 30
      echo "Network connection down! Attempting reconnection."
      ifup --force wlan0
      sleep 10

Hit <Ctrl-X> and <S> to save the file.  Next, make the file executable by typing

sudo chmod +x

at the command prompt.  Add this script to the /etc/rc.local file so that it auto-starts each time the Raspberry Pi boots.

sudo nano /etc/rc.local


/home/pi/ &

towards the end of the file.  Exit and save the rc.local file.  You can test the network persistence by monitoring the devices connected to the network before and after unplugging the router.  If all is functioning properly, the Raspberry Pi should reconnect to the network and obtain an IP address automatically.

Step 6:  Mount the Shared Network Folder Containing Photos

Log into the wirelessly connected Raspberry Pi via the SSH client.  The next step involves installing some software onto the Raspberry Pi.  Linux uses online repositories from which different programs can be installed – sort of like app stores.  The first thing to do is update the repository list by typing

 sudo apt-get update

at the command prompt.  The Raspberry Pi doesn’t include an SMB network sharing client by default, so one needs to be installed by typing

 sudo apt-get install smbclient

at the command prompt.  This installs the SMB client software.  After the installation process is complete, a local directory to which the shared network location is mapped needs to be created.  Type

 mkdir /home/pi/pics

to create a local directory.  Now we’re ready to use the installed SMB client to automatically map this location to a network folder containing the photos for the Raspberry Pi digital photo frame.  Type

 sudo nano /etc/rc.local

to bring up a text editor.  The “rc.local” file is sort of like the “autoexec.bat” used for old MS DOS PC’s.  Enter the following text on the line prior to the line containing “exit 0”, where NAME and PASSWORD are the login credentials for the shared network folder.  Additionally, the IP address and path of the network share is required.

 sudo mount -t cifs -o username=NAME,password=PASSWORD //---.---.---.---/SHAREPATH /home/pi/pics

Save the “rc.local” file and reboot the Raspberry Pi.  After the Raspberry Pi reboots, log into it via the SSH client and confirm that the network share location has been mounted by typing

 cd /home/pi/pics

The “cd” command changes the active local directory, and the “ls” command lists the files in that directory.  If the network share has mounted properly, a list of all the photo file names stored on the network share should display in the SSH client.

UPDATE:  In some Raspberry Pi digital photo frame builds, there have been reports of the network file location not mounting when the Raspberry Pi boots up.  While this method as described does often work properly, an alternative method is listed below.  If the alternative method is used, follow all the previous steps in section 6 except for adding the mount command to the /etc/rc.local file.

Open the fstab file by typing

sudo nano /etc/fstab

and adding the following command to the end of the file.

//---.---.---.---/SHAREPATH /home/pi/pics cifs username=NAME,password=PASSWORD,workgroup=YOURWORKGROUPNAME,users,auto,user_xattr 0 0

Type <CTRL-X> and <S> to save the file. You can either reboot the Rasbperry Pi or type “mount -a” to test whether mounting the shared location was successful.

UPDATE:  Several readers have inquired about an alternative setup for the digital picture frame that doesn’t retrieve pictures from a network share and instead reads pictures from a USB thumb drive connected to the Raspberry Pi.  If this use case is desired, simply add the following command to the fstab file in a similar fashion to that listed above.

/dev/sda1 /home/pi/pics vfat rw,defaults 0 0

Make sure your USB thumb drive is FAT formatted.  The USB drive can be mounted to any desired path, just make sure that the contents of the script developed below reflect the path of the files you want your picture frame to display.  NTFS and EXT formatting methods can be used, but the fstab entry above will need to reflect this.  Next, type the following at the command line.

sudo nano /etc/modprobe.d/raspi-blacklist.conf

Type the following into the contents of this file so that the Raspberry Pi doesn’t try to load the USB drive as a CD-ROM.

blacklist sr_mod

Save the contents of this file.  Now remove the USB wireless network adapter and reboot the Raspberry Pi.  The USB drive should automatically be mounted upon bootup.

Step 7:  Disable Any Screen savers or Power Saving Features

Unless the power saving settings are modified, the LCD screen will go blank after approximately 10 minutes on the Raspberry Pi digital photo frame.  To correct this, type

 sudo nano /etc/kbd/config

and search for the line containing “blank_time=” and set the “blank_time” parameter equal to 0.  Search for the line containing “powerdown_time=” and set the “powerdown_time” parameter equal to 0.  Make sure these lines don’t have an “#” in front of them, indicating that they are comments.  If there is an “#”, remove it so the parameters set are active.  Save the changes to the file and exit to return to the command prompt.

Next, type

 sudo nano /etc/lightdm/lightdm.conf

In this file, search for the “[Seat Default]” heading.  Add the following line under this heading.

 xserver-command=X -s 0 dpms

Save the contents of this file and exit to return to the command prompt.

Step 8:  Install the Photo Viewing Software and Setup a Slideshow Script

At the command prompt, type

 sudo apt-get install qiv

to install the QIV image viewer.  This is the program that displays the photos as a slideshow.  To automatically start the slideshow, a simple script must be written that is run each time the Raspberry Pi boots.  From the command prompt, type

 cd ~/.config
 mkdir autostart
 cd autostart
 sudo nano slideshow.desktop

This last command opens the familiar text editor to a blank file.  Enter the following content into the “slideshow.desktop” file and save the file when exiting the text editor.

 [Desktop Entry]

Next we’ll create the “” script that this autostart file references.  At the command prompt, type

 cd /home/pi
 sudo nano

Enter the following content into the “” file and save the file when exiting the text editor.

 #slideshow script
 sleep 15
 export DISPLAY=:0.0
 qiv -f -R -s -r -d 180 -t -i -m /home/pi/pics/*.[jJ][pP][gG]

It is important to note that the *.jpg extension is case sensitive, thus the bracketed expression in the wildcard statement above allows either capital or lowercase file extensions.

In the last line of the “” file, the 180 is the time in seconds that each picture will be displayed.  This can be any number to suit this Raspberry Pi digital photo frame builder’s preference.  Notice that the path referenced in the last line of the “” file is the local path that we earlier mapped to the shared network location in which the photos are stored.

After saving and exiting the “” file, type the following at the command prompt to make this script executable.

 sudo chmod +x /home/pi/

This will give the file the necessary permissions so that it can be run automatically when the Raspberry Pi boots.

Step 9:  Protect the SD Card from Corruption

Raspberry Pi SD cards are notorious for becoming corrupted from unplanned power failures and write errors, thus requiring re-installation of the operating system and software.  To help combat this, we can limit and actually disable how the filesystem swaps information to and from memory.  To do this, edit the file systems table by typing

sudo nano /etc/fstab

at the command prompt.  Change the default contents of this file to that listed below.

proc            /proc               proc    defaults                    0   0
/dev/mmcblk0p1  /boot               vfat    ro,noatime                  0   2
/dev/mmcblk0p2  /                   ext4    defaults,noatime            0   1
none            /var/run            tmpfs   size=1M,noatime             0   0
none            /var/log            tmpfs   size=1M,noatime             0   0

Save this file and exit to the command prompt. Now type the following commands at the command prompt.

sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove

Reboot the Raspberry Pi.  At this point it is a good idea to use the same Win32DiskImager flashing utility from Step 1 to create an image of the SD card you’ve setup for your Raspberry Pi Digital Photo Frame.  Simply insert the card into a card reader, select the device drive letter of the SD card, and choose “Read” to copy an image of the SD card onto your computer’s hard drive.  Now, in the event of an SD card failure or system corruption, the backup image can be loaded onto a spare SD card and installed into the Raspberry Pi, without the need for the lengthy setup process detailed in these instructions.


At this point, an automated slideshow of image files stored remotely on the network is displayed when the Raspberry Pi boots.  If the collection of photos needs to be changed, simply update the contents of the directory in which the photos are stored and reboot the Raspberry Pi digital photo frame.

We hope this TechClicker Clinic helps anyone wanting to create an inexpensive Raspberry Pi digital photo frame achieve their goal.  Questions and comments are welcome.