← Back to list

AIY Voice — Deprecation Workaround

I am a security nerd, I like to have nice things, but also don’t trust anyone. So, when google announce the AIY project for voice, it was…

Michael Brewer · 2020-03-13 17:59 · 21 claps · 2.9 min read
#aiy-projects #aiy #assistant #google #voice-assistant
Open on Medium ↗

AIY Voice — Deprecation Workaround

I am a security nerd, I like to have nice things, but also don’t trust anyone. So, when google announce the AIY project for voice, it was the best of both worlds: I can have the convenience of google home without the live mic or someone else computer in my house. I can hit the button when I want to use the service. I also get to know the exact code running on this thing.

As with all good things, they come to an end. With Google deprecating the assistant library in mid 2019, it broke getting full assistant use on the gear. I am also cheap, so buying something else is not in the cards when I have a perfectly good bonnet and Pi zero.

The running answer is to use one of the older images (from 2018), then go forth and prosper. However, I do not like having vulnerable software on my network and wanted to get the latest patches and packages. Doing an apt upgrade would overwrite the google packages and hose the AIY voice.

After many attempts I have found a repeatable solution to keep the needed packages AND upgrade stretch to patched version. It all became possible because Google’s cert experienced for the AIY repo.

  1. Download the 2018–11 image. This will get you stretch, not butcher.
  2. Using your favorite image loader (I used Pi Imager) load the SD Card.
  3. Boot the Pi as normal, change the password, set wireless info, but do not update, yet.
  4. Establish SSH connectivity to the device
  5. Run the verify audio steps to make sure your hardware is working (if not, re-run with an older image. We need to make sure this baseline will work.
  6. Execute Get Creds and validate some examples

Update the OS

At this point you have an outdated, but usable AIY google home. If you want to patch it continue.

SSH into your PI and run:

sudo apt update

Validate that the google repo errors out and is not secured. If you see that, continue.

Pull all the latest packages, Googles will not be pulled since the repo is not trusted (hehe)

sudo apt upgrade 

Reboot the machine

sudo reboot

Update SSL Handshake Packages

Now at this point you should have the latest Stretch version. Assistant local examples will work, but none of the assistant _library examples will run. We will need to update python components, a new random number generator all to get SSL handshakes working again. Make sure you have a working version of pip for both python 3 and 2 (though with the APT Update you should have Python 3).

sudo apt install python3-pip 
for Python 2.7 : sudo apt install python-pip

Update python open ssl :

pip install -U pyopenssl

Install a random number generator:

sudo apt install haveged

Enable Google Repo

At this point, we need to enable Google repo access to pull down drivers and other packages. We will remove this access later, don’t worry.

Update the certs on the pi:

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

Add the new Google repo :

echo “deb https://packages.cloud.google.com/apt aiyprojects-stable main” | sudo tee /etc/apt/sources.list.d/aiyprojects.list

Add the repo keys:

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

Update to get the available packages:

 sudo apt-get update

Install Google Packages

Following the instructions on Hacking.md from AIY we want to pull down just the necessary packages to get this working.

Update the button drivers:

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

Install the drivers:

sudo modprobe leds_ktd202x
sudo modprobe -r leds_ktd202x

Voice Bonnet:

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

We should not need this, but I did it anyway:

sudo sed -i -e “s/^dtparam=audio=on/#\0/” /boot/config.txt

Update the pulse audio package:

sudo apt-get install -y pulseaudio

Change the audio configs:

sudo mkdir -p /etc/pulse/daemon.conf.d/
echo “default-sample-rate = 48000” | sudo tee /etc/pulse/daemon.conf.d/aiy.conf

Block THE GOOGLES!!

Now the fun part, using your favorite editor, comment out the google repo so the assistant library packages will not be overwritten in the future.

sudo nano /etc/apt/sources.list.d/aiyprojects.list

Comment (#) the https://packages.cloud.google.com/apt aiyprojects-stable main line

Validate the google repo does not get called

sudo apt update 

Now run your python script for full assistant.

Stretch went EOL January of this year so my next test is to run a dist-upgrade. If that fails, a fresh buster image, but pull the needed packages from the 2018 image and see if I get the same results. Right now, everything is working.


메타데이터
post_id
bd07559403df
slug
aiy-voice-deprecation-workaround-bd07559403df
url
https://medium.com/@michaeldbrewer/aiy-voice-deprecation-workaround-bd07559403df
canonical_url
https://medium.com/@michaeldbrewer/aiy-voice-deprecation-workaround-bd07559403df
author_url
https://medium.com/@michaeldbrewer
status
ok
fetched_at
2026-07-29 05:58:23