Skip to content

Latest commit

 

History

History
193 lines (148 loc) · 4.8 KB

HACKING.md

File metadata and controls

193 lines (148 loc) · 4.8 KB

Setting up the image

Overview

We periodically update the SD card image that supports both the Vision Kit and Voice Kit. Each release is based on Raspbian, with a few customizations, and they are tested on various Raspberry Pi models.

To update your system image, download the latest .img.xz file from our releases page. Once downloaded, write the image to your SD card, and you're good to go!

If you prefer to setup Raspbian yourself, follow the steps below.

AIY Debian Package Repo

Add AIY package repo:

echo "deb https://dl.google.com/aiyprojects/deb stable main" | sudo tee /etc/apt/sources.list.d/aiyprojects.list

Add Google package keys from https://www.google.com/linuxrepositories/:

wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

Update and install the latest system updates (including kernel):

sudo apt-get update
sudo apt-get upgrade

Reboot after update:

sudo reboot

AIY Debian Packages

Vision and Voice Bonnets

  • aiy-dkms contains MCU drivers:

    • aiy-io-i2c — firmware update support
    • pwm-aiy-ioPWM sysfs interface
    • gpio-aiy-ioGPIO sysfs interface
    • aiy-adcIndustrial I/O ADC interface
  • aiy-io-mcu-firmware contains MCU firmware update service

  • leds-ktd202x-dkms contains leds-ktd202x LED driver

  • pwm-soft-dkms contains pwm-soft software PWM driver

  • aiy-python-wheels contains optimized protobuf python wheel (until this issue is fixed) along with Google Assistant Library for different Raspberry Pi boards.

Vision Bonnet

  • aiy-vision-dkms contains aiy-vision Myriad driver

  • aiy-vision-firmware contains Myriad firmware

  • aiy-models contains models for on-device inference:

    • Face Detection
    • Object Detection
    • Image Classification
    • Dish Detection
    • Dish Classification
    • iNaturalist Classification (plants, insects, birds)

Voice Bonnet

  • aiy-voicebonnet-soundcard-dkms contains sound drivers:

    • rl6231
    • rt5645
    • snd_aiy_voicebonnet

AIY Setup

Vision Bonnet (minimal)

Install drivers:

sudo apt-get install -y aiy-vision-dkms

Install package with models:

sudo apt-get install -y aiy-models

Install optimized protobuf library for better performance:

sudo apt-get install -y aiy-python-wheels

Reboot:

sudo reboot

and verify that dmesg output contains Myriad ready message:

dmesg | grep -i "Myriad ready"

Voice Bonnet (minimal)

Install drivers:

sudo apt-get install -y aiy-voicebonnet-soundcard-dkms aiy-dkms

Install PulseAudio:

sudo apt-get install -y pulseaudio
sudo mkdir -p /etc/pulse/daemon.conf.d/
echo "default-sample-rate = 48000" | sudo tee /etc/pulse/daemon.conf.d/aiy.conf

Install optimized protobuf and google-assistant-library:

sudo apt-get install -y aiy-python-wheels

Reboot:

sudo reboot

and verify that you can record

arecord -f cd test.wav

and play a sound:

aplay test.wav

Vision and Voice Bonnet (additional)

Install LED driver to control button RGB LED:

sudo apt-get install -y leds-ktd202x-dkms

Install software PWM driver to control buzzer:

sudo apt-get install -y pwm-soft-dkms

Reboot:

sudo reboot

Python Library

Installation

Make sure you already installed aiy-python-wheels:

sudo apt-get install -y aiy-python-wheels

Install git first:

sudo apt-get install -y git

Then clone aiyprojects-raspbian repo from GitHub:

git clone https://github.com/google/aiyprojects-raspbian.git AIY-projects-python

And install library in editable mode:

sudo pip3 install -e AIY-projects-python/src

Cloud access for Voice HAT or Voice Bonnet

To access the cloud services you need to register a project and generate credentials for cloud APIs. This is documented in the setup instructions on the webpage.