Make sure your Raspberry Pi is running a recent version of Raspberry Pi OS (Bullseye or newer).
MIPI DSI Display Notes: This guide is specifically configured for the Freenove 5" MIPI DSI Touchscreen (800x480) which uses driver-free configuration on modern Raspberry Pi OS.
# Update system packages
sudo apt update && sudo apt upgrade -y
# Install Qt6 system packages (includes linuxfb platform plugin)
sudo apt install -y qt6-base-dev qt6-qml-dev qt6-quick-dev
# Install basic display dependencies for linuxfb backend
sudo apt install -y \
libxkbcommon0 \
libinput10 \
libudev1 \
fonts-dejavu-core
# Install Python and pip
sudo apt install -y python3-dev python3-pip
# Install PySide6 from system packages (recommended for embedded)
sudo apt install -y python3-pyside6.qtcore python3-pyside6.qtgui python3-pyside6.qtqml python3-pyside6.qtquick python3-pyside6.qtwebsockets
# Alternative: Install PySide6 via pip (if system packages don't work)
# pip3 install PySide6
The Freenove display is driver-free on newer Pi OS, but needs proper configuration:
sudo nano /boot/config.txt
# Add these lines for Freenove 5" MIPI DSI display
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# GPU memory for graphics acceleration
gpu_mem=128
# Enable DSI display (driver-free detection)
display_auto_detect=1
# Force 800x480 resolution if auto-detect fails
# hdmi_group=2
# hdmi_mode=87
# hdmi_cvt=800 480 60 6 0 0 0
# Disable overscan for exact pixel mapping
disable_overscan=1
# Optional: Disable rainbow splash screen
disable_splash=1
# Optional: Rotate display if mounted upside down
# display_rotate=2
The Freenove display uses USB for 5-point capacitive touch (driver-free):
# Verify touch is detected via USB
lsusb | grep -i touch
ls /dev/input/event*
# Check touch events
sudo evtest
# Select the touch device (usually event0 or event1)
# Touch should work automatically - no additional drivers needed
sudo reboot
# After reboot, verify display is working
# Check framebuffer resolution
fbset -fb /dev/fb0
# Verify display resolution
xrandr
# Should show 800x480 resolution
# Test display with simple graphics
sudo apt install -y fbi
sudo fbi -T 1 /usr/share/pixmaps/debian-logo.png
For a dedicated touchscreen kiosk with best Raspberry Pi compatibility:
# Add to ~/.bashrc or create a startup script
export QT_QPA_PLATFORM=linuxfb
export QT_QPA_FB_DRM=1
export QT_QPA_FONTDIR=/usr/share/fonts
Why linuxfb? This backend uses CPU-based software rendering via the Linux framebuffer (/dev/fb0), providing excellent compatibility without complex GPU/KMS configuration. While EGLFS offers GPU acceleration, it requires specific driver configurations that may not work on all Raspberry Pi setups.
If you need window management:
# Install X11 and touchscreen support
sudo apt install -y xinput-calibrator xserver-xorg-input-evdev
# Configure X11 for touchscreen
export DISPLAY=:0
export QT_QPA_PLATFORM=xcb
For newer systems:
sudo apt install -y qt6-wayland
export QT_QPA_PLATFORM=wayland
export WAYLAND_DISPLAY=wayland-1
cd /path/to/dune-weaver-touch
QT_QPA_PLATFORM=linuxfb QT_QPA_FB_DRM=1 python3 main.py
cd /path/to/dune-weaver-touch
DISPLAY=:0 QT_QPA_PLATFORM=xcb python3 main.py
cd /path/to/dune-weaver-touch
python3 main.py
If touch input doesn't align with display:
# Install calibration tool
sudo apt install -y xinput-calibrator
# Run calibration (follow on-screen instructions)
sudo xinput_calibrator
# Save the output to X11 configuration
sudo tee /etc/X11/xorg.conf.d/99-calibration.conf << EOF
Section "InputClass"
Identifier "calibration"
MatchProduct "your_touchscreen_name"
Option "Calibration" "min_x max_x min_y max_y"
Option "SwapAxes" "0"
EndSection
EOF
We provide a comprehensive setup script that automatically configures your Raspberry Pi for kiosk mode:
# Navigate to the application directory
cd /home/pi/dune-weaver/dune-weaver-touch
# Make the setup script executable
chmod +x setup_kiosk.sh
# Run the setup script
./setup_kiosk.sh
# The script will:
# - Detect your Pi model (3/4/5)
# - Configure boot settings for DSI display
# - Install required dependencies
# - Create systemd service for auto-start
# - Set up proper Qt platform (EGLFS/LinuxFB)
# - Create uninstall script for easy removal
# Install kiosk mode (default)
./setup_kiosk.sh
# Check service status
./setup_kiosk.sh status
# Test display configuration
./setup_kiosk.sh test
# Uninstall kiosk mode
./setup_kiosk.sh uninstall
# Or use the generated script:
./uninstall_kiosk.sh
After installation, you can control the kiosk service:
# Start the service
sudo systemctl start dune-weaver-kiosk
# Stop the service
sudo systemctl stop dune-weaver-kiosk
# Check service status
sudo systemctl status dune-weaver-kiosk
# View live logs
journalctl -u dune-weaver-kiosk -f
# Disable auto-start
sudo systemctl disable dune-weaver-kiosk
# Re-enable auto-start
sudo systemctl enable dune-weaver-kiosk
If you prefer manual setup, create a systemd service:
sudo tee /etc/systemd/system/dune-weaver-touch.service << EOF
[Unit]
Description=Dune Weaver Touch Interface
After=multi-user.target graphical.target
Wants=network-online.target
[Service]
Type=simple
User=pi
Environment=QT_QPA_PLATFORM=linuxfb
Environment=QT_QPA_FB_DRM=1
Environment=QT_QPA_FONTDIR=/usr/share/fonts
WorkingDirectory=/home/pi/dune-weaver/dune-weaver-touch
ExecStart=/home/pi/dune-weaver/dune-weaver-touch/bin/python main.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
# Enable the service
sudo systemctl enable dune-weaver-touch.service
sudo systemctl start dune-weaver-touch.service
# Check available plugins
python3 -c "from PySide6.QtGui import QGuiApplication; import sys; app=QGuiApplication(sys.argv); print(app.platformName())"
# If linuxfb missing, install system Qt packages
sudo apt install -y qt6-qpa-plugins
# Verify linuxfb is available
ls /usr/lib/*/qt6/plugins/platforms/ | grep linuxfb
# Make sure X11 is running or use linuxfb for kiosk mode
export DISPLAY=:0
xhost +local:
# For kiosk mode without X11, use linuxfb
export QT_QPA_PLATFORM=linuxfb
# Check input devices
ls /dev/input/
cat /proc/bus/input/devices
# Test touch events
sudo apt install -y evtest
sudo evtest
Add to boot config (/boot/config.txt):
# Rotate display 180 degrees
display_rotate=2
# Or rotate 90 degrees
display_rotate=1
GPU Memory Split: Increase GPU memory in /boot/config.txt:
gpu_mem=128
Disable unnecessary services:
sudo systemctl disable bluetooth
sudo systemctl disable cups
Use hardware acceleration: Ensure Mesa drivers are properly installed
The touch application includes built-in screen power management with touch-to-wake functionality.
The screen will automatically turn off after 5 minutes (300 seconds) of inactivity and can be woken by touching the screen.
You can also control the screen manually from the command line:
# Turn screen OFF
sudo vcgencmd display_power 0
# Turn screen ON
sudo vcgencmd display_power 1
# Alternative: Control backlight
sudo sh -c 'echo "0" > /sys/class/backlight/*/brightness' # OFF
sudo sh -c 'echo "255" > /sys/class/backlight/*/brightness' # ON
The default timeout is 5 minutes, but you can modify it in your application by calling:
# In your backend or QML code
backend.setScreenTimeout(600) # 10 minutes
The application needs sudo permissions for screen control. Add these to sudoers:
sudo visudo
# Add these lines for the pi user:
pi ALL=(ALL) NOPASSWD: /usr/bin/vcgencmd
pi ALL=(ALL) NOPASSWD: /bin/sh -c echo * > /sys/class/backlight/*/brightness
pi ALL=(ALL) NOPASSWD: /bin/cat /dev/input/event*