Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

La Marzocco Dashboard

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.

Features

  • 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

Architectuur

Frontend (Preact + Tailwind) ←→ Backend (FastAPI + pylamarzocco)
                ↕                           ↕
           HyperPixel 4              La Marzocco Micra (BT)
                                             ↕
                                       BOOKOO Scale (BLE)
                                             ↕
                                      Supabase (Cloud)

Installatie op Raspberry Pi Zero 2W

1. OS Setup

# 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 curl

2. Bluetooth Setup

sudo raspi-config
# Interface Options → Bluetooth → Enable

# Add pi user to bluetooth group
sudo usermod -a -G bluetooth pi

3. Project Setup

cd /home/pi
git clone <repository> SchermLama
cd SchermLama

4. Backend Setup

cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
deactivate

5. Frontend Setup

cd ../frontend
npm install
npm run build

6. Service Installation

# 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

7. Auto-login Setup (voor kiosk)

# 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
EOF

Development

Backend Development

cd backend
source .venv/bin/activate
uvicorn app.main:app --reload --host 0.0.0.0 --port 8080

Frontend Development

cd frontend
npm run dev

API Endpoints

  • GET /api/status - System status
  • POST /api/shot/start - Start shot
  • POST /api/shot/stop - Stop shot
  • POST /api/machine/standby - Toggle standby
  • POST /api/scale/tare - Tare scale
  • POST /api/auth/device-login/start - Start QR login

WebSocket Topics

  • telemetry.machine - Machine temps, status
  • telemetry.scale - Weight, flow rate
  • shot.events - Shot state changes

Configuration

Environment Variables

# Create .env file in backend/
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key

Settings

Settings zijn opgeslagen in SQLite kv tabel en localStorage:

  • theme - UI thema (dark/light)
  • language - Interface taal (nl)
  • sample_rate_hz - Telemetrie sample rate
  • overshoot_alpha - Overshoot compensatie factor

Hardware Integration

La Marzocco Micra

Gebruikt pylamarzocco library voor:

  • BT connectivity (primair)
  • Cloud fallback
  • Temperature monitoring
  • Brew control via standby sequences

BOOKOO Scale

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.

OTA Updates

# 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 -f

Troubleshooting

Services Status

sudo systemctl status lm-dashboard.service
sudo systemctl status lm-kiosk.service
sudo systemctl status lm-ota.timer

Logs

sudo journalctl -u lm-dashboard.service -f
sudo journalctl -u lm-kiosk.service -f
tail -f /var/log/lm-dashboard-ota.log

Health Check

curl http://localhost:8080/health

Bluetooth Issues

# Restart bluetooth
sudo systemctl restart bluetooth

# Scan for devices  
sudo bluetoothctl scan on

# Check permissions
groups $USER  # Should include 'bluetooth'

Performance Optimization

  • 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

License

MIT License - zie LICENSE bestand.

Credits

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages