filmov
tv
Install Alexa on Raspberry Pi 4
Показать описание
Here's how you can turn your raspberry pi 4 (or 3) into an Amazon Alexa. It's even easier than a Google Assistant and has lots of applications.
I may earn commission if you purchase from the links below:
INSTRUCTIONS:
0:00 Intro
4:20 Access your pi's terminal - I'm using ssh
4:38 Run in the terminal:
cd /home/pi/
mkdir sdk-folder
cd sdk-folder
mkdir sdk-build sdk-source third-party sdk-install db
cd /home/pi/
sudo apt-get update
sudo apt-get -y install \
git gcc cmake build-essential libsqlite3-dev libcurl4-openssl-dev libfaad-dev \
libssl-dev libsoup2.4-dev libgcrypt20-dev libgstreamer-plugins-bad1.0-dev \
libnghttp2-dev nghttp2 gstreamer1.0-plugins-good libasound2-dev doxygen
cd /home/pi/sdk-folder/third-party
cd portaudio
./configure --without-jack
make
cd /home/pi/sdk-folder/third-party
cd curl-7.67.0
./configure --with-nghttp2 --prefix=/home/pi/sdk-folder/third-party/curl-7.67.0 --with-ssl
make
6:13 Download and build the AVS Device SDK
cd /home/pi/sdk-folder/sdk-source
cd /home/pi/sdk-folder/sdk-build
cmake /home/pi/sdk-folder/sdk-source/avs-device-sdk \
-DGSTREAMER_MEDIA_PLAYER=ON \
-DPORTAUDIO=ON \
-DPKCS11=OFF \
-DPORTAUDIO_LIB_PATH=/home/pi/sdk-folder/third-party/portaudio/lib/.libs/libportaudio.a \
-DPORTAUDIO_INCLUDE_DIR=/home/pi/sdk-folder/third-party/portaudio/include \
-DCURL_INCLUDE_DIR=/home/pi/sdk-folder/third-party/curl-7.67.0/include/curl \
Build the sample app (or just run "make" to build the whole SDK)
make SampleApp
On my remote machine I run:
8:40 Generate config
cd /home/pi/sdk-folder/sdk-source/avs-device-sdk/tools/Install
/home/pi/sdk-folder/db \
/home/pi/sdk-folder/sdk-source/avs-device-sdk \
-DSDK_CONFIG_MANUFACTURER_NAME="raspberrypi" \
-DSDK_CONFIG_DEVICE_DESCRIPTION="raspberrypi"
9:08 Set up audio:
Then add
"gstreamerMediaPlayer":{
"audioSink":"alsasink"
},
to the space above "cblAuthDelegate"
Ctrl + S to save then Ctrl + X to exit the nano editor
Run the following to find your card and device numbers:
aplay -l
arecord -l
Make a .asoundrc file:
sudo nano ~/.asoundrc
Copy and paste the following (changing card and device numbers if necessary):
pcm.!default {
type asym
type plug
}
type plug
}
}
Ctrl + S to save Ctrl + X to exit
Kill pulseaudio: pulseaudio -k
Authorize and run your Alexa:
cd /home/pi/sdk-folder/sdk-build
I hope you found this helpful! Happy coding
I may earn commission if you purchase from the links below:
INSTRUCTIONS:
0:00 Intro
4:20 Access your pi's terminal - I'm using ssh
4:38 Run in the terminal:
cd /home/pi/
mkdir sdk-folder
cd sdk-folder
mkdir sdk-build sdk-source third-party sdk-install db
cd /home/pi/
sudo apt-get update
sudo apt-get -y install \
git gcc cmake build-essential libsqlite3-dev libcurl4-openssl-dev libfaad-dev \
libssl-dev libsoup2.4-dev libgcrypt20-dev libgstreamer-plugins-bad1.0-dev \
libnghttp2-dev nghttp2 gstreamer1.0-plugins-good libasound2-dev doxygen
cd /home/pi/sdk-folder/third-party
cd portaudio
./configure --without-jack
make
cd /home/pi/sdk-folder/third-party
cd curl-7.67.0
./configure --with-nghttp2 --prefix=/home/pi/sdk-folder/third-party/curl-7.67.0 --with-ssl
make
6:13 Download and build the AVS Device SDK
cd /home/pi/sdk-folder/sdk-source
cd /home/pi/sdk-folder/sdk-build
cmake /home/pi/sdk-folder/sdk-source/avs-device-sdk \
-DGSTREAMER_MEDIA_PLAYER=ON \
-DPORTAUDIO=ON \
-DPKCS11=OFF \
-DPORTAUDIO_LIB_PATH=/home/pi/sdk-folder/third-party/portaudio/lib/.libs/libportaudio.a \
-DPORTAUDIO_INCLUDE_DIR=/home/pi/sdk-folder/third-party/portaudio/include \
-DCURL_INCLUDE_DIR=/home/pi/sdk-folder/third-party/curl-7.67.0/include/curl \
Build the sample app (or just run "make" to build the whole SDK)
make SampleApp
On my remote machine I run:
8:40 Generate config
cd /home/pi/sdk-folder/sdk-source/avs-device-sdk/tools/Install
/home/pi/sdk-folder/db \
/home/pi/sdk-folder/sdk-source/avs-device-sdk \
-DSDK_CONFIG_MANUFACTURER_NAME="raspberrypi" \
-DSDK_CONFIG_DEVICE_DESCRIPTION="raspberrypi"
9:08 Set up audio:
Then add
"gstreamerMediaPlayer":{
"audioSink":"alsasink"
},
to the space above "cblAuthDelegate"
Ctrl + S to save then Ctrl + X to exit the nano editor
Run the following to find your card and device numbers:
aplay -l
arecord -l
Make a .asoundrc file:
sudo nano ~/.asoundrc
Copy and paste the following (changing card and device numbers if necessary):
pcm.!default {
type asym
type plug
}
type plug
}
}
Ctrl + S to save Ctrl + X to exit
Kill pulseaudio: pulseaudio -k
Authorize and run your Alexa:
cd /home/pi/sdk-folder/sdk-build
I hope you found this helpful! Happy coding
Комментарии