Last active
June 5, 2017 11:48
-
-
Save rockstarartist/0c8ef707cc21782fd8dbaa46a3b37ed5 to your computer and use it in GitHub Desktop.
Install Google Assistant on Raspberry Pi Zero W
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
//List all recording devices | |
arecored -l | |
//List all audio playing devices | |
aplay -l | |
// create a .asoundrc file | |
cd /home/pi | |
touch .asoundrc | |
vi .asoundrc | |
//Include the following in your .asoundrc file: | |
pcm.!default { | |
type asym | |
capture.pcm "mic" | |
playback.pcm "speaker" | |
} | |
pcm.mic { | |
type plug | |
slave | |
{ | |
pcm "hw:1,0" | |
} | |
} | |
pcm.speaker { | |
type plug | |
slave | |
{ | |
pcm "hw:1,0 | |
} | |
} | |
sudo apt-get install python3-dev python3-venv | |
python3 -m venv env | |
env/bin/python -m pip install --upgrade setuptools | |
sudo apt-get install git | |
source env/bin/activate | |
git clone https://github.com/googlesamples/assistant-sdk-python | |
cp -r assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/grpc ./ZeroExample | |
python -m pip install --upgrade --google-auth-oauthlib[tool] | |
google-oauthlib-tool --client-secrets <pathtojsonfile> --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless | |
// credentials get saved here: /home/pi/.config/google-oauthlib-tool/credentials.json | |
sudo apt-get install portaudio19-dev libffi-dev libssl-dev | |
//Following command takes a while to install on Rasp Zero, 30+ minutes | |
pip install --upgrade google-assistant-grpc | |
//10+ minutes, the requirements.txt file is located in zero example folder | |
pip install --upgrade -r requirements.txt | |
pip install --upgrade urllib3 | |
//In ZeroExample directory, run this to test everything | |
python3 -m audio_helpers | |
//Run this to do push to talk with rasp-pi & google assistant | |
python3 -m pushtotalk | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment