RasberryPi Info Center

Rpi3_boardI have a RaspberryPi that is doing absolutely nothing. I got it to dink around with it but it just hasn’t been all that useful to me. I much prefer the x86 platform for, pretty much everything. Not so recently, my church expressed a need for a slideshow like machine for things, events, announcements, pictures and the like. Since I have a Pi3 doing absolutely nothing this sounded like a great fit.

Project Requirements

  • Low or no maintenance device that just rotates through a selection of pictures and a given interval
  • Add and remove content from the directory without the slide show software either skipping or borking
  • Be able to FTP into the Pi to drop pictures onto it.

I downloaded Rasbpian and to play along with the written recommendations, I downloaded the image writer, Etcher.

The Etcher AppImage is built against 32 bit architecture so some additional software was required for openSUSE Tumbleweed on a 64 bit architecture

sudo zypper install libXtst6-32bit libXss1-32bit gconf2-32bit

To start out, I needed to make sure I could remotely access this Pi through Secure Shell. I checked the status of the service

systemctl status ssh

I’m going to pause here just to say, Systemd rocks. What a great service for controlling services on Linux via the terminal. It makes using the terminal on different distributions quite comfortable.

The service was “dead” so I started and enabled the ssh service

sudo systemctl start ssh
sudo systemctl enable ssh

After much searching about, I landed on feh as the application to play a slideshow.

sudo apt-get install feh

To test it out, I needed to transfer some pictures to the Pi. Using my favorite file manager, Dolphin.

File Transfer to RPi

After the files had transferred. Ran a test command to see if it worked

feh -Y -x -q -D 5 -B black -F -Z -r /home/pi/Pictures/

And it worked smashingly… except if I added pictures it wouldn’t automatically update the images displayed and eventually, after taking away too many pictures the application borked. Upon scanning through the man pages…

man feh

I discovered an option,

-R, --reload int

This would allow for reloading the directory at a specified interval, int, in seconds. I set it for 15 seconds and gave it another series of successful tests, adding and removing images remotely.

feh -Y -x -q -D 5 -B black -F -Z -R 15 -r /home/pi/Pictures/

An explanation of the options:

-Y : Hide the mouse pointer

-x : Create borderless window

-q : quite, don’t report non-fatal errors

-D : Delay between slides

-B : background for transparent images “black” is the value

-F : Fullscreen

-Z : Zoom pictures to screen size in full screen

-R : Reload the file list, after a period of time in seconds

-r : Recursively expand any directories in the path

It all behaved just as I had hoped it would, so much so that I had that natural dose of endorphins for this little success. It was good to see that the Pi was doing just what I needed it to do.

Add FTP Service

Since it is likely there will be a Windows machine accessing the Pi, I wanted to make adding and removing images is as simple as possible. The best solution, I find, is to set up an ftp server. I tried using sftp but that is not something the Windows file manager can do.

I decided that I would go with proftp as that is the one for which I am most familiar.

sudo apt-get install proftpd-basic

Checked the status of the server, post install

systemctl status proftpd

The service reported that it was running and active. Should that not be the case for you simply run this to start and enable the service:

sudo systemctl start ssh
sudo systemctl enable ssh

Since this is an internal ftp server on a RaspberryPi with no need for multiple users. The default “pi” user was adequate and I used those credentials for ftp access.

Autostart Slideshow on Boot

I didn’t want to have to have anyone fiddle with the Pi should it lose power. It just needs to work. A script was necessary.

Created the folder bin in the home directory, because, that is just where I like to stick my scripts.

mkdir ~/bin

Changed Directory into that folder

cd ~/bin

Created script with all the right bits in my slideshow

nano slideshow.sh

Copy and paste this into the nano editor

#!/bin/bash

feh -Y -x -q -D 8 -B black -F -Z -R 120 -r /home/pi/Pictures/

Save it: Ctrl+o, Enter

Exit nano: Ctrl+x

Next you have to make the script executable

chmod +x slideshow.sh

Now it is possible to run the command in terminal

Since I want this thing to basically just be an appliance where you plug it in and it just does its thing. I need to make this script run when the RaspberryPi starts up.

To do this, I will use my trusty nano editor to edit the desktop startup

nano ~/.config/lxsession/LXDE-pi/autostart

Scroll to the bottom of this script and add this to the very end:

@/home/pi/bin/slideshow.sh

Save and Exit

Reboot the machine to test.

sudo systemctl reboot

Success.

Disable Screen Blanking

As I was testing the slide show program, I discovered that the screen blanks out after a period of time. That is an unacceptable state for this device. Sure, it makes it energy star compliant but it makes it real hard for people to see information from it. The fix is easy, though, it would have been easier if it was a point and click option in Raspbian.

Back in the terminal:

sudo nano /etc/lightdm/lightdm.conf

Look for the heading

[Seat:*]

At the end of that rather large block of “options” add this line:

xserver-command=X -s 0 -dpms

Reboot the machine and test to see if it performs as expected. For me, this worked exactly as expected and I now call the project complete

Syncthing Addition

In order to keep things a bit simpler for the interested parties. I added Syncthing to the RaspberryPi. Just Syncthing, not the GTK GUI. The problem with the setup was that the browser would open up and cover up the slideshow, which, do an average observer could look like an error. The solution, was another autostart modification:

nano ~/.config/lxsession/LXDE-pi/autostart

I added this line:

@/usr/bin/syncthing/binary -no-browser

Now, should the RaspberryPi be rebooted, the Syncthing WebGUI will not sit in front of feh.

Final Thoughts

I am very glad the Internet exists with so many others describing how they solved their problems. I feel like I cheated because I was able to pick different solutions and mash them up to satisfy my requirements for a properly fitting and robust solution.

RPi3_slideshow

With rebooting the machine, I am rather impressed by how quickly the system goes from off to playing the slide show. A testiment to the work of the RaspberryPi folks hard work.

This was my first RaspberryPi experience and after completing the project, I am mostly happy with the whole process but ultimately, I think I would have preferred setting this all up on an x86 based machine. There were numerous little unique Pi niggles that I found annoying that kind of reminded me of noodling around in Linux circa 2005. At the same time, it was kind of a nice throwback to the last decade in working through a myriad of challenges to have a properly working computer.

For the technical adventurous, I highly recommend playing around with Raspberry Pi devices. It is certainly a great little hobby machine to perform special tasks. At the end of this project, I can think of several other things that I would like to do with a Raspberry Pi or similar device to solve other problems that come to mind.

References

Instructables Easy Raspberry Pi Screensaver Slideshow

Raspbian Download

Etcher

feh – Linux man page

How to Disable the Blank Screen on Raspberry Pi (Raspbian)

ProFTP.org

Geek3D.com Disable the Blank Screen on RaspberryPi

One thought on “RasberryPi Info Center

Leave a Reply