Back in 2017 I built two displays for my fire brigade that show alarm data in case of an alarm. These use a 40" Samsung TV + a RaspberryPi 3B.
A friend already had a working solution , so I adapted his work. It is a minimal approach that uses a matchbox-window-manager + midori
The displays worked fine for all the years but recently I wanted to upgrade the installed RaspberryPi OS from Stretch to Bookworm.
That failed horribly ๐
On one system the upgrade worked but the browser no longer started the other didn’t boot after the update. So I decided to start from scratch and install the latest RaspberryPi OS lite 64-bit on one Pi and simply and the .xinitrc + the xinit-login.service and call it a day. That didn’t work for whatever reason. The folks that maintain RaspberryPi OS changed a lot of things under the hood but I was not able to figure out what exactly prevented this from working.
So I started from the ground up and created a complete script that automates the entire process.
Here is what the script does:
Upgrade system ๐
1apt update && sudo apt upgrade -y
Install dependencies ๐
1apt install -y lightdm openbox chromium-browser unclutter xorg
We use lightdm as our display manager, openbox as our minimalistic window manager, chromium as our browser, unclutter to hide the mouse pointer. Everything on top of Xorg. I considered using wayland in the beginning but that has its problems with overscan according to several sources and I need that.
Configure lightdm ๐
1cat << 'EOF' > /etc/lightdm/lightdm.conf
2[LightDM]
3
4[Seat:*]
5autologin-user=pi
6autologin-user-timeout=0
7user-session=openbox
8
9[XDMCPServer]
10
11[VNCServer]
12EOF
The lightdm session does autologin and start openbox.
Configure openbox ๐
1mkdir -p /home/pi/.config/openbox
2
3cat << 'EOF' > /home/pi/.config/openbox/autostart
4#!/bin/bash
5
6# Disable screen blanking
7xset s off
8xset -dpms
9xset s noblank
10
11# Hide mouse cursor when inactive
12unclutter -idle 0.5 -root &
13
14# Wait for network (optional)
15until ping -c1 9.9.9.9 >/dev/null 2>&1; do sleep 1; done
16
17# Launch Chromium in kiosk mode
18chromium-browser \
19 --noerrdialogs \
20--disable-infobars \
21 --kiosk \
22 --disable-session-crashed-bubble \
23 --disable-restore-session-state \
24 --disable-web-security \
25 --disable-features=VizDisplayCompositor \
26 --start-fullscreen \
27 --no-first-run \
28 --fast \
29 --fast-start \
30 --disable-background-timer-throttling \
31 --disable-backgrounding-occluded-windows \
32 --disable-renderer-backgrounding \
33 --app=https://display.fireplan.de/
34EOF
35
36chmod +x /home/pi/.config/openbox/autostart
37chown pi:pi /home/pi/.config/openbox/autostart
This Openbox config is for autostart, it disables all screen blanking, starts unclutter, waits for network access and then launches the chromium browser.
Configure services ๐
1systemctl set-default graphical.target
2systemctl disable bluetooth
3systemctl disable hciuart
4systemctl disable triggerhappy
5systemctl disable cups cups-browsed
6systemctl disable avahi-daemon
7systemctl disable ModemManager
We disable unused services to reduce start up time.
Configure Overscan ๐
1sed -i '1{/video/!s/$/ video=HDMI-A-1:margin_left=50,margin_right=50,margin_top=30,margin_bottom=30/}' /boot/firmware/cmdline.txt
Here we configure Overscan, this has been done in /boot/config.txt
on Stretch. I tried a lot of variations on Bookworm in /boot/firmware/config.txt
but none worked.
After hours of searching, I finally found the solution hidden in a
forum post
.
Apparently nowadays we have to append settings to /boot/firmware/cmdline.txt
.
It is important to append to the existing line and not put this in a new line, otherwise it will not work.
Configure VNC ๐
1raspi-config nonint do_vnc 0
2
3# Start and enable the VNC service (just to be sure)
4systemctl enable vncserver-x11-serviced
5systemctl start vncserver-x11-serviced
The website I call needs to be configured with credentials that are then stored in the local storage of the browser. In order to do this I set up VNC and use UltraVNC Client for the connection. I tried TightVNC but that does not support the offered encryption methods.
Summary ๐
After a reboot everything worked as expected. The start time is a bit longer than in the old version, but that doesn’t matter in my use case.