Skip to content

Repository files navigation

PhotoFrame

Digital Photo Frame for Raspberry Pi

Requirements:

  • fbi - framebuffer image viewer
  • gawk - gnu awk processor (plain awk does not work)
  • nginx - webserver for display of today's list of images (optional)

Installation

  1. Install default Raspberry Pi OS (although other linux should work with minimal adjustments)
  2. Comment out the line "dtoverlay=vc4-kms-v3d" in /boot/firmware/config.txt and reboot (see notes about turning monitor on/off)
  3. Install git and dependencies: apt install git fbi gawk nginx
  4. Clone this repo: git clone https://github.com/scottgilbertp/PhotoFrame.git
  5. Make your photos accessible on the pi's filesystem (by copying, or NFS mount, or USB drive, etc)
  6. Edit the photo_frame.conf file to meet your needs. In particular, you will probably need to adjust PHOTODIR, and maybe START_TIME and STOP_TIME
  7. Edit the photo_frame.service file, changing the file paths to match the location on your pi
  8. Copy the photo_frame.service file where systemd expects it: cp photo_frame.service /etc/systemd/system/
  9. Tell systemd to read the new photo_frame.service file: systemctl daemon-reload
  10. Start and enable the service: systemctl enable --now photo_frame.service

Files:

  • photo_frame.conf - config file
  • photo_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 service
  • photo_frame_service.sh - script which runs as the service. Loops forever, turning display on and off
  • README.md - the file you are reading now
  • BUGS.txt - documents known flaws and limitations

Notes:

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.

About

Digital Photo Frame for Raspberry Pi

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages