# Whisplay-AI-Chatbot Whisplay AI Chatbot [![Discord](https://img.shields.io/discord/1483017948305297501?logo=discord&logoColor=white&label=Discord&color=5865F2)](https://discord.gg/NMpCMP8RS8) This is a pocket-sized AI chatbot device built using a Raspberry Pi Zero 2w / 5. Just press the button, speak, and it talks back—like a futuristic walkie-talkie with a mind of its own. Set `AUTO_LISTENING_ENABLED=true` in `.env`, or use **AI Features → Auto Listening** in `whisplay configure`, then restart the chatbot. On Whisplay Plus, change **Settings → Auto Listening** to apply and save the setting immediately. A single press starts automatic listening and speech ends after a pause. Press again while listening to cancel, or press during recognition or playback to start listening again. The button and wake word share the automatic recording and conversation timeouts. Zipformer shows live subtitles with the local microphone. Under **AI Features → Auto Listening**, set `AUTO_LISTENING_END_KEYWORDS` to a comma-separated list of phrases that return a button-started session to standby after recognition, regardless of letter case. The defaults are `byebye,goodbye,bye for now,stop,all done,end conversation`. Wake-word sessions use `WAKE_WORD_END_KEYWORDS`. With Auto Listening enabled, use the on-screen camera control on supported displays. Test Video Playlist: [https://www.youtube.com/watch?v=lOVA0Gui-4Q](https://www.youtube.com/playlist?list=PLpTS9YM-tG_mW5H7Xs2EO0qvlAI-Jm1e_) Tutorial: [https://www.youtube.com/watch?v=Nwu2DruSuyI](https://www.youtube.com/watch?v=Nwu2DruSuyI) Tutorial (offline version build on RPi 5): [https://youtu.be/kFmhSTh167U](https://youtu.be/kFmhSTh167U) [https://youtu.be/QNbHdJUW6z8](https://youtu.be/QNbHdJUW6z8) [https://youtu.be/xGzvFzdBAwc](https://youtu.be/xGzvFzdBAwc) ## Hardware - Raspberry Pi zero 2w (Recommand RRi 5, 8G RAM for offline build) - PiSugar Whisplay HAT (including LCD screen, on-board speaker and microphone) - PiSugar 3 1200mAh (Plus version 5000mAh for RPi 5) ## Pre-build Image - Please find the pre-build images in project wiki: https://github.com/PiSugar/whisplay-ai-chatbot/wiki - [Zipformer offline ASR setup](docs/zipformer-asr.md) ## Drivers You need to firstly install the audio drivers for the Whisplay HAT. Follow the instructions in the [Whisplay HAT repository](https://github.com/PiSugar/whisplay). ## Installation Steps 1. Clone the repository: ```bash git clone https://github.com/PiSugar/whisplay-ai-chatbot.git cd whisplay-ai-chatbot ``` 2. Install dependencies: ```bash bash install_dependencies.sh source ~/.bashrc ``` The installer uses Node.js 22 or later and installs Node.js 22 if needed. On an existing installation, `whisplay update` also upgrades Node.js before installing dependencies and building. Reload the shell configuration with `source ~/.bashrc`. **Custom npm registry:** All scripts respect the `NPM_REGISTRY` environment variable. If not set, the official npm registry (`https://registry.npmjs.org`) is used. To use a mirror (e.g. in China), export it before running any script: ```bash export NPM_REGISTRY="https://registry.npmmirror.com" bash install_dependencies.sh ``` This also applies to `build.sh` and all `whisplay` CLI commands (`plugin install`, `plugin update`, `update`, etc.). 3. Configure environment variables: ```bash whisplay configure ``` This command opens an interactive config wizard. If `.env` does not exist yet, it will be created automatically from `.env.template`. You can still use the manual method if you prefer: ```bash cp .env.template .env ``` 4. Build the project: ```bash bash build.sh ``` 5. Start the chatbot service: ```bash bash run_chatbot.sh ``` 6. Optionally, set up the chatbot service to start on boot: ```bash bash startup.sh ``` If `whisplay-daemon` is running, this registers the chatbot with the daemon, configures it as the daemon's boot autostart app, and launches it immediately. Otherwise, the script installs the legacy standalone `chatbot.service`. Please note that this will disable the graphical interface and set the system to multi-user mode, which is suitable for headless operation. You can find the output logs at `chatbot.log`. Running `tail -f chatbot.log` will also display the logs in real-time. ## Whisplay Plus Quick Start Whisplay Plus is detected automatically from its DSI display. If automatic detection is unavailable, set the model explicitly in `.env`: ```bash WHISPLAY_HAT_MODEL=hat-plus ``` Start the app with `bash run_chatbot.sh`. The fullscreen touchscreen UI opens automatically and is also available at `http://:17881/` by default. - Press and hold either the physical button or the on-screen microphone button to speak, then release it to send the recording. - Use the three-dot settings button to adjust volume and brightness or exit the app. Whisplay Plus keeps the current speaker volume when the app starts. - If `ENABLE_CAMERA=true`, use the camera button beside Settings to open the preview. Tap the preview to focus, then use the physical button or the on-screen shutter button to take a photo. - GPIO17 must be available for the physical button. Stop or reconfigure any other hardware service that owns GPIO17. The default screen orientation is portrait. Run the orientation script as the desktop user (without `sudo`) to switch the display and touchscreen mapping together: ```bash # Portrait (default) bash scripts/set-hat-plus-orientation.sh portrait # Landscape bash scripts/set-hat-plus-orientation.sh landscape # Show the current configuration bash scripts/set-hat-plus-orientation.sh status ``` To add a launcher to the Raspberry Pi desktop: ```bash bash scripts/install-hat-plus-desktop-shortcut.sh ``` ## Build After Code Changes If you make changes to the node code or just pull the new code from this repository, you need to rebuild the project. You can do this by running: ```bash bash build.sh ``` If If you encounter `ModuleNotFoundError` or there's new third-party libraries to the python code, please run the following command to update the dependencies for python: ``` cd python pip install -r requirements.txt --break-system-packages ``` The env template may be updated from time to time. If you want to upgrade your existing `.env` file based on the latest `.env.template`, you can run the following command: ```bash bash upgrade-env.sh ``` ## Update Environment Variables The recommended way to update environment variables is: ```bash whisplay configure ``` This lets you manage `.env` by category and will create the file automatically if it is missing. You can also edit `.env` directly if you prefer. After making changes, please restart the chatbot service with: ```bash sudo systemctl restart chatbot.service ``` ## More Features **[Wake Word](https://github.com/PiSugar/whisplay-ai-chatbot/wiki/Wakeword)** for hands-free interaction. **[Image Generation](https://github.com/PiSugar/whisplay-ai-chatbot/wiki/Image-Generation)** for generating images from text prompts. **[Battery Level Display](https://github.com/PiSugar/whisplay-ai-chatbot/wiki/Battery-Level-Display)** for installation instructions. **[Data Folder](https://github.com/PiSugar/whisplay-ai-chatbot/wiki/Data-Folder)** for details on sub-folder layout and cleanup options. ## Enclosure [Whisplay Chatbot Case for Pi02](https://github.com/PiSugar/suit-cases/tree/main/pisugar3-whisplay-chatbot) [Whisplay Chatbot Case (FDM) for Pi02](https://github.com/PiSugar/suit-cases/tree/main/pisugar3-whisplay-chatbot-fdm) [Whisplay Chatbot Case (FDM) for Pi5](https://github.com/PiSugar/suit-cases/tree/main/pi5-whisplay-chatbot) [Whisplay Chatbot Case (FDM) for Pi5 & LLM8850](https://github.com/PiSugar/suit-cases/tree/main/pi5-whisplay-chatbot-llm8850) ## AI Accelerator Card Support [LLM8850](https://github.com/PiSugar/whisplay-ai-chatbot/wiki/LLM8850-Integration) [Raspberry Pi AI HAT+ 2 (Hailo-10H)](https://github.com/PiSugar/whisplay-ai-chatbot/wiki/Raspberry-Pi-AI-HAT+-2) ## Goals - Support LLM8850 whisper ✅ - Support LLM8850 melottsTTS ✅ - Support LLM8850 Qwen3 llm api (not support tool) ✅ - Support LLM8850 Qwen3-VL multimodal llm api (not support tool) ✅ - Support LLM8850 image generation ✅ - Suppprt Raspberry Pi AI Hat+2 (Hailo-10H) whisper, llm, vlm ✅ - Support speaker recognition ## Star History Star History Chart ## License [GPL-3.0](https://github.com/PiSugar/whisplay-ai-chatbot?tab=GPL-3.0-1-ov-file#readme)