Een kiosk-achtige, app-achtige UI op een Raspberry Pi Zero 2 W met HyperPixel 4 (800×480, touch) die je La Marzocco (Micra) live uitleest en aanstuurt via pylamarzocco – BT client & cloud, brew-by-weight met BOOKOO scale, en synchronisatie naar Supabase voor toekomstige iOS-app integratie.
- Live dashboard met shot timer, gewicht, temperaturen en machine status
- Brew-by-time en brew-by-weight modi met overshoot compensatie
- Pre-infusion en bloom ondersteuning
- WebSocket real-time telemetrie (throttled voor performance)
- Dark/Light theme met Nederlandse UI
- QR device login voor Supabase authenticatie
- SQLite local-first met automatische Supabase sync
- OTA updates via git
Frontend (Preact + Tailwind) ←→ Backend (FastAPI + pylamarzocco)
↕ ↕
HyperPixel 4 La Marzocco Micra (BT)
↕
BOOKOO Scale (BLE)
↕
Supabase (Cloud)
# Flash Raspberry Pi OS 64-bit (Lite)
# Enable SSH, set up user 'pi'
sudo apt update && sudo apt upgrade -y
sudo apt install -y python3-pip python3-venv git bluetooth bluez libbluetooth-dev libcap2-bin chromium-browser nodejs npm curlsudo raspi-config
# Interface Options → Bluetooth → Enable
# Add pi user to bluetooth group
sudo usermod -a -G bluetooth picd /home/pi
git clone <repository> SchermLama
cd SchermLamacd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
deactivatecd ../frontend
npm install
npm run build# Copy service files
sudo cp backend/*.service /etc/systemd/system/
sudo cp backend/*.timer /etc/systemd/system/
# Make OTA script executable
chmod +x scripts/ota.sh
# Enable and start services
sudo systemctl daemon-reload
sudo systemctl enable lm-dashboard.service
sudo systemctl enable lm-ota.timer
sudo systemctl start lm-dashboard.service
sudo systemctl start lm-ota.timer
# For kiosk mode (requires X11)
sudo systemctl enable lm-kiosk.service# Enable auto-login voor user pi
sudo raspi-config
# System Options → Boot / Auto Login → Console Autologin
# Add to ~/.bash_profile voor automatic X start
cat >> ~/.bash_profile << 'EOF'
if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then
exec startx
fi
EOF
# Create minimal ~/.xinitrc voor kiosk
cat > ~/.xinitrc << 'EOF'
#!/bin/sh
xset s off
xset -dpms
xset s noblank
systemctl --user start lm-kiosk.service
EOFcd backend
source .venv/bin/activate
uvicorn app.main:app --reload --host 0.0.0.0 --port 8080cd frontend
npm run devGET /api/status- System statusPOST /api/shot/start- Start shotPOST /api/shot/stop- Stop shotPOST /api/machine/standby- Toggle standbyPOST /api/scale/tare- Tare scalePOST /api/auth/device-login/start- Start QR login
telemetry.machine- Machine temps, statustelemetry.scale- Weight, flow rateshot.events- Shot state changes
# Create .env file in backend/
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_keySettings zijn opgeslagen in SQLite kv tabel en localStorage:
theme- UI thema (dark/light)language- Interface taal (nl)sample_rate_hz- Telemetrie sample rateovershoot_alpha- Overshoot compensatie factor
Gebruikt pylamarzocco library voor:
- BT connectivity (primair)
- Cloud fallback
- Temperature monitoring
- Brew control via standby sequences
BLE GATT integration:
- Real-time weight streaming (10-20 Hz)
- Flow rate calculation
- Tare functionaliteit
Note: BOOKOO scale UUIDs moeten nog worden achterhaald via GATT discovery.
# Manual update
/home/pi/SchermLama/scripts/ota.sh
# Check timer status
sudo systemctl status lm-ota.timer
# View update logs
sudo journalctl -u lm-ota.service -fsudo systemctl status lm-dashboard.service
sudo systemctl status lm-kiosk.service
sudo systemctl status lm-ota.timersudo journalctl -u lm-dashboard.service -f
sudo journalctl -u lm-kiosk.service -f
tail -f /var/log/lm-dashboard-ota.logcurl http://localhost:8080/health# Restart bluetooth
sudo systemctl restart bluetooth
# Scan for devices
sudo bluetoothctl scan on
# Check permissions
groups $USER # Should include 'bluetooth'- WebSocket throttling naar 15 Hz voor UI updates
- Preact gebruikt ipv React voor kleinere footprint
- CSS geoptimaliseerd voor touch interface
- Database indices voor snelle queries
- Static assets gecomprimeerd
MIT License - zie LICENSE bestand.
- pylamarzocco - La Marzocco integration
- Preact - Lightweight React alternative
- Tailwind CSS - Utility-first CSS
- FastAPI - Modern Python web framework