Setup Google Developer Project
For Developer Project configuration account settings follow steps described in Google guide Configure a Developer Project and Account Settings.
Next step is device registration. Also follow steps described in Google guide Register the Device Model.
Google samples will attach audio to default devices. You need to configure audio as described in Getting Started->Software
Install and Run Python Google Assistant
If you are not using our OS image you need to install SDK
sudo apt-get update
sudo apt-get install python3-dev python3-pip
sudo apt-get install portaudio19-dev libffi-dev libssl-dev
Install SDK and authorization tool
python3 -m pip install --upgrade google-assistant-sdk[samples]
python3 -m pip install --upgrade google-auth-oauthlib[tool]
Generate credentials to be able to run the sample code and tools. Reference the JSON file you downloaded in a previous step; you may need to copy it the device. Do not rename this file.
google-oauthlib-tool --scope https://www.googleapis.com/auth/assistant-sdk-prototype \
--save --headless --client-secrets /path/to/client_secret_client-id.json
You should see a URL displayed in the terminal
Please visit this URL to authorize this application: https://...
After you approve the permission request from the API, a code will appear in your browser, such as "4/XXXX". Copy and paste this code into the terminal. If authorization was successful, you will see a response similar to the following
credentials saved: /path/to/.config/google-oauthlib-tool/credentials.json
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:~/<path to saraKIT>/GoogleAssistant/libs/lib/pkgconfig/
Get credentials file. It must be an end-user's credentials. Go to the Actions Console and register your device model, following these instructions. Go to SaraKIT/tree/main/GoogleAsistant/src and move it in this folder and rename it to client_secret.json run get_credentials.sh. It will create the file credentials.json.
now you can simply run sampleAssistant
You can find C++ and Python code for Raspberry Pi4 in the
SaraKIT Github repository: