Digital Signage Using a Raspberry Pi (Automated Setup)

Passionate about software development and architecture, web and cloud technologies, as well as game development.
Search for a command to run...

Passionate about software development and architecture, web and cloud technologies, as well as game development.
No comments yet. Be the first to comment.
Why CDKTF was my favorite IaC tool

Less Code, Faster Iteration: AI and Smarter Tools Accelerate Productivity in Modern Web Development

Understanding how executable binaries actually work

Learning how the IMAP protocol actually works

I recently had a discussion with a colleague about whether we should introduce a character count limit per line into our style guide. He believes it enhances readability, while I argue that readability should be facilitated by the editor or IDE, not ...

I was asked to develop a system for digital signage based on a Raspberry Pi 4, displaying upcoming events of a club based in Munich.
One requirement was to implement an automated setup pipeline so that it could be quickly deployed to new devices.
After a bit of research, I found DietPi, which is a lightweight OS based on Debian. DietPi is configured using a config file. In there, system settings can be configured. DietPi will then set up your system on the first run using those settings. It is also possible to automatically launch a Chromium instance on a specific URL after starting up.
Our digital sign is implemented using Vue.js and a simple Bootstrap slider that cycles through images. It is served on a publicly accessible URL.

You can adjust the standard Raspberry Pi config file to your needs. In most cases, you want to disable the overscan using disable_overscan=1 and disable the splash screen with disable_splash=1. If you are using a Raspberry Pi 4, you also want to switch to the new graphics driver by setting dtoverlay=vc4-fkms-v3d.
You can create a dietpi-wifi.txt file to specify a WiFi network, the Pi should automatically connect to:
The most important configuration is done in the dietpi.txt. Here you want to define a static IP, set an SSH server to launch for maintenance, and set the Pi to wait for a network with CONFIG_BOOT_WAIT_FOR_NETWORK=2. To enable the automatic setup, define AUTO_SETUP_AUTOMATED=1, AUTO_SETUP_AUTOSTART_LOGIN_USER=root and AUTO_SETUP_INSTALL_SOFTWARE_ID=113 (the 113 instructs DietPi to install chromium, see here). Chromium will be automatically launched in kiosk mode by setting AUTO_SETUP_AUTOSTART_TARGET_INDEX=11.
Then configure Chromium. E.g.:
You can also define a script that runs once at the setup. This is useful if you want to pass custom arguments to the chromium executable and handle other logic automatically turning off the display during nighttime.
To be able to use a custom script, set AUTO_SETUP_AUTOSTART_TARGET_INDEX=7 and AUTO_SETUP_CUSTOM_SCRIPT_EXEC=0.
Then create a new shell script called Automation_Custom_Script.sh. Add the following to that script to automatically run a script during startup:
These commands will also create the custom startup script, which will disable the screensaver and run Chromium on the URL specified in the dietpi.txt as before. The chromium arguments will launch Chromium in fullscreen app mode and block any messages from appearing.
To turn the screen off during certain times, add and adjust the following to the Automation_Custom_Script.sh:
So let's set up the Raspberry Pi:
config.txt, dietpi.txt, dietpi-wifi.txt, and Automation_Custom_Script.sh in the root (/) folder on the SD card. You might want to modify dietpi-wifi.txt, to adjust the WiFi credentials.