Skip to content

OminousIndustries/Bob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bob — The Sentient Washing Machine (Raspberry Pi Voice Chatbot)

Availability & Kits (Important)

Bob is free to make and print for personal use. For convenience, a limited number of pre‑printed kits (including screens, switches, and microphones) are available here ominousindustries.com.

Bob kit photo


Contents


3D Printed Parts

All print files are available here:
Printables: https://www.printables.com/model/1404129-bob-the-sentient-washing-machine

A limited number of pre‑printed kits (including screens, switches, and microphones) are available here ominousindustries.com.


Step 1 — Audio, Bluetooth & Chatbot Base

1) System packages

# Update system packages
sudo apt update
sudo apt upgrade -y

# Core tools, audio stack, BT, and TTS
sudo apt install -y \
  git python3-venv python3-pip \
  python3-gpiozero python3-rpi.gpio \
  bluez \
  pipewire pipewire-pulse wireplumber \
  espeak-ng \
  libportaudio2 \
  alsa-utils \
  libspa-0.2-bluetooth

# Add user to audio group for device permissions
sudo usermod -aG audio $USER

# Reboot for group membership to take effect
sudo reboot

After reboot, log back in and continue.


2) Enable services

# Enable Bluetooth system service
sudo systemctl enable --now bluetooth

# Start PipeWire audio stack for your user
systemctl --user enable --now pipewire wireplumber pipewire-pulse

# Keep user services running even when not logged in (headless)
sudo loginctl enable-linger $USER

# Verify PipeWire is up
systemctl --user status pipewire

3) Bluetooth speaker setup

# Enter the Bluetooth controller
bluetoothctl

Inside the bluetoothctl prompt, run:

power on
agent on
default-agent
scan on
# Wait until your speaker appears; note its MAC XX:XX:XX:XX:XX:XX

pair XX:XX:XX:XX:XX:XX
trust XX:XX:XX:XX:XX:XX
connect XX:XX:XX:XX:XX:XX
exit

Set as default output and test:

# List PipeWire nodes; note your speaker's Sink ID
wpctl status

# Set default output (replace <sink-id> with the ID you noted)
wpctl set-default <sink-id>

# Test sound output
pw-play /usr/share/sounds/alsa/Front_Center.wav

4) USB microphone setup

# Plug in the USB mic, then list audio Sources
wpctl status

# Note the Source ID for your USB mic (e.g., 66) and set it as default:
wpctl set-default <source-id>

# Quick record test from the default source
pw-record --rate 44100 --channels 1 test.wav
# Speak ~3 seconds, then Ctrl+C

# Play back through default sink (BT speaker)
pw-play test.wav

5) Project & Python deps

# Create project
mkdir -p ~/voice-chatbot
cd ~/voice-chatbot

# Python virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Upgrade pip and install packages
pip install --upgrade pip
pip install faster-whisper ollama numpy kokoro

# Optional: thread tuning for Faster-Whisper (shell startup)
echo 'export OMP_NUM_THREADS=4' >> ~/.bashrc
source ~/.bashrc

# Ensure venv is active for the rest of the setup
source .venv/bin/activate

6) Install Ollama & model

# Install Ollama server
curl -fsSL https://ollama.com/install.sh | sh

# Enable and start the Ollama daemon
sudo systemctl enable --now ollama

# Download a small, fast model
ollama pull gemma3:270m

# Verify it responds
ollama run gemma3:270m "Say hello"

7) Create & run chatbot.py

# Create the chatbot script (paste in the chatbot.py script from the repo)
nano chatbot.py

Find your mic Source ID via wpctl status, then launch:

# Example: MIC_TARGET=66 (replace with your actual Source ID)
MIC_TARGET=66 python3 chatbot.py

Step 2 — SPI Display (Waveshare) & “Bob” Chat

1) Enable SPI & groups, reboot

# Enable SPI in raspi-config:
sudo raspi-config   # Interface Options → SPI → Enable

# Add your user to GPIO/SPI groups
sudo usermod -a -G gpio,spi $USER

# Reboot to apply
sudo reboot

After reboot, log back in and continue.


2) Display packages (Pi 5 note)

# On a Raspberry Pi 5, remove legacy RPi.GPIO first:
sudo apt purge -y python3-rpi.gpio
sudo apt autoremove -y

# Install required packages
sudo apt install -y python3-pip unzip wget git python3-lgpio

If you are not on a Pi 5, you can skip the purge step.


3) Waveshare driver

cd ~
wget https://files.waveshare.com/upload/8/8d/LCD_Module_RPI_code.zip
unzip -o LCD_Module_RPI_code.zip

4) Use project venv

# Reuse the existing project venv (create only if it doesn't exist)
cd ~/voice-chatbot
[ -d .venv ] || python3 -m venv .venv
source .venv/bin/activate

5) Python deps for display

# Install display-related Python packages into the project venv
pip install pillow numpy spidev gpiozero rpi-lgpio lgpio

# (Optional) Use lgpio pin factory for gpiozero
export GPIOZERO_PIN_FACTORY=lgpio

6) Test Waveshare demo

# From inside the venv
cd ~/LCD_Module_RPI_code/RaspberryPi/python/example
python3 1inch28_LCD_test.py

7) Create bobchat.py

cd ~/voice-chatbot

# Create the Bob chat script (paste in the bobchat.py script from the repo)
nano bobchat.py

# Save and exit

8) Link driver lib & sprites; run

# Link Waveshare Python lib into the project for imports
ln -s "$HOME/LCD_Module_RPI_code/RaspberryPi/python/lib" "$HOME/voice-chatbot/lib"

# Sprites/images for Bob UI (optional but recommended)
git clone https://github.com/OminousIndustries/Bob_Images.git ~/voice-chatbot/sprites

# Run Bob chat (replace with your mic Source ID)
MIC_TARGET=<source-id> python3 bobchat.py

Quick Reference

# Devices & routing
wpctl status
wpctl set-default <sink-or-source-id>

# Audio tests
pw-play /usr/share/sounds/alsa/Front_Center.wav
pw-record --rate 44100 --channels 1 test.wav

# Bluetooth pairing (inside bluetoothctl)
power on
agent on
default-agent
scan on
pair XX:XX:XX:XX:XX:XX
trust XX:XX:XX:XX:XX:XX
connect XX:XX:XX:XX:XX:XX
exit

# Core services
sudo systemctl enable --now bluetooth
systemctl --user enable --now pipewire wireplumber pipewire-pulse
sudo loginctl enable-linger $USER

# Ollama
sudo systemctl enable --now ollama
ollama pull gemma3:270m
ollama run gemma3:270m "Say hello"

Notes

  • Replace placeholders like <sink-id>, <source-id>, and XX:XX:XX:XX:XX:XX with values from wpctl status and bluetoothctl.
  • Re-activate the venv in new shells: source ~/voice-chatbot/.venv/bin/activate.
  • On Pi 5, prefer lgpio/rpi-lgpio; legacy RPi.GPIO is removed above to avoid conflicts.

About

A Raspberry Pi Local AI Chatbot with a twist

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages