Categories
linux

A few Raspberry Pi tricks when using it in a digital signage or exhibition installation

Having worked with and used Raspberry Pi for a few different use cases, I have learned a few smart configurations to make them extra useful as digital signage installations or backstage computers in professional exhibitions at work. Here are three such use cases.

Make the Pi automatically open a webpage in kiosk mode after booting

This is very handy for multiple uses. I have setup exhibitions that display an interactive web page in kiosk mode and digital signage screens just to display web content. In both cases I have made the Pi automatically start up Chromium in such a mode that it cannot be exited or messed with by using touch. Also no warning or pop up messages that annoy the user. I also made the mouse cursor hide when not used.

Exhibition at Spaceship Aurora, Andøya Space

To do this, add two files in the following folder: /home/pi/.config/autostart. The first file will take care of the mouse cursor: unclutterAuto.desktop. Add the following lines and save:

[Desktop Entry]
Type=Application
Exec=unclutter -idle 0.1

If the unclutter program is not installed, do so with

$ apt install unclutter

The next file, chromiumAuto.desktop will make Chromium start automatically.

[Desktop Entry]
Type=Application
Exec=chromium-browser --disable-features=TranslateUI --disable --disable-translate --disable-save-password-bubbl
e --disable-infobars --disable-suggestions-service --kiosk --noerrors --disable-session-crashed-bubble --incogni
to "https://yoursitetobeopened.com"

Automatically reboot the pi when network connection is lost

At home I have a small homebuilt box with a monitor and a Pi that displays the current weather and datetime, as well as the weather forecast for the next five days. This is placed next to the front door. When you have four kids in kindergarten and school, it is very handy to have that information easily available in the morning.

Homemade weather and time monitor at home.

Sometimes this Pi seem to go offline and not getting up again. Perhaps all the bad weather has caused the Pi to be depressed, I don’t know. But to solve this, I installed Watchdog, which can look out for connection loss and reboot the Pi in an attempt to get up again. Install like this:

$ sudo apt install watchdog

Then, edit the config file /etc/watchdog.conf and add at the end these lines:

ping-count = 5 # ping 5 times
ping = 192.168.3.1 # ping test destination IP address
interval = 20 # perform watchdog checks every 20 seconds

These lines says as the comments on each line that Watchdog will every 20 second, ping five a chosen IP address (in my case the router) five times. If this does not succeed, reboot the Pi.

I also have a line that sayd who to notify by email, but in order for that to work, you will have to set up the Pi to know how to do that. I will not go into that here. I now receive such a notification once a approximately once a week.

Make the attached monitor go off during nighttime automatically

Rasbian comes with a handy tool called vcgencmd, which can do a lot of things. One of the functionalities is to set the display power state. This means that we can send a command to the connected monitor over HDMI, for example to turn it off or on.

The command vcgencmd display_power 0 will turn it off and vcgencmd display_power 1 will turn it on.

I made a added a couple of lines in the crontab

$ crontab -e

0 0 * * * /home/pi/screenToggle.sh 0
0 6 * * * /home/pi/screenToggle.sh 1

to automatically turn off the monitor at midnight and on again at six in the morning. there is nobody awake anyway at that time, so no need for the monitor to stay on at night. I put the following contend into a BASH script called screenToggle.sh which takes 0 or 1 as argument.

!/bin/bash
vcgencmd display_power $1

I hope these commands and tips can be helpful. Feel free to contact me on Twitter if you have any questions.

By hoyd

Communication adviser at Andøya Space.