Introduction: Google Assistant on a Raspberry Pi

Picture of 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.

Step 1: What You'll Need

Step 2: Set Everything Up

Picture of 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.

Step 3: Download Everything We Need

Picture of 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"

Step 4: In Case You Run Into Trouble

Picture of 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

Step 5: Run the Google Assistant

Picture of 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.

Comments

kamhagh (author)2017-10-31

when using SSH how can I leave it working without having to leave ssh open

JimH265 (author)2017-10-04

Hi,

I am getting an error. "No module googlesamples.assistant.auth_helpers".

Can anyone help

SimonF90 (author)JimH2652017-10-19

hey there, im getting the same result:

: no module named googlesamples.assistan.auth.

Did you get this resolved at all?

AntonK67 (author)2017-05-12

Thank you for great instructions, I'd really like to make it work, you mentioned about questions, so I'll ask a few if you don't mind.

1. Is it possible to make it work without GUI on raspberry, only with console?

2. I've seen you have plans of voice triggering, is there some forecasts on progress, sounds really exciting.

3. Is there a way to make it work with bluetooth speaker/mic with integrated bluetooth adapter or should I try to try use usb dongle?

FredricP (author)AntonK672017-08-08

1. You don't need a GUI on the Rpi. But you need to verify your account at some point which is done on any device.

2. There is a voice activate command called googlesamples-assistant-hotword that listens for "Ok Google" or "Hey Google".

3. You can use BT-spekers or USB ones, it really doesn't matter. The thing is that you'll need to find the sounddevices and add them to your .asoundrc-file with the right settings.

sonic136 (author)2017-07-12

Good instructions, however there are some mistakes in the coding:

sudo apt-get install portaudio-19-dev libffi-dev libssl-dev should be

sudo apt-get install portaudio19-dev libffi-dev libssl-dev

and

python -m pip install googleassistant-sdk[samples] should be

python -m pip install google-assistant-sdk[samples]

TobiasB45 (author)2017-06-08

Error while finding spec for googlesamples.assistant.

seems like google changed something. any ideas?

ynakamura3 (author)2017-05-14

after get credential authorised, i key in the last line python -m googlesamples.assistant, then enter.

But nothing show , it is not working

it only show no module googlesamples.assistant.

Why ?

VijayS177 (author)ynakamura32017-06-03

Hi,

I am getting same message. "No module googlesamples.assistant.auth_helpers". Did you get to fix this issue. If so can you please advice how you fixed it.

Thanks,

Vijay.

ynakamura3 (author)2017-05-14

can i use earphone mic instead of usb mic?

About This Instructable

8,861views

84favorites

License:

Bio: Avid Thinker, Computer Programmer, Web evangelist, Hacking / Breaking expert, Problem Solver, Technology Obsessed, Gamer, 3D printing, Coffee lover!
More by novaspirittech:Voice Activated Google Assistant for Raspberry PiGoogle Assistant on a Raspberry PiButton Trigger for Google Assistant on the Raspberry Pi
Add instructable to: