User Tools

Site Tools


info:rpi_frame

Raspberry Pi picture frame

In this article, we're building a picture frame using a Raspberry Pi and a regular screen.

Requirements

  • A Raspberry Pi, for example a 1B.
  • SD card
  • Network access
  • Network share for the images (e.g. NFS)

Installation

  1. Install Raspian Lite on the SD card.
  2. Edit /etc/fstab to mount the network share. Skip this step if using a local directory.
    host:/export/media /export/media  nfs4     auto            0       0

    Replace host:/export/media with your host and export name. See x.antiguru.de for NFS exports.

  3. Crate a script picframe.sh in /home/pi. Update myfolder to point to the correct location.
    #!/bin/bash
    myfolder="/export/media/picframe"
    if [ -d "$myfolder" ]; then
     if [ $(tty) == /dev/tty1 ]; then
       find -L "$myfolder" -name *.jpg -type f -print |shuf  > /home/pi/pic1.list
       while [ true ]
       do
         # check if network share still exists
         if [ ! -d "$myfolder" ]; then
           exit 1
         fi
         find -L "$myfolder" -name *.jpg -type f -print |shuf  > /home/pi/pic2.list &
         fbi -a -t 90 --noverbose --noreadahead --list /home/pi/pic1.list
         # this is a hack so after fbi crashes (which it will) the same list isn't
         # shown again from the start
         # check if network share still exists
         if [ ! -d "$myfolder" ]; then
           exit 1
         fi
         find -L "$myfolder" -name "*.jpg" -type f -print |shuf  > /home/pi/pic1.list &
         fbi -a -t 90 --noverbose --noreadahead --list /home/pi/pic2.list
       done
     fi
    fi
    exit 0
  4. Make the script runnable: chmod u+x picframe.sh
  5. Now boot the pi from the SD card.
  6. Install fbi: sudo apt update, sudo apt upgrade, sudo apt install fbi
  7. Configure auto login: sudo raspi-config
  8. Append ~/picframe.sh to /home/pi/.bashrc
  9. Configure read-only overlay fs: sudo raspi-config
info/rpi_frame.txt · Last modified: 2020/06/28 11:07 by moritz

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki