This project provides comprehensive driver support for the PiSugar Whisplay Hat, enabling easy control of the onboard LCD screen, physical buttons, LED indicators, and audio functions.
Supported Platforms:
- Raspberry Pi (all models with 40-pin header)
- Radxa ZERO 3W (RK3566)
- Radxa Cubie A7Z (Allwinner A733)
More Details please refer to Whisplay HAT Docs
The device utilizes I2C, SPI, and I2S buses. The I2S and I2C buses are used for audio and will be enabled automatically during driver installation.
After cloning the project, run the unified installer entry:
git clone https://github.com/PiSugar/Whisplay.git --depth 1
cd Whisplay
sudo bash install_driver.sh
sudo reboot
⚠️ Important Hardware Warning (A7Z only)
Due to circuit incompatibility, the physical button on Whisplay HAT is not safe to use on Radxa Cubie A7Z.
Do not press the button, otherwise the A7Z may shut down / lose power immediately.
Test the hardware functions with the demo script:
cd Whisplay/example
pip install -r requirements.txt --break-system-packages
bash run_test.shwhisplay-daemon is an optional local service that centrally manages LCD, backlight, RGB LED, button events, and app foreground switching. (Single click to switch app, long press to launch/foreground app, and 4 rapid clicks to request exit from foreground app)
The daemon now also ships with three built-in system entries:
Bluetooth: opens an internal page that scans nearby Bluetooth devices and lets you bind or unbind the selected deviceWiFi: opens an internal page that scans nearby Wi-Fi networks and lets you connect; protected networks enter a single-button password page, and actual password input depends on an attached external keyboardVolume: opens an internal page for speaker volume adjustment
Left: Desktop app launcher | Middle: Bluetooth manager | Right: WiFi connection
If you are using the daemon, other apps is not recommended to directly access the hardware, and should instead register with the daemon to get foreground control and shared framebuffer access.
Install and start it with:
sudo bash daemon/install_whisplay_daemon_service.sh
systemctl status whisplay-daemon.service --no-pagerAfter installation, daemon settings are stored in ~/.whisplay-daemon/settings.json, and app entries are loaded from ~/.whisplay-daemon/app/.
Example daemon settings:
{
"apps_dir": "~/.whisplay-daemon/app",
"pisugar_home_button": "single"
}pisugar_home_button controls which PiSugar button gesture returns from the foreground app back to daemon home. Supported values are single, double, long, and none. The default is single.
To inspect daemon logs:
journalctl -u whisplay-daemon.service -fIf an app is configured with use_daemon_default_log: true, its stdout/stderr is appended to:
tail -f ~/.whisplay-daemon/daemon-app.logThe repo root is organized by responsibility:
runtime/: Python runtime modules includingwhisplay.pyandwhisplay_client.pyinstall_driver.sh: auto-detecting driver installerscript/: platform install scriptsdaemon/: local hardware daemon, its service installer, anddefault_apps/audio/: audio install assets and DTS overlaysexample/: end-user demos
- Function: Public Python entry point for the LCD, physical button, and LED helper classes.
- Quick Verification: Refer to
example/test.pyto quickly test the LCD, LED, and button functions.
- Function: Python helper for daemon-mode apps.
- Function: Optional local hardware daemon that owns the LCD, backlight, RGB LED, button, and app lifecycle, and exposes a local Unix socket API for app registration, app switching, and shared framebuffer handoff.
- Protocol: line-delimited JSON with
version: 1 - Default socket path:
/tmp/whisplay-daemon.sock - Commands:
health.ping,app.register,app.list,app.launch,app.focus.acquire,app.focus.release,app.exit.request,framebuffer.acquire,backlight.set,led.set,led.fade,button.get_state,events.subscribe - Desktop behavior: single click cycles registered apps, long press launches/foregrounds the selected app, and 4 rapid clicks request exit from the foreground app
- Built-in system pages: includes
Bluetooth,WiFi, andVolumeentries rendered by the daemon itself, without spawning an external app process - Wi-Fi password input: selecting a protected network enters a password input page; password entry depends on an attached external keyboard (arrow keys / Enter / Backspace / ESC)
- PiSugar home integration: if
pisugar-serveris running, daemon can automatically bind the PiSugarsingle,double, orlongbutton gesture as a return-to-home trigger according to~/.whisplay-daemon/settings.json; setpisugar_home_buttontononeto disable it - Install as service:
sudo bash daemon/install_whisplay_daemon_service.sh
- Install result: the installer writes
~/.whisplay-daemon/settings.jsonand seeds the default example app JSON files into~/.whisplay-daemon/app/
-
Source: Audio driver support is provided by Waveshare (Raspberry Pi) or custom overlay (Radxa).
-
Installation:
- Auto-detect: Run
install_driver.sh - Raspberry Pi: Run
script/install_raspberry_pi.sh - Radxa ZERO 3W: Run
script/install_radxa_zero3w.sh - Radxa Cubie A7Z: Run
script/install_radxa_cubie_a7z.sh
sudo bash install_driver.sh # Or run a platform-specific installer: sudo bash script/install_raspberry_pi.sh # For Radxa ZERO 3W: sudo bash script/install_radxa_zero3w.sh # For Radxa Cubie A7Z: sudo bash script/install_radxa_cubie_a7z.sh
- Auto-detect: Run
audio/wm8960-radxa-zero3.dts- DT overlay for WM8960 codec on Radxa ZERO 3W (RK3566), configuring I2C3 and I2S3.audio/wm8960-cubie-a7z.dts- DT overlay for WM8960 codec on Radxa Cubie A7Z (Allwinner A733), configuring TWI7 and I2S0.- Note: These are automatically compiled and installed by the respective install scripts.
The example directory contains 4 end-user demo programs. If you are using whisplay-daemon, you can see their entries directly on the daemon desktop; if not using the daemon, you can run these scripts directly to test hardware functions and experience the demo applications.
- Function: Runs the end-to-end hardware test flow for screen, LED, speaker, button, microphone, and playback.
- Usage:
Effect: The demo shows the logo countdown first, then walks through each hardware test step with on-screen instructions and a final summary.
cd example sudo bash run_test.sh
- Function: This script plays an MP4 video file on the LCD screen.
- Prerequisites: Ensure that
ffmpegis installed on your system. You can install it using:sudo apt-get install ffmpeg
- Download Test Video:
download a sample MP4 video to the
example/datadirectory:cd example wget -O data/whisplay_test.mp4 https://img-storage.pisugar.uk/whisplay_test.mp4 - Usage:
execute the script in the
exampledirectory:Effect: The specified MP4 video will be played on the LCD screen.sudo python3 play_mp4.py --file data/whisplay_test.mp4
- Function: Single-button Flappy Bird demo with game sound effects.
- Usage:
Effect: Short press makes the bird flap. The game includes pseudo-arcade visuals, score tracking, and WM8960 playback effects.
cd example sudo python3 flappy_bird.py
- Function: Single-button Jump Game demo with pseudo-3D tilted rendering and sound effects.
- Usage:
Effect: Hold to charge and release to jump. The demo is tuned for Pi Zero 2W class performance and uses on-screen prompts plus game audio.
cd example sudo python3 jump_game.py
Note: This software currently supports:
- Raspberry Pi: Official full version of the operating system
- Radxa ZERO 3W: Debian 12 (bookworm) official image
- Radxa Cubie A7Z: Debian 11 (bullseye) official image
A7Z Safety Notice: On Radxa Cubie A7Z, please do not click the physical button on Whisplay HAT. Circuit incompatibility may cause immediate power-off.
| Project | Author | Description |
|---|---|---|
| whisplay-ai-chatbot | PiSugar | AI chatbot using Whisplay HAT as display and voice control interface |
| whisplay-xiaozhi | PiSugar | XiaoZhi chatbot client implementation for Raspberry Pi with Whisplay HAT |
| whisplay-talk | PiSugar | Voice interaction project based on Whisplay HAT |
| whisplay-lumon-mdr-ui | PiSugar | Tiny Lumon MDR device implementation |
| pizero-openclaw | Sebastianvkl | Openclaw project with Whisplay HAT display and voice control |
| pisugar-wx | Hemna | Weather information display on Whisplay HAT |


