====== 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 =====
- Install [[https://www.raspberrypi.org/downloads/raspberry-pi-os/|Raspian Lite]] on the SD card.
- 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 [[infra:x.antiguru.de|x.antiguru.de]] for NFS exports.
- 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
- Make the script runnable: ''chmod u+x picframe.sh''
- Now boot the pi from the SD card.
- Install ''fbi'': ''sudo apt update'', ''sudo apt upgrade'', ''sudo apt install fbi''
- Configure auto login: ''sudo raspi-config''
- Append ''~/picframe.sh'' to ''/home/pi/.bashrc''
- Configure read-only overlay fs: ''sudo raspi-config''