This is a client for Amazon's Alexa service. It is intended and tested to run on a wide range of platforms, such as Raspberry Pi, Orange Pi, CHIP and ordinary Linux desktops.
NOTE: This is a new generation of the project under heavy development. It is eventually gonna be more awesome than ever! Please bear with us while we stabilize the new code base.
Do you want to help out? Read the Contribution Guide.
If you're interested in the things under the hood, check out the Code Notes.
You will need:
- a Raspberry Pi and an SD Card with a fresh install of Raspbian
- or an Orange Pi with Armbian
- or pretty much any up-to-date Linux system
- external speaker with 3.5mm Jack
- USB Sound Dongle and microphone
- (optional) (Raspberry Pi) a push button connected between GPIO 18 and GND
- (optional) (Raspberry Pi) a dual colour LED (or 2 signle LEDs) connected to GPIO 24 & 25
Next you need to obtain a set of credentials from Amazon to use the Alexa Voice service. Make a note of these credentials as you will be asked for them during the install process.
- Login at https://developer.amazon.com and go to
ALEXA
, thenAlexa Voice Service
. Register a Product Type
>Device
.- You are at
Device Type Info
left tab.- For the
Device Type ID
andDisplay Name
use something like AlexaPi or whatever you want. Next
- For the
- You are at
Security Profile
left tab.- From the drop-down menu choose
Create a new profile
. - Choose whatever for
Security Profile Name
andSecurity Profile Description
. HitNext
. - Under
Web Settings
horizontal tab hitEdit
and:Allowed Origins
- put therehttp://localhost:5050
andhttp://ALEXA.DEVICE.IP.ADDRESS:5050
Allowed Return URLs
puthttp://localhost:5050/code
andhttp://ALEXA.DEVICE.IP.ADDRESS:5050/code
. You have to replaceALEXA.DEVICE.IP.ADDRESS
with the IP (for example 192.168.1.123) of your AlexaPi device (for example Raspberry Pi). This is especially necessary when you are installing from another computer than AlexaPi is gonna run on.
- From the drop-down menu choose
- Fill some of the other stuff in.
-
Boot your PC and login to a command prompt.
-
Make sure you are in
/opt
by issuingcd /opt
-
Clone this repo
sudo git clone https://github.com/alexa-pi/AlexaPi.git
-
Run the setup script
sudo ./AlexaPi/src/scripts/setup.sh
Follow instructions...
Enjoy :)
NOTE: You can also clone the repository to any other directory (and lose the sudo
for the second command, if you have permission to write to that directory), but you won't be able to run AlexaPi on boot with our init scripts. It is therefore recommended for advanced users (who know what they're doing) only.
If your AlexaPi isn't running on startup you can check the log for errors. If you're on systemd, run sudo journalctl -u AlexaPi.service
, if you've stuck to the classic, run sudo less /var/log/AlexaPi.log
.
If the error is complaining about alsaaudio you may need to check the name of your soundcard input device, use
arecord -L
The device name can be set in the configuration file. If you installed into /opt as recommended, it is /etc/opt/AlexaPi/config.yaml. If you installed elsewhere, the file config.yaml is in your AlexaPi/src directory.
You may need to adjust the volume and/or input gain for the microphone, you can do this with
alsamixer
Once the adjustments have been made, you can save the settings using
alsactl store
-
September 2016: A project was started to have a common code base across devices and services.
-
May/June 2016: @maso27 made significant changes that lead to version 1.2 and started on work towards supporting snowboy.
- Voice Recognition via CMU Sphinx. When the word "alexa" is detected, Alexa responds with "Yes" and the subsequent audio to be processed.
- Push button functionality still works the same as previously as well.
- Option for the user to install shairport-sync for airplay support.
- A ten-second button press will trigger a system halt.
- Option to monitor for Alexa continuously and re-start if it has died.
- Command line arguments added:
(-s / --silent)
= start without saying "Hello"(-d / --debug)
= enable display of debug messages at command prompt - tunein support is improved
- volume control via "set volume xx" where xx is between 1 and 10
-
January 2016: @sammachin created the project and made significant changes that lead to version 1.1.
If you feel your name should be here, please contact us.