AssistantPi: Bring both Google Assistant and Alexa to your Raspberry Pi

Hardware components:
Pi 3 02
Raspberry Pi 3 Model B
× 1
Generic Aux Speaker
× 1
USB Microphone
× 1
Software apps and online services:
Avs med 3 22
Amazon Alexa Alexa Voice Service
Aiy projects 4 bgsoumwo5r
Google AIY Projects
Hand tools and fabrication machines:
Generic USB Keyboard for Setup

 

Bring both Google Assistant and Alexa to your Raspberry Pi

STORY

Meet AssistantPi!

Google published it's Assistant SDK for the Raspberry Pi ten days ago. The avaiable sample app can be triggered via keyboard in the command line and it takes quite some steps to get it up and running. I've been wondering, if there's a better way to do it – and AssistantPi was born 🙂

AssistantPi is basically a tweak of AlexaPi. It includes the Google Assistant SDK and uses AlexaPi's hotword recognition to activate either Assistant or Alexa. The installer provides an easy way to get everything set up in just under an hour.

You can find the Github Repository here.

Credits / Further Resources:

Requirements

You will need:

  • A Raspberry Pi and an SD Card with a fresh install of Raspbian
  • external speaker with 3.5mm Jack
  • USB microphone

Assuming you already own a Raspberry Pi, the costs for the two are about ~€10, so it's worth a shot.

Installation

  • Have your Raspberry Pi running Raspbian ready and connected to the Internet. I recommend to use a fresh install of Raspbian Jessie Lite without Pixel.
  • Follow this Google Guide and place the Google Assistant Credentials JSON in /home/pi/Downloads/client_secret.json
  • Prepare Amazon AVS Credentials as described in Step 1 in AlexaPi Installation Guide, you'll need them during Installation. Even if you only want Google Assistant, this has to be done for AlexaPi to work properly.
  • Connect your audio peripherals (i.e. USB-Mic and Speaker via Jack).
  • Clone the repository to /opt directory and rename the folder to AlexaPi (both important, it will fail otherwise):
 cd /opt
 sudo git clone https://github.com/xtools-at/AssistantPi.git AlexaPi
  • Run the setup and go through all the steps. This will take a while, approx. 25min with a somewhat good Internet connection.
 sudo /opt/AlexaPi/src/scripts/setup.sh
  • If Authentication with Google Assistant API fails during setup, try to run it manually:
 /opt/AlexaPi/env/bin/python -m googlesamples.assistant.auth_helpers --client-secrets /home/pi/Downloads/client_secret.json
  • If you haven't opted for starting AssistantPi at boot, or the Installer threw an error during setup, start the script manually using python /opt/AlexaPi/src/main.py . Otherwise, it will be started automatically when the setup finishes.
  • Trigger Assistant and Alexa with the hotwords Google and Alexa

Setup problems

Please check the Github Repository's README for the most up-to-date information.

Audio problems

Make sure you've been to sudo raspi-config , Advanced Options > Audio and have set the desired audio output (i.e. 3.5mm Jack, not HDMI).

Please refer to the following guides if you encounter any audio problems:

Configure Google Assistant Audio Output

AlexaPi Audio Setup and Debugging

Read More: AssistantPi: Bring both Google Assistant and Alexa to your Raspberry Pi


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top