Pi-ConcertoI was recently tasked with finding an inexpensive solution for some digital signage needs.  I spent some time looking at several open source options and finally settled on a project started by the Rensselaer Polytechnic Institute (RPI)[1] called Concerto[2].  I then spent some time to see if I could get it to work on a Raspberry Pi[3], which we did.  I should provide the disclaimer now that this solution is not for everyone.  It provides very basic signage and is fairly limited in what it can display.  The Concerto software is very simple yet flexible, but it meets our current needs.  For example, neither Concerto (v1) nor the Rapsberry Pi can handle video.  That may change soon since v2 of Concerto is looking promising and the Rapsberry Pi is being improved all of the time.  But for now this solution get the job done for us.

The Concerto site has some pretty good documentation on their feature set and how to get their system up and running.  So I will not be addressing the Concerto system itself here.  This article  intends to focus on what it takes to get the Rapsberry Pi working nicely with the Concerto system.

The Core Image

We started out with a Model B Raspberry Pi [4] and dropped a fresh version of Rasbian OS[5] on it.  You can easily copy the image to an SD card using the ‘dd’ command in a linux based OS or using Win32DiskImager[6] on Windows.

Once the image is in place, boot your Pi.  On first boot the Pi offers you a simple config screen to get you started (raspi-config).  At this point feel free to customize the Pi to meet your regional needs (configure_keyboard, change_locale, change_timezone, change_pass, etc.).  You will definitely want to change the ‘boot_behavior’ to start the desktop on boot.  We also ran the ‘expand_rootfs’ at this point in order to get the full use of the SD card.  You won’t need the space for this project, but why waste it.  If you plan on remote access, enable ssh.  We also set the ‘overclock’ to ‘High’.  We experienced SD card issues when overclocking higher than that.  And for the flat panels that we are using, we needed to disable ‘overscan’ as well.

After the initial settings were completed and we were logged into the Pi, we  changed the hostname.  This is simply done by changing the name listed in the hostname file.

sudo nano /etc/hostname

Before we continue, now might be a good time to also install a few packages that we will need later on.

sudo aptitude install X11-xserver-utils
sudo aptitude install unclutter

Power Saving

Screen Blanking

One of the goals I had was to configure the system to turn itself on and off on its own (mainly the screens). After some research, I found that I could enable and disable the HDMI port on the Pi through the command line.  This was sufficient for us since our screens go into a hibernation state when they lose their HDMI signal and can turn back on when they sense any signal over the HDMI.  So I wrote two scripts: one to power the screens off and the other power them back on.  I then scheduled these scripts using cron.

Tip: After making these scripts, don’t forget to make them executable.

PowerOff Script (screenoff.sh)

#!/bin/bash
echo Screen Off
date
tvservice -o

PowerOn Script (screenon.sh)

#!/bin/bash
echo Screen On
date
tvservice -p
chvt 6
chvt 7

Why run the chvt command?  Well there was a strange behavior that occurred when turning the HDMI port back on.  The screen would not wake up. Somehow the X Session was not re-connecting to the HDMI after it was re-enabled.  Changing the foreground virtual terminal  to 6 and then back to 7 seemed to be enough to reconnect the X Session back to the HDMI port.

Cron Jobs

00 07 * * 1-5 /home/pi/screenon.sh >> /home/pi/screen.log
30 18 * * 1-5 /home/pi/screenoff.sh >> /home/pi/screen.log

For those who are not familiar, the following command will put you into edit mode for root’s crontab file.

sudo crontab -e

Crtl-X to exit (make sure you save your changes).  These jobs turn the screens on at 7:00 am and back off at 6:30 pm, mon-friday (off over the weekends).

Auto Launch the Concerto Screen

Each Concerto screen is accessible through a unique URL based on the MAC address you enter for that screen (server side config).  Normally you would enter the actual MAC address so that each client can dynamically display their screen when they connect to the Concerto server.  With the Pi, we are manually configuring them to attach to a specific screen.  Since we are doing it manually, we fudged a little on the MAC address and configured it as ‘1’.  This made a simpler URL.

The next step was to configure the Pi to automatically boot to a full screen browser pointed at the Concerto screen URL.  We did some experimentation with both the Midori browser and the Chromium Browser.  Chromium had a little better HTML5 support.  But Midori seemed a bit more stable on the Pi.  They both crashed periodically but while the Midori process would crash and close, the Chromium process would crash and freeze.  We opted for Midori in the end.

To make this happen, we wrote a simple shell script which would launch Midori using a bash while loop.  This made recovery from crashes simpler as the while loop would restart Midori whenever it crashed.

Midori Launch Script (signage.sh)

#!/bin/bash
while true; do midori -e Fullscreen -a http://myconcertoserver.com/screen/?mac=1;sleep 5s;done

Now we configure the OS to launch this script in place of the regular LXDE shell.  This is done by modifying the ‘autostart’ script found in ‘/etc/xdg/lxsession/LXDE’.  Comment out everything in there and add the following two lines

@unlcutter
@/home/pi/signage.sh

Remember the package we installed earlier called ‘unclutter’?  This binary simply hides the mouse cursor after a few seconds keeping it from cluttering up your signage.

Cleanup

At this point we are mostly done.  A little cleanup is all that is needed.  By default, the Raspberry Pi kicks in its own screen saving features after about ten minutes.  In order to disable this you need to modify the parameters passed to the X session when it is launched.  You do this by modifying the ‘xserver-command’ configuration in the /etc/lightdm/lighdm.conf file.

Modify it to look like this:

xserver-command=X -s 0 -dpms

Your Done!

You now have a Rapsberry Pi that, on boot, will launch directly into a fullscreen browser and display the Concerto screen of your choice (or any other web page for that matter).

Have Fun!