Digital Photo Frame for Raspberry Pi
- fbi - framebuffer image viewer
- gawk - gnu awk processor (plain awk does not work)
- nginx - webserver for display of today's list of images (optional)
- Install default Raspberry Pi OS (although other linux should work with minimal adjustments)
- Comment out the line "dtoverlay=vc4-kms-v3d" in /boot/firmware/config.txt and reboot (see notes about turning monitor on/off)
- Install git and dependencies:
apt install git fbi gawk nginx - Clone this repo:
git clone https://github.com/scottgilbertp/PhotoFrame.git - Make your photos accessible on the pi's filesystem (by copying, or NFS mount, or USB drive, etc)
- Edit the photo_frame.conf file to meet your needs. In particular, you will probably need to adjust
PHOTODIR, and maybeSTART_TIMEandSTOP_TIME - Edit the photo_frame.service file, changing the file paths to match the location on your pi
- Copy the photo_frame.service file where systemd expects it:
cp photo_frame.service /etc/systemd/system/ - Tell systemd to read the new photo_frame.service file:
systemctl daemon-reload - Start and enable the service:
systemctl enable --now photo_frame.service
photo_frame.conf- config filephoto_frame_start.sh- script to turn on display, select images and start displaying them. (normally executed by photo_frame_service.sh)photo_frame_stop.sh- script to stop displaying images and turn off display (normally executed by photo_frame_service.sh)photo_frame_excludes.txt- list of filepath globs to never show (may include comments preceeded with a "#")photo_frame.service- systemd unit file, defining the photo_frame servicephoto_frame_service.sh- script which runs as the service. Loops forever, turning display on and offREADME.md- the file you are reading nowBUGS.txt- documents known flaws and limitations
Photo selection is done in 4 stages (see photo_frame.conf for parameters to control each stage):
- "recent" photos are selected (photos taken within the last few days)
- "anniversary" photos are selected. (anniversary photos are those taken around this same date in previous years)
- "random" photos are selected to reach the desired total number of photos for the day
- Duplicate photos are removed, and the results are displayed in random order
The photo_frame_start.sh script selects a list of photos and displays them. It also, optionally generates a simple text list of the selected photos. In the default config, the filename contains the "day of month", so only one month's of list files are kept - with older ones being overwritten by newer ones. Optionally, an html version of the list of photos may also be produced, made available by any webserver. In the default config, this is a simple "index.html" file, which gets overwritten each day.
I run this as the root user. IF you prefer to run it as an unpriviged user, that user will need write access to the framebuffer device (/dev/fb0), as well as any directory where the "todays list" files are to be written, and of course, read-access to the photos to be displayed.
The script currently uses the vcgencmd command to turn the monitor on/off. Prior to bookworm, it used tvservice. Currently, this requires that the line "dtoverlay=vc4-kms-v3d" in /boot/firmware/config.txt be commented out (followed by a reboot). The ability to turn the monitor on/off seems to be a constantly moving target, depending on the specific monitor, and requiring changes now and then as Pi OS evolves. I'm open to suggestions for a more universal and stable way of handling this.
There are a few things that are not ideal. See the BUGS.txt file for known defects and limitations.