Navigation
Navigation
The directions here are what I followed to turn my raspberry pi and 7“ pi screen into a photobox.
Step 1 - Setup
Install Raspiberry pi OS (full) onto an SD card and install in your Pi. Bootup, run raspi-config, and get everything setup the way you like it.
Step 2 - Screen
Follow directions here to setup the screen
Step 3 - Mount network drive on Pi
As discussed here edit
/etc/fstab,
add the line:
//192.168.1.110/public/photos /diskstation_share cifs _netdev,username=guest,password=,dir_mode=0755,file_mode=0755,uid=500,gid=500 0 0
note that _netdev is needed for network shares.
also, i followed the instructions here here and created the file
/etc/network/if-up.d/fstab
with the lines
#!/bin/sh sleep 30 sudo mount -a
Note that the sleep command is a hack that allowed the Pi to settle its network connectivity before it attempted to mount the network folder
Step 4 - Slide viewer
following the directions here, I created the file runslideshow.sh on the ~/Desktop with the following lines
#!/bin/sh cd /home/pi/diskstation_share feh -Z -z -F -D 300 --hide-pointer --auto-rotate --recursive
Note that the recursive allows the directories to be searched recursively.
To make sure it autostarted correctly, I followed the directions here and created a .desktop file at /home/pi/.config/autostart that contains
[Desktop Entry] Type=Application Name=runslideshow Exec=/home/pi/Desktop/./runslideshow.sh
Step 5 - Schedule screen dimming
To schedule screen dimming, open the scheduler with
crontab -e
and add the following lines
0 7 * * * sudo sh -c "echo 255 > /sys/devices/platform/rpi_backlight/backlight/rpi_backlight/brightness" 0 21 * * * sudo sh -c "echo 12 > /sys/devices/platform/rpi_backlight/backlight/rpi_backlight/brightness"
which brightens the screen at 7:00 and dims the screen at 21:00. Note that 255 is max brightness and 0 is minimum (off).
Step 6 - Enable right click as a long click
Modifying the directions from here, run the commands
sudo apt install build-essential libevdev2 libevdev-dev git clone 'https://github.com/PeterCxy/evdev-right-click-emulation.git' cd 'evdev-right-click-emulation' make all sudo cp 'out/evdev-rce' '/usr/local/bin/' sudo chmod +x '/usr/local/bin/evdev-rce'
Then navigate to ~/.config/autostart, create the file: evdev-rce.desktop, and fill it with
[Desktop Entry] Version=1.0 Type=Application Name=evdev-rce GenericName=Enable long-press-to-right-click gesture Exec=sudo /usr/local/bin/evdev-rce Terminal=true StartupNotify=false