Skip to content

Latest commit

 

History

History
executable file
·
309 lines (216 loc) · 8.91 KB

helper_AVS-Device-SDK.md

File metadata and controls

executable file
·
309 lines (216 loc) · 8.91 KB

AVS Device SDK

GitHub license GitHub stars GitHub forks GitHub issues GitHub watchers

Alexa 的官方網站。

AVS integration with AWS IoT As of Nov 15, 2022, the AVS Integration with the AWS IoT program is no longer available

avs-device-sdk-architecture

Alexa_Device_SDK_Architecture.TTH

2.1. Depend on

$ sudo apt-get install libc-ares-dev
$ sudo apt-get install libev-dev
$ sudo apt-get --yes install libgstreamer1.0-dev
$ sudo apt-get --yes install libgstreamer-plugins-base1.0-dev
$ sudo apt-get --yes install libgstreamer-plugins-good1.0-dev
$ sudo apt-get --yes install libgstreamer-plugins-bad1.0-dev
  • gst-plugins-base
  • gst-plugins-good
  • gst-plugins-ugly
  • sqlite

2.2. Build on ubuntu64

$ cd $HOME/sdk-folder/sdk-build
$ cmake $HOME/sdk-folder/sdk-source/avs-device-sdk \
    -DGSTREAMER_MEDIA_PLAYER=ON \
    -DPORTAUDIO=ON \
    -DPKCS11=OFF \
    -DPORTAUDIO_LIB_PATH=$PORTAUDIO_LIB_PATH \
    -DPORTAUDIO_INCLUDE_DIR=/usr/include \
    -DCMAKE_BUILD_TYPE=DEBUG

$ make SampleApp

3. Register A Device - Amazon Developer

A. Product name

avs_device_info01

B. Touch-initiated, Hands-free, etc.

avs_device_info02

C. LWA Security Profile

avs_device_info03

D. Platform information

avs_device_info04

E. FINISH

avs_device_info05

F. config.json

{
 "deviceInfo": {
  "clientId": "amzn1.application-oa2-client.xxxxxx",
  "productId": "EchoLankaHsu520"
 }
}

4. Enable Security Profile - LWA Console

A. Select Security Profile

avs_device_enable01

avs_device_enable02

B. Enabled

avs_device_enable03

5. Startup on ???

5.1. ubuntu

A. AlexaClientSDKConfig.json

$ cd $HOME/sdk-folder/sdk-source/avs-device-sdk/tools/Install

$ . genConfig.sh \
	config.json \
	12345 \
	$HOME/sdk-folder/db \
	$HOME/sdk-folder/sdk-source/avs-device-sdk \
	$HOME/sdk-folder/sdk-build/Integration/AlexaClientSDKConfig.json \
	-DSDK_CONFIG_MANUFACTURER_NAME="Ubuntu" \
	-DSDK_CONFIG_DEVICE_DESCRIPTION="Ubuntu"

B. Run 1st

$ cd $HOME/sdk-folder/sdk-build/
$ ./SampleApplications/ConsoleSampleApplication/src/SampleApp ./Integration/AlexaClientSDKConfig.json 

C. Please the below log messages

######################################################
#       > > > > > NOT YET AUTHORIZED < < < < <       #
######################################################

############################################################################################
#     To authorize, browse to: 'https://amazon.com/us/code' and enter the code: {XXXX}     #
############################################################################################

D. Relaunch - Enable debug logs

# To relaunch the Sample App with DEBUG9
$ cd $HOME/sdk-folder/sdk-build
$ ./SampleApplications/ConsoleSampleApplication/src/SampleApp ./Integration/AlexaClientSDKConfig.json DEBUG9

A. AlexaClientSDKConfig.json

$ cd $HOME/sdk-folder/sdk-source/avs-device-sdk/tools/Install

$ . genConfig.sh \
	config.json \
	12345 \
	$HOME/sdk-folder/db \
	$HOME/sdk-folder/sdk-source/avs-device-sdk \
	$HOME/sdk-folder/sdk-build/Integration/AlexaClientSDKConfig.json \
	-DSDK_CONFIG_MANUFACTURER_NAME="raspberrypi" \
	-DSDK_CONFIG_DEVICE_DESCRIPTION="raspberrypi"
A.1. list all available recording devices
$ arecord -l
A.2. list all playback devices
$ aplay -l
A.3. update ~/.asoundrc
pcm.!default {
  type asym
   playback.pcm {
     type plug
     slave.pcm "hw:0,0"
   }
   capture.pcm {
     type plug
     slave.pcm "hw:1,0"
   }
}

B. Run 1st

$ cd $HOME/sdk-folder/sdk-build/

$ export PA_ALSA_PLUGHW=1 

$ ./SampleApplications/ConsoleSampleApplication/src/SampleApp ./Integration/AlexaClientSDKConfig.json 

C. Please the below log messages

######################################################
#       > > > > > NOT YET AUTHORIZED < < < < <       #
######################################################

############################################################################################
#     To authorize, browse to: 'https://amazon.com/us/code' and enter the code: {XXXX}     #
############################################################################################

D. Relaunch - Enable debug logs

# To relaunch the Sample App with DEBUG9
$ cd $HOME/sdk-folder/sdk-build
$ ./SampleApplications/ConsoleSampleApplication/src/SampleApp ./Integration/AlexaClientSDKConfig.json DEBUG9

Appendix

I. Study

II. Debug

II.1. configure: error: applications were requested (--enable-app) but dependencies are not met

$ sudo apt-get install libcunit1 libcunit1-doc libcunit1-dev
$ sudo apt-get install libc-ares-dev

II.2. -- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)

$ sudo apt-get install libgtest-dev

II.3. Could NOT find LibArchive (missing: LibArchive_LIBRARY LibArchive_INCLUDE_DIR)

$ sudo apt-get install -y libarchive-dev

II.4. undefined reference to symbol 'pthread_getspecific@@GLIBC_2.2.5'

  • ExtensionPath.cmake
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")

III. Glossary

IV. Tool Usage

Author

Created and designed by Lanka Hsu.

License

HelperX is available under the BSD-3-Clause license. See the LICENSE file for more info.