Saturday, November 17, 2018

headless-alexa-avs-sample-app

headless-alexa-avs-sample-app
Scripts to autostart the Amazon alexa-avs-sample-app on boot on a headless Pi

This does not modify your installed alexa-avs-sample-app in any manner. Please do not open issues relating to the working of alexa-avs-sample-app here. Post your issues pertaining to the running of services alone here.

Install the alexa-avs-sample-app and first make sure that it is working fine and after that follow the guidelines given below.
  1. Clone the git using:
git clone https://github.com/shivasiddharth/headless-alexa-avs-sample-app  
  1. Check and verify the path of the installed alexa-avs-sample-app in the clientstart.sh, companionstart.sh and wakeword.sh scripts
  2. Make the installer executable using:
sudo chmod +x /home/pi/headless-alexa-avs-sample-app/installer.sh  
  1. Execute the installer:
sudo /home/pi/headless-alexa-avs-sample-app/installer.sh  

Friday, November 16, 2018

One installer for both Google Assistant and Amazon Alexa

One installer for both Google Assistant and Amazon Alexa

Simultaneously run Google Assistant and Alexa on Raspberry Pi

 Image result for One installer for both Google Assistant and Amazon Alexa Simultaneously run Google Assistant and Alexa on Raspberry Pi

For Google Assistant
  1. Download credentials--->.json file (refer to this doc for creating credentials https://developers.google.com/assistant/sdk/develop/python/config-dev-project-and-account)
  2. Place the .json file in/home/pi directory
  3. DO NOT RENAME THE JSON FILE
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

Setup Amazon Alexa, Google Assistant or Both

  1. Clone the git using:
git clone https://github.com/shivasiddharth/Assistants-Pi  
  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. Test the audio setup using:
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:
    Pi 3 and Pi2 users, open the gassistpi-ok-google.service in the /home/pi/Assistants-Pi/systemd folder and add your project-id and model-id in the indicated points.
Pi Zero users, open the gassistpi-push-button.service in the /home/pi/Assistants-Pi/systemd folder and add your project-id and model-id in the indicated points.
After that, 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  
#If using Pi 2B or Pi 3B
For Alexa:
sudo systemctl enable alexa.service  
For Google Assistant:
sudo systemctl enable gassistpi-ok-google.service  
#If using Pi zero
For Alexa:
sudo systemctl enable alexa.service  
For Google Assistant:
sudo systemctl enable gassistpi-push-button.service
  1. Authorize Alexa before restarting
sudo /home/pi/Assistants-Pi/Alexa/startsample.sh  

Manually Start The Google Assistant

At any point of time, if you wish to manually start the assistant:
Ok-Google Hotword/Pi3/Pi2/Armv7 users
Open a terminal and execute the following:
/home/pi/env/bin/python -u /home/pi/GassistPi/src/main.py --device_model_id 'replace this with the model id'

Pushbutton/Pi Zero/Pi B+ and other users
Open a terminal and execute the following:
/home/pi/env/bin/python -u /home/pi/GassistPi/src/pushbutton.py --project-id 'replace this with your project id'  --device-model-id 'replace this with the model id'