- Open the terminal and execute the following
git clone https://github.com/shivasiddharth/GassistPi
Install audio config files- Update OS and Kernel
sudo apt-get update sudo apt-get install raspberrypi-kernel
- Restart Pi
- Choose the audio configuration according to your setup.The speaker-test command is used to initialize alsa, so please do not skip that.AIY-HAT and CUSTOM-HAT users, please reboot the Pi at places mentioned, else it will lead to audio and taskbar issues.
3.1. USB DAC or USB Sound CARD users:
sudo chmod +x /home/pi/GassistPi/audio-drivers/USB-DAC/scripts/install-usb-dac.sh
sudo /home/pi/GassistPi/audio-drivers/USB-DAC/scripts/install-usb-dac.sh
speaker-test
3.2. AIY-HAT users:
sudo chmod +x /home/pi/GassistPi/audio-drivers/AIY-HAT/scripts/configure-driver.sh
sudo /home/pi/GassistPi/audio-drivers/AIY-HAT/scripts/configure-driver.sh
sudo reboot
sudo chmod +x /home/pi/GassistPi/audio-drivers/AIY-HAT/scripts/install-alsa-config.sh
sudo /home/pi/GassistPi/audio-drivers/AIY-HAT/scripts/install-alsa-config.sh
speaker-test
3.3. USB MIC AND HDMI users:
sudo chmod +x /home/pi/GassistPi/audio-drivers/USB-MIC-HDMI/scripts/install-usb-mic-hdmi.sh
sudo /home/pi/GassistPi/audio-drivers/USB-MIC-HDMI/scripts/install-usb-mic-hdmi.sh
speaker-test
3.4. USB MIC AND AUDIO JACK users:
sudo chmod +x /home/pi/GassistPi/audio-drivers/USB-MIC-JACK/scripts/usb-mic-onboard-jack.sh
sudo /home/pi/GassistPi/audio-drivers/USB-MIC-JACK/scripts/usb-mic-onboard-jack.sh
speaker-test
3.5. CUSTOM VOICE HAT users:
sudo chmod +x /home/pi/GassistPi/audio-drivers/CUSTOM-VOICE-HAT/scripts/install-i2s.shsudo /home/pi/GassistPi/audio-drivers/CUSTOM-VOICE-HAT/scripts/install-i2s.sh
sudo reboot
sudo chmod +x /home/pi/GassistPi/audio-drivers/CUSTOM-VOICE-HAT/scripts/custom-voice-hat.sh
sudo /home/pi/GassistPi/audio-drivers/CUSTOM-VOICE-HAT/scripts/custom-voice-hat.sh
speaker-test
Those Using HDMI/Onboard Jack, make sure to force the audio:
sudo raspi-config
Select advanced options, then audio and choose to force audio.
Those using any other DACs or HATs install the cards as per the manufacturer's guide and then you can try using the USB-DAC config file after changing the hardware ids.
- Restart Pi
- Check the speaker using the following command
speaker-test -t wav
Continue after setting up audio- Download credentials--->.json file (refer to this doc for creating credentials https://developers.google.com/assistant/sdk/develop/python/config-dev-project-and-account)
- Place the .json file in/home/pi directory DO NOT RENAME
- Use the one-line installer for installing Google AssistantPi3 and Armv7 users use the "gassist-installer-pi3.sh" installer and Pi Zero, Pi A and Pi 1 B+ users use the "gassist-installer-pi-zero.sh" installer.4.1 Make the installers Executable
sudo chmod +x /home/pi/GassistPi/scripts/gassist-installer-pi3.sh
sudo chmod +x /home/pi/GassistPi/scripts/gassist-installer-pi-zero.sh
4.2 Execute the installers Pi3 and Armv7 users use the "gassist-installer-pi3.sh" installer and Pi Zero, Pi A and Pi 1 B+ users use the "gassist-installer-pi-zero.sh" installer. When Prompted, enter your Google Cloud console Project-Id, A name for your Assistant and the Full Name of your credentials file, including the json extension.
sudo /home/pi/GassistPi/scripts/gassist-installer-pi3.sh
sudo /home/pi/GassistPi/scripts/gassist-installer-pi-zero.sh
- Copy the google assistant authentication link from terminal and authorize using your google account
- Copy the authorization code from browser onto the terminal and press enter
- After successful authentication, the Google Assistant Demo test will automatically start. At the start, the volume might be low, the assistant volume is independent of the Pi volume, so increase the volume by using "Volume Up" command.
- After verifying the working of assistant, close and exit the terminal
- Open the service files in the /home/pi/GassistPi/systemd/ directory and add your project and model ids in the indicated places and save the file.
- Make the service installer executable
sudo chmod +x /home/pi/GassistPi/scripts/service-installer.sh
- Run the service installer
sudo /home/pi/GassistPi/scripts/service-installer.sh
- Enable the services - Pi3 and Armv7 users, enable the "gassistpi-ok-ggogle.service" and Pi Zero, Pi A and Pi 1 B+ users, enable "gassistpi-push-button.service"To stop music playback using a pushbutton connected to GPIO 23 enable stopbutton.service
sudo systemctl enable gassistpi-ok-google.service
sudo systemctl enable
sudo systemctl enable stopbutton.service
- Start the service - Pi3 and Armv7 users, start the "gassistpi-ok-ggogle.service" and Pi Zero, Pi A and Pi 1 B+ users, start "gassistpi-push-button.service"To stop music playback using a pushbutton connected to GPIO 23 start stopbutton.service
sudo systemctl start gassistpi-ok-google.service
sudo systemctl start
sudo systemctl start stopbutton.service
Casting YouTube Videos to ChromecastDefault command for casting YouTube videos is Play Desired Video on Chromecast, with Chromecast as the trigger word. Example: Hey Google, Play MasterChef Season 1 Episode 1 on Chromecast casts the MasterChef YouTube Video.
Note: YouTube casting to Chromecast using third party scripts has been blocked, so I have taken a roundabout approach and as a result, you may not find the usual YouTube interface on Chromecast.
Controlling Chromecast by VoiceFirst, add the IP-Address of your Chromecast in the actions.py script, in the indicated location.
Following are the default commands for controlling Chromecast with Chromecast as the trigger word. Pausing: Hey Google, Pause Chromecast.
- Resuming: Hey Google, Resume Chromecast
- Stopping: Hey Google, End Chromecast
- Change volume up/down:Hey Google, Chromecast Volume Up/Down
For other features and details, please checkout the git: https://github.com/shivasiddharth/GassistPi
Comments