This page describes how to install all software for an AIY Vision Bonnet or Voice Bonnet.
If you're updating an existing AIY kit or starting from scratch, we recommend you install our pre-built image. But if you have your own Raspbian system that you'd like to use with an AIY kit, then you can install our software on your existing Raspbian system.
To flash our latest pre-built system image onto an SD card, follow these steps:
- Download the latest
.img.xzfile from our releases page on GitHub. (For release details, see the Change log.) - Plug-in your MicroSD card to your computer with an adapter.
- Use a program such as balenaEtcher to flash the
.img.xyfile onto your MicroSD card. (balenaEtcher is free and works on Windows, Mac, and Linux.)
When flashing is done, put the MicroSD card back in your kit and you're good to go!
Follow these steps to install the AIY drivers and software onto an existing Raspbian system.
Note: This process is compatible with Raspbian Buster (2019-06-20) or later only. Before you start, be sure you have the latest version of Raspbian.
Add AIY package repo:
echo "deb https://packages.cloud.google.com/apt aiyprojects-stable main" | sudo tee /etc/apt/sources.list.d/aiyprojects.listAdd Google package keys:
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -Update and install the latest system updates (including kernel):
sudo apt-get update
sudo apt-get upgradeReboot after update:
sudo rebootThis package is needed only if you're using the light-up RGB button that's included with the Vision/Voice Bonnet:
sudo apt-get install -y leds-ktd202x-dkmsRun sudo modprobe leds_ktd202x to load the driver and sudo modprobe -r leds_ktd202x to
unload it. Vision/Voice Bonnet does this automatically via built-in device tree overlay
saved in the board's EEPROM.
This package is needed only if you're using the piezo buzzer included with the Vision Bonnet:
sudo apt-get install -y pwm-soft-dkmsThis package is needed only if you're using Ethernet-over-USB on Pi Zero:
sudo apt-get install -y aiy-usb-gadgetDefault Pi IP address is 192.168.11.2, host IP address will be assigned automatically.
In order to make the Pi work with the AIY Projects app:
sudo apt-get install -y aiy-bt-prov-serverUse the following commands to install packages for either the Vision Bonnet or the Voice Bonnet/HAT.
Install the bonnet drivers:
sudo apt-get install -y aiy-vision-dkmsInstall the example vision models:
sudo apt-get install -y aiy-modelsEnable camera module:
echo "start_x=1" | sudo tee -a /boot/config.txtSet GPU memory to 128MB:
echo "gpu_mem=128" | sudo tee -a /boot/config.txtMake sure to not use GPIO6 for SPI0 (required since 5.4 kernel):
echo "dtoverlay=spi0-1cs,cs0_pin=7" | sudo tee -a /boot/config.txtReboot:
sudo rebootThen verify that dmesg output contains Myriad ready message:
dmesg | grep -i "Myriad ready"You can also verify that camera is working fine by watching video on the connected monitor:
raspivid -t 0Or use ffplay to get video output on the host machine:
ssh pi@raspberrypi.local "raspivid --nopreview --timeout 0 -o -" | ffplay -loglevel panic -Voice HAT does not require any driver installation. You only need to load device tree overlay on boot:
echo "dtoverlay=googlevoicehat-soundcard" | sudo tee -a /boot/config.txtVoice Bonnet requires driver installation:
sudo apt-get install -y aiy-voicebonnet-soundcard-dkmsDisable built-in audio:
sudo sed -i -e "s/^dtparam=audio=on/#\0/" /boot/config.txtInstall 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.confYou may also need to disable module-suspend-on-idle PulseAudio module for the
Voice HAT:
sudo sed -i -e "s/^load-module module-suspend-on-idle/#load-module module-suspend-on-idle/" /etc/pulse/default.paReboot:
sudo rebootThen verify that you can record audio:
arecord -f cd test.wav...and play a sound:
aplay test.wavAdditionally, the Voice Bonnet/HAT requires access to Google Cloud APIs. To complete this setup, follow the [Voice Kit setup instructions][aiy-voice-setup].
Finally, you need to install the AIY Projects Python library.
First make sure you have git installed:
sudo apt-get install -y gitThen clone this aiyprojects-raspbian repo from GitHub:
git clone https://github.com/google/aiyprojects-raspbian.git AIY-projects-pythonAnd now install the Python library in editable mode:
sudo pip3 install -e AIY-projects-pythonThe following is just a reference of all packages that are installed when you follow the above steps.
-
aiy-dkmscontains MCU drivers:aiy-io-i2c— firmware update supportpwm-aiy-io— PWM sysfs interfacegpio-aiy-io— GPIO sysfs interfaceaiy-adc— Industrial I/O ADC interface
-
aiy-io-mcu-firmwarecontains MCU firmware update service -
leds-ktd202x-dkmscontainsleds-ktd202xLED driver -
pwm-soft-dkmscontainspwm-softsoftware PWM driver
-
aiy-vision-dkmscontainsaiy-visionMyriad driver -
aiy-vision-firmwarecontains Myriad firmware -
aiy-modelscontains models for on-device inference:- Face Detection
- Object Detection
- Image Classification
- Dish Detection
- Dish Classification
- iNaturalist Classification (plants, insects, birds)
-
aiy-voicebonnet-soundcard-dkmscontains sound drivers:rl6231rt5645snd_aiy_voicebonnet
By default, Voice Hat needs dtoverlay added in the /boot/config.txt file. This is because the dtb is not flashed in the eeprom of Voice Hat by Google. If autodetection is desired, perform the following steps to flash patched eeprom image to your hat.
git clone https://github.com/raspberrypi/hats
cd hats/eepromutils
makewget https://raw.githubusercontent.com/viraniac/aiyprojects-raspbian/aiyprojects/eeprom/voicekit_v1.eepsudo dtoverlay i2c-gpio i2c_gpio_sda=0 i2c_gpio_scl=1 bus=9
sudo ./eepflash.sh -r -t=24c32 -f=stock.eepThis can be done either by bridging the jumper at JP5 located on top of the hat or by grounding the TP5 testpad located below the hat.
While keeping the write protection disabled, run the following command to flash the patched eep file
sudo ./eepflash.sh -w -t=24c32 -f=voicekit_v1.eepThe Voice Hat will now get autodetected after reboot and will have its drivers automatically loaded as they are built into the official Raspbian kernel. Source code for the Voice Hat drivers can be found here.