This repository has been archived by the owner on Feb 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 693
Add instructions for setting up on Raspbian in voicekit branch. #149
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Setting up the image | ||
|
||
We recommend using [the images](https://aiyprojects.withgoogle.com/voice) we | ||
provide. Those images are based on [Raspbian](https://www.raspberrypi.org/downloads/raspbian/), | ||
with a few customizations and are tested on the Raspberry Pi 3. If you prefer | ||
to setup Raspbian yourself, there are some manual steps you need to take. | ||
|
||
## Installing the dependencies | ||
|
||
First, make sure you have `git` installed and clone this repository in | ||
`~/voice-recognizer-raspi`: | ||
|
||
```shell | ||
sudo apt-get install git | ||
cd | ||
git clone https://github.com/google/aiyprojects-raspbian.git voice-recognizer-raspi | ||
``` | ||
|
||
Then, install the project dependencies and setup the services: | ||
|
||
``` shell | ||
cd ~/voice-recognizer-raspi | ||
scripts/install-deps.sh | ||
sudo scripts/install-services.sh | ||
``` | ||
|
||
## Installing the Voice HAT driver and config | ||
|
||
To use the Voice HAT, your kernel needs to be 4.9 or later. This is available | ||
on Raspbian 2017-07-05 and later. You'll also need to configure ALSA: | ||
|
||
``` shell | ||
sudo scripts/configure-driver.sh | ||
sudo scripts/install-alsa-config.sh | ||
sudo reboot | ||
``` | ||
|
||
## Get cloud credentials | ||
|
||
To access the cloud services you need to register a project and generate | ||
credentials for cloud APIs. This is documented in the | ||
[setup instructions](https://aiyprojects.withgoogle.com/voice#users-guide-1-1--connect-to-google-cloud-platform) on the | ||
webpage. | ||
|
||
## Making code changes | ||
|
||
If you edit the code on a different computer, you can deploy it to your | ||
Raspberry Pi by running: | ||
|
||
``` shell | ||
make deploy | ||
``` | ||
|
||
## Running automatically | ||
|
||
You can find sample scripts in the `src` directory showing how to use the | ||
Assistant SDK. | ||
|
||
To execute any of these scripts on the Raspberry Pi, login to it and run | ||
(replacing the filename with the script you want to run): | ||
|
||
``` shell | ||
cd ~/voice-recognizer-raspi | ||
source env/bin/activate | ||
python3 src/assistant_library_demo.py | ||
``` | ||
|
||
If you want the voice recognizer service to run automatically when the Pi | ||
boots, you need to have a file in the `src` directory named `main.py`. You can | ||
make a copy of one of the sample scripts and rename it. Then run this command: | ||
|
||
``` shell | ||
sudo systemctl enable voice-recognizer.service | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Unit] | ||
Description=voice recognizer | ||
After=network.target ntpdate.service | ||
|
||
[Service] | ||
Environment=VIRTUAL_ENV=/home/pi/voice-recognizer-raspi/env | ||
Environment=PATH=/home/pi/voice-recognizer-raspi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
ExecStart=/home/pi/voice-recognizer-raspi/env/bin/python3 -u src/main.py | ||
WorkingDirectory=/home/pi/voice-recognizer-raspi | ||
StandardOutput=inherit | ||
StandardError=inherit | ||
Restart=always | ||
User=pi | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also change this header to "Configuring the Voice HAT driver" since we're not installing now?