How to con­fig­ure the soft­ware for your dig­i­tal pic­ture frame in 60 min­utes

-

In this arti­cle, I will describe in detail how to set up your Rasp­berry Pi as a plat­form for your dig­i­tal pic­ture frame.

To fol­low my instruc­tions, you do not need any knowl­edge of the Rasp­berry Pi or Lin­ux. Also, you do not require a com­put­er mon­i­tor, a key­board or a mouse con­nect­ed to your Rasp­berry Pi.

At the end of this post, you will have the oper­at­ing sys­tem Rasp­bian Buster installed on your Rasp­berry Pi, your file shar­ing and WiFi con­nec­tion work­ing and a few oth­er use­ful things are tak­en care of.

Required hard­ware

You need four parts at this stage:

A Rasp­berry Pi 4 Mod­el B mini­com­put­er

This mod­el was launched in June 2019 and is ide­al for a dig­i­tal pic­ture frame.

The most sig­nif­i­cant advan­tage com­pared to pre­vi­ous mod­els is that this board comes with 4K HDMI out­put, up to 4 GB in mem­o­ry and USB 3.0.

The Rasp­berry Pi 4 Mod­el B

In the past, I have also built dig­i­tal pic­ture frames with the Rasp­berry Pi 3 Mod­el B+ and the Pi 2 Mod­el B, and it worked just as well. The dif­fer­ence that I like about the Pi4 is the 4K HDMI out­put.

As the lat­est Rasp­berry Pi 4 Mod­el B is real­ly afford­able, I would rec­om­mend get­ting this mod­el even if you have an old one lying around.

A Case for your Rasp­berry Pi

When you shop for your Rasp­berry Pi, you will be no doubt prompt­ed to a selec­tion of cas­es.

Make sure that you get one that is com­pat­i­ble with the Rasp­berry Pi 4. Although the out­er phys­i­cal dimen­sions between the Mod­els 4 and 3 have not changed, USB and Eth­er­net port have changed place.

You do not need a fan­cy case, nor a case with a heatsink. Run­ning the dig­i­tal pic­ture frame appli­ca­tion will not cause your com­put­er to become over­ly hot, mine is usu­al­ly run­ning at 65 °C (149 °F) which is a per­fect­ly fine oper­at­ing tem­per­a­ture for the Rasp­berry Pi.

What you should watch out for is that you can eas­i­ly take out your Rasp­berry Pi from its case even when you have glued the case to the back of the mon­i­tor; this is cru­cial should you need to change the SD card at one point.

My pre­ferred choice is this offi­cial Rasp­berry Pi 4 case in raspberry/white col­or or in black/grey. They are easy to han­dle, very slim and a good bar­gain.

A micro SD card

The crit­i­cal thing to con­sid­er when you shop for a micro SD card is not the speed but dura­bil­i­ty.

Speed is vital for an SD card in a high-per­­for­­mance cam­era where you want to write new images to the card quick­ly; it is not so impor­tant for a dig­i­tal pic­ture frame use case.

But unlike a cam­era, a dig­i­tal pic­ture frame is typ­i­cal­ly pow­ered on 24 hours a day and will exe­cute many read/write cycles, and this is what will deter­mine the life expectan­cy. There are spe­cial Endurance SD cards that allow for many read/write cycles which makes your card a lot more reli­able.

Also, the GB size will help to improve the reli­a­bil­i­ty of your SD card. If your SD is always close to max­i­mum capac­i­ty, there is a high­er degree of wear of the mem­o­ry sec­tors as there is less free space avail­able.

Although you only need about 1.5 GB of space for about 1,000 images (for­mat­ted at 1920 x 1200 px in high­est jpg qual­i­ty) in your fold­er plus about 4 GB for the oper­at­ing sys­tem and oth­er appli­ca­tions, I would rec­om­mend pick­ing a 32 GB microSD card.

They are only a lit­tle bit more expen­sive than a 16 GB card but will give you peace of mind over the life­time of your dig­i­tal pic­ture frame.

I have had good expe­ri­ences with High Endurance Cards made by San­disk (32 GB High Endurance), but I am sure that oth­er qual­i­ty man­u­fac­tur­ers like Sam­sung (32 GB, PRO Endurance) and Tran­scend (32 GB, High Endurance) are just as good.

Note: Make sure you buy a micro SD card, not the reg­u­lar SD cards that you use for cam­eras. The micro SD card will come with an adapter so that you can use it in a stan­dard SD card read­er which is essen­tial for the instal­la­tion of the oper­at­ing sys­tem. For the Rasp­berry Pi, you won't need the adapter any­more.

A pow­er sup­ply

Two things that are impor­tant here: Enough pow­er and a slim form fac­tor that fits nice­ly behind the screen.

Let's start with pow­er: The Rasp­berry Pi 4 Mod­el B requires a pow­er sup­ply of 5 V and a min­i­mum of 3A. Don't get a weak­er one than 3A. You may end up with all kinds of issues that seem unex­plain­able, but in the end, it's because of a pow­er sup­ply that is not up to the task.

The slim form fac­tor is cru­cial because we must always keep in mind that there isn't too much space behind the mon­i­tor and the wall. So pick one which has enough pow­er but it still small.

This is all the hard­ware that we need for the mini­com­put­er pow­er­ing your dig­i­tal pic­ture frame. I will assume that you have access to a reg­u­lar desk­top or lap­top com­put­er with either Microsoft Win­dows, macOS or Lin­ux includ­ing an SD card slot or exter­nal read­er.

Instal­la­tion of Rasp­bian Buster

Now that we have all the hard­ware com­po­nents togeth­er let's breathe some life into these elec­tron­ics. You will need about one hour for these steps if you are doing it for the first time.

The Rasp­berry Pi runs on many oper­at­ing sys­tems like sev­er­al Lin­ux dialects, but also a vari­ant of Microsoft Win­dows 10 (IoT Core).

For the dig­i­tal pic­ture frame, we will use Rasp­bian, the offi­cial oper­at­ing sys­tem for all mod­els of the Rasp­berry Pi. It's free to use and easy to install.

Use your reg­u­lar desktop/laptop com­put­er for the fol­low­ing steps:

Down­load the Rasp­berry Pi oper­at­ing sys­tem

Go to https://www.raspberrypi.org/downloads/ and click on Rasp­bian.

You will see three vari­ants; find "Rasp­bian Buster with desk­top" and "Down­load ZIP."

All you need is Rasp­bian Buster

The ZIP file is about 1 GB in size, so depend­ing on your inter­net con­nec­tion, enjoy a cup of cof­fee while you wait.

Unzip the file.

Down­load Etch­er

Go to https://www.balena.io/etcher/, down­load and install the Etch­er 64-bit installer for your oper­at­ing sys­tem. Etch­er (also known as "bale­naEtch­er") is a soft­ware util­i­ty to flash the Rasp­bian image which you just down­loaded to your SD card.

Put your micro SD card in the SD card adapter (unless you have a micro SD card read­er; in this case, you don't need the adapter).

Flash image onto the micro SD card

Launch Etch­er, select the image, point to your SD card and hit "Flash."; this takes about 3 min­utes.

Fun­ni­ly enough, at the time of my record­ing, Etch­er was adver­tis­ing a dig­i­tal pic­ture frame as an ide­al appli­ca­tion for a Rasp­berry Pi. I couldn't agree more. (You will find the best instruc­tions on this web­site!)

When Etch­er fin­ish­es, your SD card will be unmount­ed ("soft eject"). Take out your SD adapter from your card read­er and rein­sert it. This way, it will be mount­ed again.

Adding the infor­ma­tion about your WiFi net­work

In macOS or Lin­ux, launch the Ter­mi­nal appli­ca­tion that comes with your oper­at­ing sys­tem. For Microsoft Win­dows, you will have to down­load and install the free PuT­TY app (or use the new Microsoft Ter­mi­nal app.)

Here are the steps using the Ter­mi­nal app on a Mac or Lin­ux com­put­er. For Microsoft Win­dows and PuT­TY, it should work in the same way.

cd /Volumes/boot
touch ssh
nano wpa_supplicant.conf

An edi­tor will open. Copy the fol­low­ing text and paste it into the edi­tor win­dow.

Enter your coun­try code, your cor­rect SSID (WiFi sta­tion name) and your pass­word.

The Coun­try Code is the ISO/IEC alpha2 code for the coun­try in which you are using your Rasp­berry Pi. Exam­ples are

  • US (Unit­ed States)
  • GB (Unit­ed King­dom)
  • DE (Ger­many)
  • FR (France)

You will find the full list under the link above.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="yourssid"
psk="yourpassword"
key_mgmt=WPA-PSK
}

Press CTRL-O to save the con­tent and CTRL-X to exit the edi­tor. Close the Ter­mi­nal app and eject your SD card.

Start­ing up the Rasp­berry Pi for the first time

Take the microSD card out of the adapter and insert it in the Rasp­berry Pi like this:

This is what it looks like

Con­nect the pow­er sup­ply to the Rasp­berry Pi; it will boot up auto­mat­i­cal­ly. There is no on/off switch on a Rasp­berry Pi. You do not con­nect need to con­nect your dis­play mon­i­tor to the Rasp­berry Pi at this stage.

Find­ing the IP address of your Rasp­berry Pi on your WiFi net­work

When your Rasp­berry Pi con­nects to your WiFi net­work, your router will give it an IP num­ber. We need this IP num­ber to access it remote­ly.

Look up the list of con­nect­ed clients in your router set­tings and find "rasp­ber­rypi." Next to it should be an IP num­ber like this:

Open Ter­mi­nal again (for Microsoft Win­dows use Put­ty) and con­nect to your Rasp­berry Pi with the IP num­ber that you found (exam­ple: pi@192.168.178.46):

ssh pi@your-ip-address

Enter the default pass­word "rasp­berry" (with­out brack­ets)

You have now con­nect­ed to your Rasp­berry Pi. Next, let's do some house­work.

Installing sys­tem updates and basic con­fig­u­ra­tion

It is always a good idea to run a sys­tem update on a fresh sys­tem.

In Ter­mi­nal enter

sudo apt update && sudo apt upgrade -y

This will take some time.

Once this is fin­ished, open the con­fig­u­ra­tion util­i­ty

sudo raspi-config

Make the fol­low­ing changes:

  • Under 1: Change User Pass­word
  • Under 2: Net­work Options - N1: Host­name: Change to the name that you want to for Rasp­berry Pi on the net­work. The default set­ting is "Rasp­ber­ryPi". Feel free to change it to what­ev­er you like.
  • Under 3: Boot Options - B1 Desktop/CLI: Choose B2 Con­sole Autolo­gin
  • Under 3: Boot Options: Wait for Net­work at Boot: Yes
  • Under 4: Local­i­sa­tion Options: Choose I2 and set your time­zone.

Go Back and fin­ish. It will ask you to reboot.

Wait two min­utes for the reboot and con­nect again to the Rasp­berry Pi with

ssh pi@your-ip-address

Installing net­work set­tings

We are now installing a file-shar­ing soft­ware that works for Microsoft Win­dows, Mac and Lin­ux machines using the SMB (SAMBA) net­work pro­to­col. This allows you to access your Rasp­berry Pi on your net­work to add images and pro­gram files eas­i­ly remote­ly.

In Ter­mi­nal enter

sudo apt install samba -y

When this win­dow comes up, choose "No".

Now, install a user

sudo smbpasswd -a pi

(where "pi" is your user­name, feel free to change it as you like)

Set a pass­word and con­firm it. Don't for­get your pass­word!

We need to make a change in the SAMBA con­fig file

sudo nano /etc/samba/smb.conf

Scroll down to the last sec­tion called "===Share Def­i­n­i­tions==="

In the first sec­tion called "homes" make the fol­low­ing three changes ("no", "0777", "0777"):

By default, the home directories are exported read-only. Change the
\# next parameter to 'no' if you want to be able to write to them.
read only = no
\# File creation mask is set to 0700 for security reasons. If you want to
\# create files with group=rw permissions, set next parameter to 0775.
create mask = 0777
\# Directory creation mask is set to 0700 for security reasons. If you want to
\# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0777

Hit CTRL + O to write the file to disk and then CTRL + X to exit the edi­tor.

Final­ly, restart SAMBA:

sudo /etc/init.d/smbd restart

You should now see the name of your Rasp­berry Pi in your net­work. Con­nect to it using your user­name "pi" (in our exam­ple) and your pass­word.

When­ev­er you reboot your Rasp­berry Pi, file shar­ing will auto­mat­i­cal­ly start.

Stop the screen from going blank

By default, the screen will go blank when there is no key­board or mouse move­ment detect­ed. As we don't even have a key­board or a mouse for the Rasp­berry Pi, this would be awk­ward.

So let's dis­able the auto­mat­ic screen saver.

In Ter­mi­nal enter

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

After the edi­tor opens, change the con­tent to this:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xset s off
@xset -dpms
@xset s noblank

Hit CTRL + O to write the file to disk and then CTRL + X to exit the edi­tor.

Con­clu­sion

Con­grat­u­la­tions! You have suc­cess­ful­ly set up your Rasp­berry Pi as a plat­form for your dig­i­tal pic­ture frame.

Now read the arti­cle "How I added cross­fad­ing slide tran­si­tions to my dig­i­tal pic­ture frame using Pi3D" to install the slide show soft­ware and you're done!