Google Assistant on a Raspberry Pi
by novaspirittech in Circuits > Raspberry Pi
21164 Views, 96 Favorites, 0 Comments
Google Assistant on a Raspberry Pi
On this Instructablel I will be showing you how you can install Google Assistant on your Raspberry Pi.
It's way more simple that you'll thought.
Hope that you like it and thanks for reading this.
What You'll Need
- A Raspberry Pi
- An USB Microphone
- Google Assistant's API
- A few dependencies
Set Everything Up
Log into your Raspberry Pi with Raspbian.
Open up a Web Browser and go to "www.console.cloud.google.com/console-resource-manager"
Click on "CREATE PROJECT"
Give it any name you like and click "Create"
Click on the three little lines at the top left of the page, then select "API Manager"
Click on "Enable API"
Type "Google assistant" on the search bar, this will make the searching process a lot quicker and easier.
Click on the "Google Assistant API" and then click "Enable"
Go to the bar on the left and select "Credentials" and then click on the "OAuth Consent Screen"
Here you can leave everything as default except for the Product's name, when you're finished hit "Save"
Hit on "Create Credentials", then select "OAuth client ID"
In the next screen, choose "Other" and give it any name that you want.
Hit "Ok" and then move your mouse over to an arrow pointing down at the right of the screen, click on it to download your Credentials file.
Download Everything We Need
Open up the Command Prompt.
Update your System.
Once it finishes, type in "sudo apt-get install python3-dev python3-venv" press "Enter" and wait for it to finish
Type in "sudo apt-get install portaudio-19-dev libffi-dev libssl-dev" and press "Enter"
When the download finishes, type in "python3 -m venv env"
Once you enabled that, type "env/bin/pip install pip setuptools --upgrade" and press "Enter"
Type "source env/bin/activate" to get into the enviroment.
Type in "python -m pip install googleassistant-sdk[samples] and press "Enter", the whole process should take around 15 minutes, so take your time and then come back.
Once it downloads, type in "python -m googlesamples.assistant.auth_helpers --client -secrets/*Location where you Downloaded the .json file of the previous step*/clients_secrets/*Your auth key number*.json"
Press "Enter" and it should ask you to go to a website, go to it, and when it loads, click on "Allow"
In Case You Run Into Trouble
In the case that it doesn't takes your authentication request, you need to head over to "myaccount.google/activitycontrols"
Scroll down and activate the following controls:
- Web & App Activity
- Location History
- Device Information
- Voice & Audio Activity
Run the Google Assistant
Go back to the command prompt and type "python -m googlesamples.assistant"
Press "Enter" and wait around aminute or two, and you should get a message confirming that Google Assistant is working correctly.
Enjoy your shiny new Raspberry Pi-based Google Assistant.
And that's it, I hope that you liked this Instructable, if you have any problem, suggestion or comment, leave it down below.