Tag Archives: Raspberry Pi

How To Train A Custom Wake Word For Google Assistant Using Snowboy

Following up to my primer on using Snowboy for custom Google Assistant wake words, in this video, I’ll walk you through using Snowboy’s “Hotword As A Service” to train your own wake words.

PARTS/TOOLS:

Google AIY Voice Kit

Raspberry Pi 3B+ (with appropriate SD card and power supply)

RESOURCES:

Snowboy

How To Set Up OctoPi

I have a couple of new 3D printers that I need to build OctoPi servers for, so in this video, we’ll walk through how to set up OctoPi and attach it to most 3D printers.

OctoPi is available from OctoPrint.org

Etcher is available for Mac, Windows, and Linux at Balena.io

Benchy Quick Print by Thumper72 is available on Thingiverse

How To Use A Custom Wake Word With Google Assistant

The new voice assistants like Siri, Cortana, Alexa, and Google (itself?) are becoming more and more ubiquitous as we race toward a “Star Trek”-style omnipresent computing interface, but what if you don’t like invoking the name of your chosen corporate overlord when you use the assistant’s features? What if you could speak “Okay, Computer” into an Apple mouse like Scotty did? In this video, I’ll show you how to set up a custom wake word with your voice assistant using a platform called “Snowboy”.

 

PARTS/TOOLS:

Google AIY Voice Kit

Raspberry Pi 3B+ (with appropriate SD card and power supply)

RESOURCES:

Snowboy

Snowboy GitHub

GassistPi GitHub

How To Set Up Google AIY

How To Set Up Google Assistant On The Matrix Creator Development Board

Google Actions Console

Google Developer Console

How To Set Up Snowboy On Raspberry Pi:

Install the Sox, PortAudio, and PyAudio dependencies
sudo apt-get install python-pyaudio python3-pyaudio sox
pip install pyaudio

Install Swig by compiling from source
wget http://downloads.sourceforge.net/swig/swig-3.0.10.tar.gz
tar -xvf swig-3.0.10.tar.gz
sudo apt-get install libpcre3 libpcre3-dev
cd swig-3.0.10
./configure --prefix=/usr\
--without-clisp \
--without-maximum-compile-warnings &&

make
make install &&
install -v -m755 -d /usr/share/doc/swig-3.0.10 &&
cp -v -R Doc/* /usr/share/doc/swig-3.0.10

Install the Atlas library
sudo apt-get install libatlas-base-dev

Verify audio recording and playback work
arecord -f cd -d 5 test.wav
aplay test.wav

Clone the Snowboy repo
https://github.com/Kitt-AI/snowboy.git

Compile the Snowboy Python wrapper
cd snowboy/swig/Python
make

Run the Snowboy demo with the “Snowboy” wake word
cd snowboy/src/examples/Python
python demo.py /home/pi/snowboy/resources/models/snowboy.umdl

How To Set Up GassistPi On Google AIY:

Clone the GassistPi repo
git clone https://github.com/shivasiddharth/GassistPi

Install the AIY hat configuration
sudo chmod +x ./GassistPi/audio-drivers/AIY-HAT/scripts/configure-driver.sh
sudo ./GassistPi/audio-drivers/AIY-HAT/scripts/configure-driver.sh
sudo reboot
sudo chmod +x ./GassistPi/audio-drivers/AIY-HAT/scripts/install-alsa-config.sh
sudo ./GassistPi/audio-drivers/AIY-HAT/scripts/install-alsa-config.sh

Confirm that your audio still works
speaker-test -t wav

From here, you’re going to use the credentials as well as the project and device IDs created when you first set up the Google AIY kit. Refer to the how-tos above if you haven’t gotten this far yet.

Run the installer script (this will take a while)
sudo chmod +x ./GassistPi/scripts/gassist-installer.sh
sudo ./GassistPi/scripts/gassist-installer.sh

As the script finishes, you will be presented with a unique URL for authentication. Copy that URL into a browser, sign in to Google, copy the authentication code, and paste that at the prompt in the terminal.

You can now run Google Assistant via GassistPi which allows intricate customization options as well as custom wake words via Snowboy. Configure these options by using a text editor with ~/GassistPi/src/config.yaml

Run Google Assistant with the following command:
/home/${USER}/env/bin/python -u /home/${USER}/GassistPi/src/main.py --project_id [your project ID] --device_model_id [your device ID]

How To Set Up Google Assistant On The Matrix Creator Development Board

The Matrix Creator is an IoT-centric development board that comes with a wide array of goodies that facilitate hardware development such as an FPGA, various accelerometer and environmental sensors, IR transceivers, and even an 8-microphone array that can be used for echolocation as well as omnidirectional listening. It’s this microphone array that makes the Matrix Creator (and it’s smaller sibling, the Matrix Voice) an ideal platform for developing your own AI assistant! In this video, we’ll look at installing and setting up Google Assistant and see how it compares to the dedicated AIY hat from a previous video.

PARTS/TOOLS:

Raspberry Pi 3B+ (with appropriate SD card and power supply)

Matrix Creator

RESOURCES:

Matrix Labs GitHub

Installing the Matrix kernel modules:

Add the repository key
wget https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -

echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list

sudo apt-get update
sudo apt-get upgrade

Install the packages
sudo apt install matrixio-creator-init

Reboot and install the kernel modules
sudo apt install matrixio-kernel-modules

Reboot and install the Google Assistant SDK per their instructions:

Now, you could run the Google Assistant at this point and everything will work just fine, but the fine folks at Matrix Labs actually put together a nice little application that adds color-changing lights and other little niceties to the stock Assistant installation

Clone the Matrix Google Assistant repo

git clone https://github.com/matrix-io/google-assistant-matrixio.git

Then run the program using the project and model IDs from the SDK setup
~/google-assistant-matrixio/google-matrixio-assistant-hotword --project_id [your-dev-project-id] --device_model_id [your-model-id]

Assistant will run and respond to the standard “OK, Google” or “Hey, Google” hotwords.

How To Set Up The Google AIY Voice Kit

AI voice assistants are the latest new hotness to come out of Silicon Valley, but before they were in every electronics department, they were much the exclusive playground of the DIY tinkerer. With kits like Google’s AIY line, hackers and makers can build their own voice assistants with little more than the good ol’ Raspberry Pi! In this video, I’ll walk you through how to set up the Google AIY Voice kit on a Raspberry Pi and run one of the demo python scripts to start building your own voice interfaces!

PARTS/TOOLS:

Google AIY Voice Kit

Raspberry Pi 3B+ (with appropriate SD card and power supply)

RESOURCES:

AIY Custom Raspbian http://aiyprojects.withgoogle.com/

Google Developer Console http://console.developers.google.com

Etcher

If you’re having trouble with segmentation faults crashing the Python demos, invoke these commands as Pi to install the earlier Google Assistant Library Python modules:

pip3 install google-assistant-library==1.0.0
pip3 install google-assistant-library

If you’re receiving the following error message

File "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 75, in _credentials_flow_interactive
webbrowser.register('chromium-browser', None, webbrowser.Chrome('chromium-browser'), -1)
TypeError: register() takes from 2 to 3 positional arguments but 4 were given

Then change line 75 in /home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.pyto the following:

webbrowser.register('chromium-browser', None, webbrowser.Chrome('chromium-browser'), preferred=True)

Be sure to keep the indentation and spacing the same as the original as it the code is sensitive.

Project Rankin: A Retro-Commercial Holiday Ornament

A child of the hyper-consumerist 80s and 90s, Matt grew up on a steady diet of sugared cereal and UHF television. As such, his sense of nostalgia is driven as much by advertising trends of the era as it is by music or other sociological elements. This leads to an interesting relationship with the winter holiday season, where seasonally-themed television commercials hold as high a place in tradition as any carol, tree, or gift exchange. To celebrate this odd bit of seasonal nostalgia, Matt builds a retro-television-themed ornament from a Raspberry Pi that plays those magical commercials from his youth and is powered by a strand of holiday fairy lights!

Engage with the element14 presents team on the element14 Community – suggest builds, find project files and behind the scenes video: http://bit.ly/2MFMG0v

How To Install TFT LCD Screens on Raspberry Pi

n this video, we’ll walk through how to install a TFT LCD screen on on a Raspberry Pi for small form factor or portable projects. This screen will form part of the head-mounted display for Project Xyberpunk on element14 Presents.

Watch the complete Project Xyberpunk series at element14.com

How To Use A Tiny OLED Screen with RetroPie

There’s not much documentation on how to use a tiny OLED screen with RetroPie, so in this video, I’ll walk through the process of setting up one of Adafruit’s teeny-tiny OLED screen modules with a Raspberry Pi Zero.

Watch the complete Project Kongmas build video at element14.com

Raspberry Pi GPIO Pinout: element14.com/raspberrypi

How To Set Up a Raspberry Pi as a NOAA Satellite Receiver with RTL-SDR

For Project TIROS, I’m building a briefcase-style NOAA satellite receiver using upcycled parts centered around a Raspberry Pi. In this video, I will walk you through the process of installing the necessary software components to use the RTL-SDR module on a Raspberry Pi for NOAA satellite reception.

See more of Project TIROS

Get the RTL-SDR dongle on Amazon: https://amzn.to/2Du84p7

Project Serling Outtakes

Project: Serling is an electronic reproduction of the “Mystic Seer” prop from the Twilight Zone episode “Nick of Time”. In the show, William Shatner’s character becomes obsessed with the seemingly correct predictions of a coin-operated fortune teller machine. The version being built for element14 Presents is a Raspberry Pi-powered device that uses a thermal printer to deliver randomly-selected answers to yes or no questions.

Watch the full video at element14!