Digital Signage

This document contains notes for a digital signage solution based on Saltcorn. This solution is by extension  suitable for both dynamic (content is updated live based on input and environment; for instance showing the local weather or position in a queue) and interactive (user can interact with signage via a touchscreen or keypad). Here for simplicity we will however restrict to the example of showing a repeating slideshow based on uploaded images. If you want interactive content, add buttons or links to your views and use a touch screen; for dynamic content, you can use table data in your views.

The strategy is to have a Saltcorn server which has a page which contains the digital signage content. The client which is connected to the screen is set up to display this page on system startup

Server setup

We created a simple table structure with a table that has an image field (type File) and a running field (type Bool, for pausing induividual slides). For admin puposes we create List and Edit views for this table. We also create a Show view which simply shows the image (Field component, field image, fieldview Show Image.

Create a page for your digital signage which will be loaded by the client. For full screen, put a container at the top level of the page. In this container set Display -> Expand to full page width to checked. Drop any views in this container

To create a slideshow, use the carousel view pattern. In the Carousel configuration, set the view and interval as required. You should probably leave show controls, show indicators and hover pause unchecked. To check for changes to the slides (if required, to allow for frequent changes, check the "Reload cycled" option. 

To avoid any scrollbars on the final page (if present) insert this as custom CSS under site settings (changing MyPageName as required):

body.page_MyPageName { overflow: hidden; /* Hide scrollbars */ } 

Check your solution by visiting your page in a Private/Incognito tab on a desktop browser

Client setup

The client is here assumed to be either a Raspberry Pi or a lightweight Debian x86 server. We have tested this with a $100 Intel N3350 4GB RAM server and a Raspberry Pi 4 2GB running Raspberry PI OS (Bookworm). The screen is a Smart TV connected with an HDMI cable. The screen does not need to be smart, anything with an HDMI input will work.

Looks like we are following this guide. Alternative guides: 1

Create a user, e.g. signage

if you are running wayland, switch to X11. sudo rasp-config, Advanced options, Wayland, select X11. Save and reboot

Install system packages:

sudo apt install sudo xorg chromium openbox lightdm unclutter

Edit lightdm config with sudo nano /etc/lightdm/lightdm.conf - This should have 


[SeatDefaults]
autologin-user=signage
user-session=openbox

[Seat:*]
 

Check that after a reboot you get logged in to a openbox graphical UI automatically. IF not you may need to run

sudo systemctl enable lightdm

sudo systemctl set-default graphical.target

As signage user, 

mkdir -p $HOME/.config/openbox

nano $HOME/.config/openbox/autostart

This should be:

xset s off

xset s noblank

xset -dpms

unclutter &

sleep 5

#xrandr -o right # uncomment this line for vertical (portrait) displays

chromium \
    --no-first-run --test-type \
    --disable \
    --disable-translate \
    --disable-infobars \
    --disable-suggestions-service \
    --disable-save-password-bubble \
    --start-maximized \
    --kiosk "https://saltcorn.com" &

Change saltcorn.com to your servers website including the path to signage page.

if on reboot it still boots into Raspberry Pi Desktop, reinstall lightdm

sudo apt remove lightdm

sudo apt purge lightdm

sudo apt install lightdm

Edit lightdm config with sudo nano /etc/lightdm/lightdm.conf again as above

For portrait mode see this or this. xrandr -o right (or left) should be sufficient. 

Watchdog

Sometimes, the device can boot up with no network and never reconnect. This is very bad because you can't connect and need physical access to reset the device. To prevent this, get the watchdog to reboot the device if there is no network.

Find your gateway. nmcli d show | grep IP4.GATEWAY

install watchdog sudo apt install watchdog

edit the watchdog config file: sudo nano /etc/watchdog.conf

This should have (make sure you substitute the gateway IP for the one found above):

interval                = 58

ping                    = 192.168.1.254 # our gateway ip

ping-count              = 5

interface               = wlan0
 

Now enable the watchdot, and reboot

sudo systemctl enable watchdog

sudo reboot

Check the status with

sudo systemctl status watchdog

Fixing HDMI output

Try to turn off the screen and then reboot the device. Sometimes the output does not come back on when you then turn the screen back on after the device has rebooted. This is because HDMI hotplug is not enabled. The easiest solution to this is to fix the HDMI output in the device boot commandline. run sudo nano /boot/firmware/cmdline.txt 

add video=HDMI-A-1:1920x1080@30 to the arguments. my whole line reads like this 

console=serial0,115200 console=tty1 root=PARTUUID=629d5797-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash video=HDMI-A-1:1920x1080@30 plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom=GB

all in one line. You may be connected to a different screen (try HDMI-B?) or need a different resolution.

 

Accessing client devices

you need some way to access the client devices (e.g. Raspberry Pi's). This is one way:

1. Set up ssh server on the client devices when installing. On raspberry pi, sudo raspi-config, interface options, enable SSH

2. To discover the IP address the client has connected to, connect to the same wifi network as the clients and scan the network. For instance, on a linux laptop:

sudo arp-scan -l --interface=wlan0

or

sudo arp-scan -l --interface=wlo1

from stack overflow

Raspberry pi's will show up like this

192.168.1.167    2c:c3:65:b9:a6:29    (Unknown)
192.168.1.167    2c:c3:65:b9:a6:29    (Unknown) (DUP: 2)

3. Now you can ssh to that device, e.g. ssh [email protected]

Signage Content

The content is created in Canva by the organisation deploying the digital signage solution. 

Troubleshooting

Boots into blank screen after changing the hostname - do not change the hostname, leave as raspberrypi.