I've written disparate articles on related topics here, here and here but have never tried to put it all into one coherent guide, until now.
This guide assumes that you're going to do the initial part of the setup on a Mac running OS X. It also assumes you have a Raspberry Pi Model A and a USB monitor to drive your photo frame. I won't be covering any of the physical construction aspects of the photo frame, this is purely how to set up all the software, file sharing, etc.
The end result is something like this...
What you will need:
- Raspberry Pi
- USB Monitor
- SD Card (1Gb)
- 8Gb+ USB key
- USB Keyboard
Create a bootable SD Card
First download the following:
- ApplePi-Baker http://www.tweaking4all.com/hardware/raspberry-pi/macosx-apple-pi-baker/.
- Minibian-wifi https://sourceforge.net/projects/minibianwifi/.
Using ApplePi-Baker run the 'Restore Backup' for the Minibian-wifi image e.g. 2015-12-30-wheezy-minibian-wifi.img.
Eject the SD card, which now has the Minibian-wifi image, insert it into your Raspberry Pi, power on and let it boot up.
Everything that follows must be done on the RPi as the 'root' user...
Note1: Wherever you see file contents listed without further instructions, simply copy/paste what's shown into the file specified.
Note2: Wherever you see a 'Commands' listing, type those commands into the RPi as shown.
Network Setup
Update the /etc/wpa_supplicant/wpa_supplicant.conf file with your WiFi information, update network details to assign a static IP address similar to the following. A static IP is not necessary but useful for the future so you don't have to guess the IP address when connecting to the RPi.
Disk Partitioning and Resizing
Because SD cards are slow we will transfer the OS to a USB key.
Partition the USB key. Delete any old partitions first, then create a new primary partition.
Copy the file system from the SD card to a USB key.
Resize the file system to make use of all the extra space on the USB key.
Update fstab so that it reflects the new location of the OS.
Edit the /boot/cmdline.txt file and make sure the root option is set as this: root=/dev/sda1.
Restart the RPi.
Update the OS and Install Additional Software
We're going to need some additional software to compile the Kernel and also to get JPhotoFrame source code and build it.
Run Raspi-Config and do the following: Overclock to Turbo. Change time zone to your relevant setting. Restart the RPi.
Compile the Kernel
Because we're using a USB monitor and the default kernel build doesn't have this included we need to build this into the kernel. There are some good guides on how to do this here and here and I'm providing the condensed version of the commands to run below.
Check out the Kernel source.
Configure the Kernel.
Navigate to the following option: Device Drivers -> Graphics Support -> Frame buffer devices -> Displaylink USB Framebuffer support. Press 'Y' and save and exit.
Compile the Kernel.
Edit /boot/config.txt and add this line to the top of the file:
Configure the swap file
JPhotoFrame may need more memory than the RPi actually has (depending on the size of your photo library) so it's a good idea to configure some swap space.
Enable swap space.
Configure File Sharing
Create Photos directory (copy some photos to it later).
Configure AFP file sharing.
Put the following line at the bottom of /etc/netatalk/afpd.conf file, replacing any existing default.
Configure Samba file sharing.
Configure the host name.
Disable Power Management
Because this is a photo frame and it should be on most of the time, some of the built-in power management needs to be disabled.
Disable screen blanking. In /etc/kbd/config look for the following settings and set them to 0.
Set X server power management. In /etc/lightdm/lightdm.conf make sure that the xserver-command is set as follows:
Configure the 'pi' user and Automatic Login
Create the pi user.
Enable automatic login by running raspi-config.
Select Enable Boot to Desktop/Scratch > Desktop Log in as user 'pi' at the graphical desktop. Exit and optionally restart.
Everything that follows must be done as the 'pi' user...
Set up the Desktop Environment
Because this is a photo frame, we don't want the desktop to really be visible so most features need to be disabled and desktop icons removed. These are my configuration files for LXDE.
Make sure that mode is set to off.
Get and Compile JPhotoFrame
Now that the system is set up it's time to build the photo frame software itself.
Clone JPhotoFrame from GitHub
Edit jphotoframe.properties and set the jdk.home.1.7 property.
Build JPhotoFrame.
Set up a crontab
JPhotoFrame includes a script to turn the USB monitor on/off during certain hours of the day, this is done by scheduling an hour job as follows:
Auto-start JPhotoFrame
Now all that is left is to make sure that JPhotoFrame automatically starts when the RPi boots up. Create the following files to do so.
Make sure the script above is executable.
Copy Photos
Copy some photos over to the /photos directory or use file sharing to copy files to the RPi.
Enjoy!
That's it, the photo frame should be functional at this point so sit back and enjoy (it's probably taken you 2 or 3 days to get to this point!).
-i