• Stars
    star
    341
  • Rank 123,998 (Top 3 %)
  • Language
    Python
  • Created about 7 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Headless Google Assistant and Alexa on Raspberry Pi

Assistants-Pi

One installer for both Google Asistant and Amazon Alexa

Simultaneously run Google Assistant and Alexa on Raspberry Pi


If you like the work, find it useful and if you would like to get me a ☕ 😄 paypal


Note:

18/01/2020: Routine update and bug fixes.


Before Starting the setup


For Google Assistant

  1. Create a project in the Google's Action Console.
  2. Download credentials--->.json file (refer to this doc for creating credentials https://developers.google.com/assistant/sdk/develop/python/config-dev-project-and-account)

For Amazon Alexa

  1. Create a security profile for alexa-avs-sample-app if you already don't have one.
    https://github.com/alexa/avs-device-sdk/wiki/Create-Security-Profile

  2. Download the "config.json" file.


Setup Amazon Alexa, Google Assistant or Both


  1. Clone the git using:
git clone https://github.com/shivasiddharth/Assistants-Pi  

DO NOT RENAME THE CREDENTIALS FILEs
Place the Alexa config.json in file in the /home/pi/Assistants-Pi/Alexa directory.
Place the Google client_secret.....json file in the /home/pi/ directory.

  1. Make the installers executable using:
sudo chmod +x /home/pi/Assistants-Pi/scripts/prep-system.sh    
sudo chmod +x /home/pi/Assistants-Pi/scripts/audio-test.sh   
sudo chmod +x /home/pi/Assistants-Pi/scripts/installer.sh  
  1. Prepare the system for installing assistants by updating, upgrading and setting up audio using:
sudo /home/pi/Assistants-Pi/scripts/prep-system.sh
  1. Restart the Pi using:
sudo reboot
  1. Make sure that contents of asoundrc match the contents of asound.conf
    Open a terminal and type:
sudo nano /etc/asound.conf

Open a second terminal and type:

sudo nano ~/.asoundrc

If the contents of .asoundrc are not same as asound.conf, copy the contents from asound.conf to .asoundrc, save using ctrl+x and y

  1. Bonus Script - Test the audio setup using the following code (optional). Dont panic if the test does not go through successfully, proceed with the installation:
sudo /home/pi/Assistants-Pi/scripts/audio-test.sh  
  1. Restart the Pi using:
sudo reboot
  1. Install the assistant/assistants using the following. This is an interactive script, so just follow the onscreen instructions:
sudo /home/pi/Assistants-Pi/scripts/installer.sh  
  1. After verification of the assistants, to make them auto start on boot:

Open a terminal and run the following commands:

sudo chmod +x /home/pi/Assistants-Pi/scripts/service-installer.sh
sudo /home/pi/Assistants-Pi/scripts/service-installer.sh  

For Alexa:

sudo systemctl enable alexa.service  

For Google Assistant:

sudo systemctl enable google-assistant.service  
  1. Authorize Alexa before restarting
sudo /home/pi/Assistants-Pi/Alexa/startsample.sh  

Manually Start The Alexa Assistant

Double click start.sh file in the /home/pi/Assistants-Pi/Alexa folder and choose to "Execute in the Terminal".

Manually Start The Google Assistant

Open a terminal and execute the following:

/home/pi/env/bin/python -u /home/pi/Assistants-Pi/Google-Assistant/src/main.py --project_id 'replace this with the project id '--device_model_id 'replace this with the model id'

If you have issues with the Assistants strating on boot, you may have to setup PulseAudio as a system wide service. For further details refer this git https://github.com/shivasiddharth/PulseAudio-System-Wide

More Repositories

1

GassistPi

Google Assistant for Single Board Computers
Python
1,017
star
2

Stremio-RaspberryPi

Installer for Stremio on Raspberry Pi
151
star
3

pi-shut

Shell
42
star
4

DIY-Echo-Show

Make your own Amazon Echo Show using avs-device-sdk and alexa-smart-screen-sdk
Python
35
star
5

iotwemos

Wemos D1 Mini Projects
C++
32
star
6

custom-voice-hat

DIY Voice HAT like AIY Projects Kit HAT
C
23
star
7

PulseAudio-System-Wide

Git to help you setup pulse audio as a system wide service. this has been tested and found to work on Raspberry Pi
20
star
8

Spotify-Playlist-Player

Scripts to play your spotify playlist.
Python
14
star
9

headless-alexa-avs-sample-app

Autostart the Amazon alexa-avs-sample-app on boot on a headless Raspberry Pi
Shell
14
star
10

pi-gcast-remote

Remote control for Google Cast Devices using Raspberry Pi
Python
12
star
11

Raspberry-Pi-Pico

Aggregate of Raspberry Pi Pico related codes and frimware
Python
12
star
12

WiFi-Signal-Strength-Checker

Simple tool to check the WiFi strength at your office or home. Check WiFi signal strength using ESP8266(NodeMCU/Wemos).
C++
12
star
13

ngrok-service

Aid to start ngrok on boot
Shell
10
star
14

avs-device-sdk-pi

Easily trigger Alexa avs-device-sdk using Picovoice Porcupine.
Python
9
star
15

Flightaware-Parser

Script to parse flight data from flightaware.com
Python
5
star
16

piaware-python

Python script to acquire, view, filter, sort and manipulate ADSB data from piaware
Python
4
star
17

GassistPi-Documentation

Documentation for GassistPi
4
star
18

Voice_control_volumio

Control volumio speaker by voice using google assistant (IFTTT and MQTT)
Arduino
3
star
19

HomeAutomationHub

Using Adafruit IO or Local MQTT control devices like Sonoff-Tasmota, Domoticz, Emulated Wemo etc.
Python
1
star