How to configure the software for your digital picture frame in 60 minutes 2

How to configure the software for your digital picture frame in 60 minutes

In this article, I will describe in detail how to set up your Raspberry Pi as a platform for your digital picture frame.

To follow my instructions, you do not need any knowledge of the Raspberry Pi or Linux.

At the end of this post, you will have Raspberry Pi OS installed, your file sharing, and WiFi connection working, Pi3d as your image viewer installed, and have everything start at boot automatically. All the software you need for a digital picture frame.

Required hardware

You need four parts at this stage:

A Raspberry Pi 4 Model B minicomputer

This model was launched in June 2019 and is ideal for a digital picture frame.

The most significant advantage of the Pi 4 compared to previous models is that this board comes with 4K HDMI output, up to 8 GB in memory, and USB 3.0.

How to configure the software for your digital picture frame in 60 minutes 3
The Raspberry Pi 4 Model B

In the past, I have also built digital picture frames with the Raspberry Pi 3 Model B+ and the Pi 2 Model B, and it worked just as well. The difference that I like about the Pi4 is the 4K HDMI output.

As the latest Raspberry Pi 4 Model B is affordable, I would recommend getting this model unless you have an older one lying around.

A case for your Raspberry Pi

When you shop for your Raspberry Pi, you will be no doubt prompted to a selection of cases.

Make sure that you get one that is compatible with the Raspberry Pi 4. Although the outer physical dimensions between the Models 4 and 3 have not changed, USB and Ethernet port have changed place.

You do not need a fancy case, nor a case with a heatsink. Running the digital picture frame application will not cause your computer to become overly hot. Mine is usually running at 65 °C (149 °F), which is a perfectly fine operating temperature for the Raspberry Pi.

What you should watch out for is that you can easily take out your Raspberry Pi from its case even when you have glued the case to the back of the monitor; this is crucial should you need to change the SD card at one point.

My preferred choice is this official Raspberry Pi 4 case in raspberry/white color or in black/grey. They are easy to handle, very slim, and a good bargain.

A micro SD card

The critical thing to consider when you shop for a micro SD card is not the speed but durability.

Speed is vital for an SD card in a high-performance camera where you want to write new images to the card quickly; it is not so crucial for a digital picture frame use case.

But unlike a camera, a digital picture frame is typically powered on 24 hours a day. It will execute many read/write cycles, and this is what will determine the life expectancy. There are special Endurance SD cards that allow for many read/write cycles, which makes your card a lot more reliable.

Also, the GB size will help to improve the reliability of your SD card. If your SD is always close to maximum capacity, there is a higher degree of wear of the memory sectors as there is less free space available.

Although you only need about 1.5 GB of space for about 1,000 images (formatted at 1920 x 1200 px in highest jpg quality) in your folder plus about 4 GB for the operating system and other applications, I would recommend picking a 32 GB microSD card.

They are only a little bit more expensive than a 16 GB card but will give you peace of mind over the lifetime of your digital picture frame.

I have had good experiences with High Endurance Cards made by Sandisk (32 GB High Endurance). Still, I am sure that other quality manufacturers like Samsung (32 GB, PRO Endurance) and Transcend (32 GB, High Endurance) are just as good.

Note: Make sure you buy a micro SD card, not the regular SD cards that you use for cameras. The micro SD card will come with an adapter so that you can use it in a standard SD card reader, which is essential for the installation of the operating system. For the Raspberry Pi, you won’t need the adapter anymore.

A power supply

Two things that are important here: Enough power and a slim form factor that fits nicely behind the screen.

Let’s start with power: The Raspberry Pi 4 Model B requires a power supply of 5 V and a minimum of 3A. Don’t get a weaker one than 3A. You may end up with all kinds of issues that seem unexplainable, but in the end, it’s because of a power supply that is not up to the task.

The slim form factor is crucial because we must always keep in mind that there isn’t too much space behind the monitor and the wall. So pick one which has enough power but it still small.

This is all the hardware that we need for the minicomputer powering your digital picture frame. I will assume that you have access to a regular desktop or laptop computer with either Microsoft Windows, macOS, or Linux, including an SD card slot or external reader.

Software installation – The basic stuff

Installation of Raspberry Pi OS

Now that we have all the hardware components together, let’s breathe some life into these electronics. You will need about one hour for these steps if you are doing it for the first time, and not even 15 minutes if you have done it before.

It used to be that you had to download the Raspberry Pi OS image and a separate software utility for flashing it onto the SD-card but since the arrival of the Raspberry Pi Imager for Windows, macOS, and Ubuntu in March 2020, this process has gotten even easier.

Download the Raspberry Pi Imager for the operating system of your regular computer and install it.

The Raspberry Pi Imager is a little software package that has one purpose: To flash a number of possible operating systems to an SD-card, the most prominent being, of course, the Raspberry Pi OS in the “32 bit with desktop” version. This is the middle version, there is a light and a full one, but the middle version is exactly what we need for our digital picture frame project.

Start the app and insert a micro SD card with the adapter into your card reader. Click on “Choose OS” and select the first option “Raspberry Pi OS (32-bit)”. Choose your SD card, and click on “WRITE”. It will now write first and then validate it.

How to configure the software for your digital picture frame in 60 minutes 4
The Raspberry Pi Imager

When Raspberry Pi Imager finishes, your SD card will be unmounted (“soft eject”). Take out your SD adapter from your card reader and reinsert it again. This way, it will be mounted again.

By the way, the Raspberry Pi Imager always loads the most up to date version of the Raspberry Pi OS without having the update the app.

Adding the information about your WiFi network

Launch the Terminal application that comes with your operating system.

Enter

cd /Volumes/boot && touch ssh && nano wpa_supplicant.conf

An editor will open. Copy the following text and paste it into the editor window.

Enter your country code, your correct SSID (WiFi station name) and your password.

The Country Code is the ISO/IEC alpha2 code for the country in which you are using your Raspberry Pi. Examples are

  • US (United States)
  • GB (United Kingdom)
  • DE (Germany)
  • 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 content and CTRL-X to exit the editor. Close the Terminal app and eject your SD card.

Starting up the Raspberry Pi for the first time

Take the microSD card out of the adapter and insert it in the Raspberry Pi like this:

How to configure the software for your digital picture frame in 60 minutes 5
Inserting the SD-card the right way

Connect the power supply to the Raspberry Pi; it will boot up automatically. There is no on/off switch on a Raspberry Pi. You do not need to connect your display monitor to the Raspberry Pi at this stage.

Finding the IP address of your Raspberry Pi on your WiFi network

When your Raspberry Pi connects to your WiFi network, your router will give it an IP number. We need this IP number to access it remotely.

Look up the list of connected clients in your router settings and find “raspberrypi.” Next to it should be an IP number like this:

How to configure the software for your digital picture frame in 60 minutes 6

Open Terminal again and connect to your Raspberry Pi with the IP number that you found (example: pi@192.168.178.46):

ssh pi@your-ip-address

Enter the default password “raspberry” (without brackets)

You have now connected to your Raspberry Pi. Next, let’s do some housework.

Installing system updates and basic configuration

It is always a good idea to run a system update on a fresh system.

In Terminal enter

sudo apt update && sudo apt upgrade -y

This will take some time.

Once this is finished, open the configuration utility.

sudo raspi-config

Make the following changes:

  • Under 1: Change User Password
  • Under 2: Network Options – N1: Hostname: Change to the name that you want to for Raspberry Pi on the network. The default setting is “RaspberryPi”. Feel free to change it to whatever you like.
  • Under 3: Boot Options – B1 Desktop/CLI: Choose B2 Console Autologin
  • Under 3: Boot Options: Wait for Network at Boot: Yes
  • Under 4: Localisation Options: Choose I2 and set your timezone.

Go Back and finish. It will ask you to reboot.

Wait two minutes for the reboot and connect again to the Raspberry Pi with

ssh pi@your-ip-address

Installing network settings

We are now installing a file-sharing software that works for Microsoft Windows, Mac, and Linux machines using the SMB (SAMBA) network protocol. This allows you to access your Raspberry Pi on your network to add images and program files easily remotely.

In Terminal enter

sudo apt install samba -y

When this window comes up, choose “No”.

How to configure the software for your digital picture frame in 60 minutes 7

Now, install a user

sudo smbpasswd -a pi

(where “pi” is your username, feel free to change it as you like)

Set a password and confirm it. Don’t forget your password!

We need to make a change in the SAMBA config file.

sudo nano /etc/samba/smb.conf

Scroll down to the last section called “===Share Definitions===”

Replace the section called [homes], i.e. delete all the lines of the [homes] section with CTRL+K until you get to the next section [netlogon] and paste this code instead:

[pi]
comment = Pi
path = /home/pi
browseable = yes
read only = no
guest ok = no
create mask = 0700
directory mask = 0700

If you are a macOS user, you may find the following lines quite useful to show a nice sidebar symbol for the Raspberry Pi and add some tweaks for use in Mac networks. Scroll up in the conf file and add under [global]:

[global]
min protocol = SMB2
vfs objects = catia fruit streams_xattr
fruit:metadata = stream
fruit:model = RackMac
fruit:posix_rename = yes
fruit:veto_appledouble = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes

Hit CTRL + O to write the file to disk and then CTRL + X to exit the editor.

If you have any troubles with the Samba configuration, please have a look at my more detailed article here.

Finally, restart SAMBA:

sudo /etc/init.d/smbd restart

You should now see the name of your Raspberry Pi in your network. Connect to it using your username “pi” (in our example) and your password.

Whenever you reboot your Raspberry Pi, file sharing will automatically start.

Note: If you have a problem editing the SAMBA config file, have a look at this article which includes an entire, albeit minimum config file that you can just copy and paste.

Stop the screen from going blank

By default, the screen will go blank when there is no keyboard or mouse movement detected. As we don’t even have a keyboard or a mouse for the Raspberry Pi, this would be awkward.

So let’s disable the automatic screen saver.

In Terminal enter

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

After the editor opens, change the content 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 editor.

Disable Overscan

If the display on your screen is not completely filled but instead shows a black border, you will need to disable Overscan.

Enter

sudo raspi-config nonint do_overscan 1

Installing the image viewer software

Now we’ll install the software to show your photos.

First, add some images into the Pictures/your-folder directory for testing purposes.

If you have the chance to crop and size your photos according to your screen, you should do that. If you are using Adobe Lightroom making an export with the appropriate settings is easy enough. If you don’t have this possibility, don’t worry, the software will adjust your images automatically. The reason, I like to do it manually in Lightroom is that I can crop the image as I want it.

In this article, I have discussed three different image viewer software solutions. In this tutorial, I will explain how to install my preferred one, which is Pi3D.

Pi3D offers very smooth crossfading image transitions which not only look spectacular but create a certain kind of suspense during the transition. It fully exploits the graphics processor unit (GPU) of the Raspberry Pi to create these effects.

Pi3D is explained in several articles on this blog, just enter “Pi3D” in the search field.

Given the difference in GPU between the various Raspberry Pi model, the installation is slightly different but not complicated at all.

The Pi Zero in principle also works with Pi3D, but I found that it becomes very unstable as soon as you have other applications running at the same time due to its memory limitations.

On a Raspberry Pi 2 and 3

Enter in terminal:

sudo raspi-config nonint do_boot_behaviour B4 && sudo raspi-config nonint do_memory_split 128 && sudo raspi-config 

In the raspi-config module, go to 7 Advanced Options > A8 GL Driver > Choose G1 (Legacy)

Reboot and enter:

sudo pip3 install pi3d && wget https://github.com/pi3d/pi3d_demos/archive/master.zip && unzip master.zip && rm master.zip && mv pi3d_demos-master pi3d_demos

You can test the program by entering (make sure you now have a monitor connected to your Raspberry Pi):

cd /home/pi/pi3d_demos && python3 Earth.py

If you see a rotating globe, your installation has been successful. If not, check your settings.

Hit “CTRL+C” to stop the globe.

On a Raspberry Pi 4

Enter in terminal:

sudo raspi-config nonint do_boot_behaviour B2 && sudo raspi-config nonint do_memory_split 256 && sudo raspi-config

In the raspi-config module, go to 7 Advanced Options > A8 GL Driver > Choose G2 GL Fake KMS.

Reboot and enter:

sudo pip3 install pi3d && wget https://github.com/pi3d/pi3d_demos/archive/master.zip && unzip master.zip && rm master.zip && mv pi3d_demos-master pi3d_demos

You can test the program by entering (make sure you now have a monitor connected to your Raspberry Pi):

cd /home/pi/pi3d_demos && sudo xinit /usr/bin/python3 /home/pi/pi3d_demos/Earth.py :0 -- -s off -dpms -s noblank

If you see a rotating globe, your installation has been successful. If not, check your settings.

Hit “CTRL+C” to stop the globe.

Configuring Pi3D

Pi3D has many options that you can specify in the PictureFrame2020config.py file in the /home/pi/pi3d_demos directory.

The default settings will work fine to get you started but you should open this file with a text editor now or later and customize it. You can find the parameters explained in this article.

Autostarting the Pi3D image viewer at boot

Last, we want to make sure that your photos start automatically when you turn on your Raspberry Pi.

We will use the systemd services to manage the Pi3D script at boot. There is again a slight variation for the Raspberry models.

For the Raspberry Pi 2 and 3

Create a new service file

sudo nano /etc/systemd/system/pi3donpi3.service

and paste the following text into the file

[Unit]
Description=Pi3D on Pi3
After=multi-user.target

[Service]
Type=idle

User=pi
ExecStart=/usr/bin/python3 /home/pi/pi3d_demos/PictureFrame2020.py

Restart=always

[Install]
WantedBy=multi-user.target

Save with CTRL+O and close with CTRL+X.

Now, we need to change the file permissions to make it readable by all by typing

sudo chmod 644 /etc/systemd/system/pi3donpi3.service

As the last step, you need to tell the system that you have added this file and want to enable this service so that it starts at boot.

sudo systemctl daemon-reload
sudo systemctl enable pi3donpi3.service

Reboot your Pi, and you are all set!

For the Raspberry Pi 4

Create a new service file

sudo nano /etc/systemd/system/pi3donpi4.service

and paste the following text into the file:

[Unit]
Description=Pi3D on Pi4
After=multi-user.target

[Service]
Type=idle

User=root
ExecStart=xinit /usr/bin/python3 /home/pi/pi3d_demos/PictureFrame2020.py -- -s off -dpms -s noblank

Restart=always

[Install]
WantedBy=multi-user.target

Save with CTRL+O and close with CTRL+X.

Now, we need to change the file permissions to make it readable by all by typing

sudo chmod 644 /etc/systemd/system/pi3donpi4.service

As the last step, you need to tell the system that you have added this file and want to enable this service so that it starts at boot.

sudo systemctl daemon-reload
sudo systemctl enable pi3donpi4.service

Reboot your Pi, and you are all set!

Conclusion

Congratulations! You have successfully set up your Raspberry Pi as a platform for your digital picture frame.

There are many more additions that you can choose to install. Just browse the “Building a digital frame” menu item and discover image management solutions, integration options in your Home Automation settings, voice control, and many hacks & tweaks.

Are you missing something? Let me know!

Was this post helpful?

Scroll to Top