Skip to content

PiSugar/whisplay-ai-chatbot

Repository files navigation

Whisplay-AI-Chatbot

Whisplay AI Chatbot

This is a pocket-sized AI chatbot device built using a Raspberry Pi Zero 2w. Just press the button, speak, and it talks back—like a futuristic walkie-talkie with a mind of its own.

Test Video Playlist: https://www.youtube.com/watch?v=lOVA0Gui-4Q

Hardware

  • Raspberry Pi zero 2w
  • PiSugar Whisplay HAT (including LCD screen, on-board speaker and microphone)
  • PiSugar 3 1200mAh

Drivers

You need to firstly install the audio drivers for the Whisplay HAT. Follow the instructions in the Whisplay HAT repository.

Installation Steps

  1. Clone the repository:
    git clone https://github.com/PiSugar/whisplay-ai-chatbot.git
    cd whisplay-ai-chatbot
  2. Install dependencies:
    bash install_dependencies.sh
  3. Create a .env file based on the .env.template file and fill in the necessary environment variables.
  4. Build the project:
    bash build.sh
  5. Start the chatbot service:
    bash run_chatbot.sh
  6. Optionally, set up the chatbot service to start on boot:
    sudo bash startup.sh
    Please note that this will disable the graphical interface and set the system to multi-user mode, which is suitable for headless operation.

Build After Code Changes

If you make changes to the node code, you need to rebuild the project. You can do this by running:

yarn
yarn build

If you add new third-party libraries to the python code, make sure to install them in global environment with --break-system-packages.

Update Environment Variables

If you need to update the environment variables, you can edit the .env file directly. After making changes, please restart the chatbot service with:

systemctl restart whisplay-ai-chatbot.service

Display Battery Level

The battery level display depends on the pisugar-power-manager. If you are using PiSugar2 or PiSugar3, you need to install the pisugar-power-manager first. You can find the installation instructions in the PiSugar Power Manager repository.

Or use the following command to install it:

wget https://cdn.pisugar.com/release/pisugar-power-manager.sh
bash pisugar-power-manager.sh -c release

Enclosure

Whisplay Chatbot Case

Goals

  • Integrate the tool with the API ✅
  • Enable the AI assistant to adjust the volume autonomously ✅
  • Reset the conversation history if there is no speech for five minutes ✅
  • Support local llm server ✅
  • Refactor python render thread, better performance ✅
  • Add Google Gemini API support
  • RPI cammera support
  • Support speaker recognition

License

GPL-3.0

About

Pocket-sized AI chatbot built using a RPI Zero 2w

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published