Situatie
Step 1: Install Operating System
- Download Raspberry Pi OS Lite (no desktop required)
- Flash it using Raspberry Pi Imager or Balena Etcher
- Enable SSH (optional but recommended):
- Place an empty file named
sshin the boot partition
- Place an empty file named
- Boot your Raspberry Pi and connect:
Step 3: Plug in your microphone and speaker, then run:
aplay -l
Test recording:
aplay test.wav
If you hear playback, your audio setup is working correctly.
Step 4: Enable Google Assistant API
- Go to Google Cloud Console
- Create a new project
- Enable the Google Assistant API
- Create credentials:
- OAuth Client ID
- Choose “Desktop App”
- Download the JSON credentials file to your Raspberry Pi
Step 5: Install Google Assistant SDK
Install dependencies:
Create a virtual environment:
source env/bin/activate
Install required Python packages:
pip install google-assistant-sdk[samples]
pip install google-auth-oauthlib
Step 6: Authenticate
Run:
–scope https://www.googleapis.com/auth/assistant-sdk-prototype \
–save –headless
Follow the provided link, log in, and paste the authentication code back into the terminal.
Step 7: Run Google Assistant
Test the assistant:
Press Enter, speak your command, and the assistant should respond.
Step 8: Enable Hotword (“Hey Google”)
The official SDK does not currently support native hotword detection, but you have two options:
Option A: Push-to-talk
- Use keyboard input or a physical button to trigger listening
Option B: Third-party wake word engines
- Snowboy (deprecated but still usable)
- Porcupine (recommended alternative)
Step 9: Auto-Start on Boot
Create a systemd service:
Example configuration:
Description=Google Assistant[Service]
User=pi
WorkingDirectory=/home/pi
ExecStart=/home/pi/env/bin/googlesamples-assistant-pushtotalk –project-id YOUR_PROJECT_ID
Restart=always
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl start googlepi.service
Leave A Comment?