Building a 6-Card 320×240 SPI Touchscreen Homelab Kiosk on Raspberry Pi

By | November 26, 2026

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:

  1. blog.voina.org Live Pulse: Checks HTTP status, pulls daily views, visitors, and comments from the WordPress.com Jetpack REST API, and shows the next scheduled post date and ID.
  2. UniFi & UISP WAN Status: Queries api.ui.com/v1/hosts for our three UniFi consoles (Sopor, Zorilor, Alba) and voina.uisp.com/nms/api/v2.1/devices for active EdgeMAX/UISP devices.
  3. NAS3 Services Watch: Performs fast TCP socket checks on Home Assistant (:8123), Authentik (:9000), LibreNMS (:8000), Weave Scope (:4040), Actual Budget (:5006), and Wealthfolio (:8090), rendering green/red pills.
  4. Storage & LTO-4 Tape Backups: Displays root disk usage (% and used/size) for nas1, nas3, and nas4, plus the latest verified snapshot from our LTO-4 tape ledger.
  5. AI & Bot Daemons: Tracks signal-bot.service, antigravity-sentinel.timer, antigravity-dream.timer, and antigravity-obsidian-sync.timer, along with the last nightly dream timestamp.
  6. Toyota & Security: Pulls parking location, fuel level/range, odometer, door/trunk lock state, and Netatmo indoor/outdoor camera states from Home Assistant.
  7. Zorilor Indoor Camera (7/11): Full-screen 320×208 JPEG snapshot from camera.smart_indoor_zorilor via Home Assistant /api/camera_proxy/.
  8. Alba Indoor Camera (8/11): Full-screen snapshot from camera.smart_indoor_camera.
  9. Soporului Cam (9/11): Full-screen snapshot from camera.soporului_camera.
  10. Outdoor Cam (10/11): Full-screen snapshot from camera.smart_outdoor_camera (shows a clean Camera Offline card when idle).
  11. NAS2 Webcam (11/11): Full-screen snapshot from camera.nas2_philips_webcam.

blog.voina.org live pulse card on the 3.2-inch SPI screen

AI & Bot Daemons status card on the 3.2-inch SPI screen

Toyota & Security status card on the 3.2-inch SPI screen

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

  1. Stopping lightdm and fbcp from Overwriting /dev/fb1: Even after disabling X11 DPMS blanking, lightdm and fbcp (started from /etc/rc.local) were copying fb0 onto fb1 60 times a second—turning the screen into either the LXDE desktop or solid black once Xorg stopped. Disabling lightdm.service and commenting out fbcp & in /etc/rc.local gave rpi4-kiosk.service exclusive ownership of /dev/fb1.
  2. Unmapping tty1 Console (fbcon) from /dev/fb1: Linux’s console framebuffer (con2fbmap 1) was still mapped to fb1, causing the kernel console blanker to clear the screen right after each touch. Adding ExecStartPre=/bin/sh -c 'con2fbmap 1 0 || true' to rpi4-kiosk.service and consoleblank=0 to /boot/cmdline.txt keeps the display permanently on.
  3. Jetpack stats/summary Field Names: The WordPress.com stats/summary endpoint returns views, visitors, and comments (not views_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.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.