Skip to content

Google AIY projects

Art edited this page Jul 29, 2017 · 4 revisions

download

browse to [https://dl.google.com/dl/aiyprojects/voice/aiyprojects-latest.img.xz]

save image file

write distro to flash

MEDIA_DEVICE=sdb2
MEDIA_LABEL=u50_SPAI
IMAGE_FILENAME=aiyprojects-2017-05-03.img.xz
NEWHOSTNAME=pi-aiy
  • [https://github.com/artmg/MuGammaPi/wiki/Raspbian-basics]
    • include WIFI
    • expand
    • ssh
  • [https://github.com/artmg/MuGammaPi/wiki/Remote-Desktop]
    • distro already had realvnc-vnc-server
    • set vnc password

to connect to desktop session

ssh pi@pi-aiy -L 5901:localhost:5901
vncserver

# from different terminal session...
xtightvncviewer localhost:1

start using

  • [https://aiyprojects.withgoogle.com/voice/#users-guide]

use remotely

This assumes you are using a screen connected directly to the pi. Actually, if you are using SSH to connect remotely, you will find:

  • a local browser is much more responsive for the GCP cloud config
  • you can push the JSON config files down using SCP file transfer
    • or use SFTP to transfer more
    • see [https://github.com/artmg/lubuild/blob/master/help/configure/Networked-Services.md#sftp]

To start a "Developer Terminal" from the command line, rather than go via the desktop, simply execute the following:

~/bin/voice-recognizer-shell.sh

and exit when you've finished.

automatically start

# enable automatic startup when powering up
sudo systemctl enable voice-recognizer

# start the service now
sudo systemctl start voice-recognizer

# check the last few console messages
sudo journalctl -u voice-recognizer -n 20 --no-pager

# restart if you have changed the code of config settings
sudo systemctl restart voice-recognizer

edit code remotely

Share the pi home folder with samba so you can edit code in your local gui with your preferred text editor / IDE.

# To install Samba for Windows-compatible shares see 
# [https://github.com/artmg/lubuild/blob/master/help/configure/network-shares-with-Samba.md] 
# and use the following config in smb.conf.master

[global]
	server string = Pi AIY Google Assistant

	# authenticate per-user rather than per-share
	security = user
	# use the local /etc/passwd and shadow files
	passdb backend = plaintext


[PiHome]
	comment = Pi user home folder for editing code
	path = /home/pi/
	read only = No
	valid users = pi

browse the main source and look through issues

To find the source code for the AIY projects see [https://github.com/google/aiyprojects-raspbian] and the Google Assistant SDK at [https://github.com/googlesamples/assistant-sdk-python]

other useful hints

  • How to Update from the latest Github Source
    • [https://github.com/google/aiyprojects-raspbian/issues/72#issuecomment-305202298]
    • if you have changed any source, it may error out
      • use git checkout path/file to loose your changes
  • voice quality
    • first try updating source
    • check [https://www.raspberrypi.org/forums/viewtopic.php?f=114&t=188515]
    • [https://www.raspberrypi.org/forums/viewtopic.php?f=114&t=182384]
      • older ideas for improving voice quality
      • and setting initial volume
  • Simple intro to project building with AIY
    • [https://projects.raspberrypi.org/en/projects/rpi-python-google-aiy]
  • Raspberry Pi Forum for AIY projects
    • [https://www.raspberrypi.org/forums/viewforum.php?f=114]

Integrating with Home Automation systems

  • MuGammaPi article on Home Automation
    • [https://github.com/artmg/MuGammaPi/wiki/home-automation]
  • domoticz integration
    • announcement
      • [https://www.domoticz.com/forum/viewtopic.php?t=17377]
    • someone says they've done it, without mentioning how
      • [https://www.raspberrypi.org/forums/viewtopic.php?f=114&t=182256]
  • pimatic google section
    • [https://forum.pimatic.org/tags/google]
  • Using Google Assistant with IF This Then That (IFTTT)
    • [https://ifttt.com/google_assistant]
  • try other voice services, like Amazon Alexa or IBM Watson
    • [https://www.allaboutcircuits.com/news/the-open-source-google-assistant-joins-the-raspberry-pi-ai-movement/]