-
Notifications
You must be signed in to change notification settings - Fork 295
AlexaPi
Baozhu Zuo edited this page Feb 10, 2018
·
4 revisions
git clone https://github.com/respeaker/seeed-voicecard -b install
cd seeed-voicecard/
pi@raspberrypi:~/seeed-voicecard $ sudo ./install.sh
Get:1 http://mirrordirector.raspbian.org/raspbian stretch InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages [11.7 MB]
...
...
DKMS: install completed.
Created symlink /etc/systemd/system/sysinit.target.wants/seeed-voicecard.service → /lib/systemd/system/seeed-voicecard.service.
------------------------------------------------------
Please reboot your raspberry pi to apply all settings
Enjoy!
------------------------------------------------------
pi@raspberrypi:~/seeed-voicecard $ sudo reboot -f
You will heard the echo sound.
pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 []
Subdevices: 0/1
Subdevice #0: subdevice #0
pi@raspberrypi:~ $
pi@raspberrypi:~ $ arecord -f cd | aplay
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
^CAborted by signal Interrupt...
arecord: pcm_read:2103: read error: Interrupted system call
Aborted by signal Interrupt...
aplay: pcm_write:2011: write error: Interrupted system call
pi@raspberrypi:~ $
Please refer to https://github.com/alexa-pi/AlexaPi/wiki/Installation ,following is my setting.
pi@raspberrypi:/opt $ sudo ./AlexaPi/src/scripts/setup.sh
TIP: When there is a value in brackets like [default_value], hit Enter to use it.
Which operating system are you using?
debian - Debian, Raspbian, Armbian, Ubuntu or other Debian-based
archlinux - Arch Linux or Arch Linux-based
Your OS [debian]:
Which device are you using?
chip - C.H.I.P.
hyperion - Integrate with Hyperion Ambient Lightning Software
magicmirror - Integrating with Magic Mirror project (MMM-AlexaPi)
orangepi - Orange Pi or another H3 based board
other - other SBCs, desktops, or anything else
raspberrypi - all Raspberry Pi variants
serial - an Arduino controled device for example; used for Teddy Ruxpin
Your device [raspberrypi]:
Do you want AlexaPi to run on boot?
You have these options:
0 - NO
1 - yes, use systemd (default, RECOMMENDED and awesome)
2 - yes, use a classic init script (for a very old PC or an embedded system)
Which option do you prefer? [1]:
Creating a user to run AlexaPi under ... done.
gpio:x:997:pi
audio:x:29:pi
Created symlink /etc/systemd/system/default.target.wants/AlexaPi.service → /usr/lib/systemd/system/AlexaPi.service.
Would you like to also install Airplay support (Y/n)? n
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://mirrordirector.raspbian.org/raspbian stretch InRelease
...
...
Creating configuration file /etc/opt/AlexaPi/config.yaml ...
Enter your Device Type ID []: respeaker_amaba
Enter your Security Profile Description []: respeaker
Enter your Security Profile ID []:
Enter your Client ID []: amzn1.application-oa2-client.xxxxxxxxxxxxxxxxxxxxxxxxxxxxb
Enter your Client Secret []: 794b928526fbeba661f637xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Ready goto http://192.168.199.155:5050 or http://localhost:5050 to begin the auth process
(Press Ctrl-C (or close this window on Windows) to exit this script once authorization is complete)
^C
######################################################################################################
IMPORTANT NOTICE:
If you use a desktop OS, you HAVE TO set up your system audio so services like AlexaPi can use it too.
See https://github.com/alexa-pi/AlexaPi/wiki/Audio-setup-&-debugging#pulseaudio
######################################################################################################
sudo nano /etc/opt/AlexaPi/config.yaml
# modifi options
voice_confirm: true
raspberrypi:
# GPIO Pin with button connected
button: 17
# GPIO Pin for the playback/activity light
plb_light: 24
# GPIO Pin for the recording light
rec_light: 25
You will heard "hello" voice in system restart time.
pi@raspberrypi:~/seeed-voicecard $ sudo reboot -f
pi@raspberrypi:~ $ sudo systemctl status AlexaPi.service
● AlexaPi.service - Alexa client for all your devices
Loaded: loaded (/usr/lib/systemd/system/AlexaPi.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-02-09 03:17:05 UTC; 16min ago
Docs: https://github.com/alexa-pi/AlexaPi/wiki
Main PID: 501 (python)
CGroup: /system.slice/AlexaPi.service
└─501 /usr/bin/python /opt/AlexaPi/src/main.py --daemon
Feb 09 03:17:13 raspberrypi python[501]: ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
Feb 09 03:17:13 raspberrypi python[501]: ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Feb 09 03:17:13 raspberrypi python[501]: ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
Feb 09 03:17:14 raspberrypi python[501]: connect(2) call to /tmp/jack-999/default/jack_0 failed (err=No such file or directory)
Feb 09 03:17:14 raspberrypi python[501]: attempt to connect to server failed
Feb 09 03:17:15 raspberrypi python[501]: INFO: Checking Internet Connection ...
Feb 09 03:17:17 raspberrypi python[501]: INFO: Connection OK
Feb 09 03:17:17 raspberrypi python[501]: INFO: AVS token: Requesting a new one
Feb 09 03:17:18 raspberrypi python[501]: INFO: AVS token: Obtained successfully
Feb 09 03:33:26 raspberrypi python[501]: INFO: Triggered: pocketsphinx