Building a 6-Card 320×240 SPI Touchscreen Homelab Kiosk on Raspberry Pi
In our previous post, we put a 13-node Weave Scope grid, 4-UPS status bar, and Soporului ambient ticker onto a 16×16 Unicorn HAT HD (rpi-1). That solved glanceable LED status, but a 16×16 matrix still cannot show daily blog views, disk percentages, ISP names, or car range.
On rpi-4, we had a Joy-IT 3.2″ SPI TFT touchscreen (320×240, fb_ili9340 + ads7846). Instead of squeezing a desktop browser onto 320×240 pixels, we built a direct RGB565 framebuffer kiosk (rpi4-kiosk.service) that renders 11 crisp, high-contrast cards (6 telemetry cards + 5 full-screen Home Assistant camera snapshots) straight to /dev/fb1 and advances on touch or every 12 seconds.
Why Direct /dev/fb1 Beats Xorg + Chromium at 320×240
Running Chromium on a 320×240 SPI screen wastes hundreds of megabytes of RAM and forces you to fight window chrome, scaling, and fbcp CPU overhead. Writing directly to /dev/fb1 with Pillow (PIL) and NumPy takes ~10 milliseconds per frame:
def write_fb(img):
arr = np.asarray(img.convert('RGB'), dtype=np.uint16)
r = (arr[:, :, 0] >> 3) << 11
g = (arr[:, :, 1] >> 2) << 5
b = (arr[:, :, 2] >> 3)
rgb565 = (r | g | b).astype('<u2')
with open('/dev/fb1', 'wb') as f:
f.write(rgb565.tobytes())
A background thread reads /dev/input/by-path/platform-3f204000.spi-event (ads7846 EV_KEY BTN_TOUCH code 330) and triggers a threading.Event so tapping anywhere on the screen jumps straight to the next card.
The Six Kiosk Cards
Rather than duplicating rpi-1‘s LED matrix, rpi-4 focuses on text-rich homelab telemetry:
blog.voina.orgLive Pulse: Checks HTTP status, pulls dailyviews,visitors, andcommentsfrom the WordPress.com Jetpack REST API, and shows the next scheduled post date and ID.- UniFi & UISP WAN Status: Queries
api.ui.com/v1/hostsfor our three UniFi consoles (Sopor, Zorilor, Alba) andvoina.uisp.com/nms/api/v2.1/devicesfor active EdgeMAX/UISP devices. - NAS3 Services Watch: Performs fast TCP socket checks on
Home Assistant(:8123),Authentik(:9000),LibreNMS(:8000),Weave Scope(:4040),Actual Budget(:5006), andWealthfolio(:8090), rendering green/red pills. - Storage & LTO-4 Tape Backups: Displays root disk usage (
%andused/size) fornas1,nas3, andnas4, plus the latest verified snapshot from our LTO-4 tape ledger. - AI & Bot Daemons: Tracks
signal-bot.service,antigravity-sentinel.timer,antigravity-dream.timer, andantigravity-obsidian-sync.timer, along with the last nightly dream timestamp. - Toyota & Security: Pulls parking location, fuel level/range, odometer, door/trunk lock state, and Netatmo indoor/outdoor camera states from Home Assistant.
- Zorilor Indoor Camera (
7/11): Full-screen320×208JPEG snapshot fromcamera.smart_indoor_zorilorvia Home Assistant/api/camera_proxy/. - Alba Indoor Camera (
8/11): Full-screen snapshot fromcamera.smart_indoor_camera. - Soporului Cam (
9/11): Full-screen snapshot fromcamera.soporului_camera. - Outdoor Cam (
10/11): Full-screen snapshot fromcamera.smart_outdoor_camera(shows a cleanCamera Offlinecard when idle). - NAS2 Webcam (
11/11): Full-screen snapshot fromcamera.nas2_philips_webcam.



Keeping Cards 4 & 5 Secure Without Extra SSH Keys
Instead of giving rpi-4 SSH keys to our workstation and storage nodes, a lightweight systemd --user timer (rpi4-kiosk-push.timer) on the workstation runs every 2 minutes, collects the local daemon states, LTO-4 tape ledger entry, and df -h summaries, and pushes a single /tmp/fleet_kiosk.json snapshot to rpi-4 over scp.
Three Framebuffer Pitfalls We Fixed
- Stopping
lightdmandfbcpfrom Overwriting/dev/fb1: Even after disabling X11 DPMS blanking,lightdmandfbcp(started from/etc/rc.local) were copyingfb0ontofb160 times a second—turning the screen into either the LXDE desktop or solid black once Xorg stopped. Disablinglightdm.serviceand commenting outfbcp &in/etc/rc.localgaverpi4-kiosk.serviceexclusive ownership of/dev/fb1. - Unmapping
tty1Console (fbcon) from/dev/fb1: Linux’s console framebuffer (con2fbmap 1) was still mapped tofb1, causing the kernel console blanker to clear the screen right after each touch. AddingExecStartPre=/bin/sh -c 'con2fbmap 1 0 || true'torpi4-kiosk.serviceandconsoleblank=0to/boot/cmdline.txtkeeps the display permanently on. - Jetpack
stats/summaryField Names: The WordPress.comstats/summaryendpoint returnsviews,visitors, andcomments(notviews_today/visitors_today). Matching those exact keys brought the blog card metrics online immediately.
Running rpi4-kiosk.service
[Unit]
Description=RPi-4 3.2in SPI Framebuffer Homelab Kiosk
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
EnvironmentFile=/etc/rpi4_kiosk.env
ExecStartPre=/bin/sh -c 'con2fbmap 1 0 || true'
ExecStart=/usr/bin/python3 /opt/rpi4-kiosk/rpi4_kiosk.py
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
With fbcp disabled, tty1 moved to fb0, and rpi4-kiosk.service running directly against /dev/fb1, rpi-4 now acts as a silent, always-on, touch-interactive homelab mini-console alongside rpi-1‘s LED matrix.