Raspberry Pi Kiosk Automation¶
Overview¶
This playbook describes how to use an LLM-powered agent to automate the configuration of a Raspberry Pi into a dedicated kiosk dashboard. This pattern is ideal for home dashboards, status displays, or smart mirrors.
Stack¶
- Reasoning: OpenAI GPT-4o or Claude 3.5 Sonnet.
- Agent: Custom Agent or Aider.
- Execution: SSH over Tailscale.
- Security: SSH Execution Patterns.
Typical Automation Workflow¶
The agent follows an iterative "Propose-Execute-Observe" loop to configure the Pi:
- OS Preparation: Agent checks the OS version and updates packages.
- Command:
lsb_release -a && sudo apt update && sudo apt upgrade -y
- Command:
- Environment Setup: Agent installs necessary kiosk dependencies (X11, Chromium, Matchbox window manager).
- Command:
sudo apt install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox chromium-browser
- Command:
- Autologin Configuration: Agent modifies
/etc/lightdm/lightdm.confor usesraspi-confignon-interactively. - Kiosk Script Creation: Agent writes a startup script (
kiosk.sh) that:- Disables screen blanking.
- Hides the mouse cursor (
unclutter). - Launches Chromium in
--kioskmode pointing to the dashboard URL.
- Service Persistence: Agent creates a systemd service to ensure the kiosk starts on boot and restarts on failure.
How the Agent Iterates¶
One of the main advantages of using an agent is its ability to handle errors autonomously:
- Propose: "I will now install
unclutterto hide the mouse cursor." - Execute: Agent runs
sudo apt install uncluttervia SSH. - Observe: Agent reads the output. If it sees
E: Unable to locate package, it might try to update the cache or search for an alternative. - Fix: "The package name might be different; searching for similar packages..."
Dashboard Strategies¶
1. Browser Kiosk Approach¶
The simplest method. The Pi runs a full browser (Chromium) pointing to a web app. - Pros: Easy to update centrally; supports proprietary dashboards (e.g., Skylight, DAKboard). - Cons: High memory usage; slower boot times.
2. Self-Hosted Dashboards¶
Connecting to services already in this stack: - Home Assistant: The official Lovelace UI makes an excellent kiosk. - Custom React/Next.js: A lightweight app pulling data from n8n or Paperless-ngx. - Grafana: For infrastructure-heavy monitoring.
Security Considerations¶
- Restricted Sudo: As documented in SSH Execution Patterns, the agent's user should only have sudo access to the specific commands needed for kiosk setup.
- Network Isolation: Keep the Pi on a dedicated IoT VLAN or only accessible via Tailscale.