Skip to content

Repository containing scripts/helpers for configuring a DragonBoard 410c to work with WizeIoT's AiVA-96

Notifications You must be signed in to change notification settings

daehahn/aiva-pi-avs-device-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WizeIoT AiVA-Pi Kit and Amazon Alexa Voice Services SDK on a Raspberry Pi

The WizeIoT’s AiVA HAT board for Raspberry Pi enables developers of the smart home devices such as smart speaker, smart panels, kitchen equipment and other commercial and industrial electronics products to evaluate and prototype far-field hands-free voice interface using Amazon Alexa, Google Assistant, Microsoft Cortana voice service.

Built around XMOS XVF3500 lastest voice processor with direct interfacing to a line array of digital microphones, the AiVA board is an ideal platform for developers who want to integrate AI speaker into their products.

Alexa Voice Service (AVS) is Amazon’s intelligent voice recognition and natural language understanding service that allows you as a developer to voice-enable any connected device that has a microphone and speaker.

This project provides a step-by-step walkthrough to help you build a hands-free Alexa Voice Service (AVS) prototype in 60 minutes, using wake word engines from Sensory. Now, instead of pushing a button to "start listening", you can now just say the wake word "Alexa", much like the Amazon Echo.

To find out more, visit: https://www.wizeiot.com/aiva-pi/ home page and: https://developer.amazon.com/alexa-voice-service

This repository provides a simple-to-use automated script to install the Amazon AVS Device SDK on a Raspberry Pi 3 and configure to use the AiVA-Pi for AVS for audio.

Prerequisites

You will need:

  • AiVA-Pi board
  • Raspberry Pi 3 or compatible boards.
  • Micro-USB power supply (min. 2A)
  • MicroSD card (min. 16GB)
  • Powered speaker with audio 3.5mm analogue plug
  • Monitor with HDMI input, HDMI cable
  • USB keyboard and mouse
  • Wi-Fi or Fast-Ethernet connection with internet connectivity

You will also need an Amazon Developer account: https://developer.amazon.com

Hardware setup

  • Make sure the Raspberry Pi is powered off

  • Connect I/O devices (Monitor, Keyboard, etc...)

  • Connect AiVA-Pi boards on top of Raspberry Pi

  • Connect AiVA-Pi MEMS mic board and speakers

  • Power on your Raspberry Pi with Micro-USB power supply

    AiVA-96 and DB410c

AVS SDK installation and Raspberry Pi audio setup

Full instructions to install the AVS SDK on to a Raspberry Pi and configure the audio to use the AiVA-Pi are detailed in the Getting Started Guide available from: https://www.wizeiot.com/aiva-pi/ home page.

Brief instructions and additional notes are below:

  1. You'll need to register a device and create a security profile at developer.amazon.com. Click here for step-by-step instructions.

    IMPORTANT: You should download 'config.json' file from step 4 of 'Create a Security Profile' section of the instructions.

  2. Install Raspbian (Stretch) on the Raspberry Pi as described in the Getting Started Guide.

    • You shoud use Raspbian Stretch November 2018 or later.
    • Write downloaded image file to your MicroSD card with Etcher or other image writer software.
    • Insert MicroSD card into Raspberry Pi and plug Micro-USB power supply to turn on Raspberry Pi.
  3. Open a terminal on the Raspberry Pi and clone this repository

    cd ~; git clone https://github.com/wizeiot/aiva-pi-avs-device-sdk.git
    
  4. Run the installation script

    cd aiva-pi-avs-device-sdk/
    bash automated_install.sh
    

    IMPORTANT: Before running the script, place your 'config.json' into aiva-pi-avs-device-sdk folder. You can use WinSCP or FileZillia for transfer file. Initial Debian password should be same as id. Installation takes 30 mins ~ 1 hour depending on your internet speed.

  5. Alternative way to setup SDK: Run the setup script with config.json and the device serial number (DSN) as arguments. You can either provide your own DSN, or use the system default (123456). The DSN can be any unique alpha-numeric string (up to 64 characters). You should use this string to identify your product or application instance. Many developers choose to use a product's SKU for this value.

    For example:

    sudo bash setup.sh config.json -s 998987
    

    Note: If you don't supply a DSN, then the default value 123456 will be generated by the SDK.

Authorize and run

When you run the sample app for the first time, you'll need to authorize your client for access to AVS.

  1. Initialize the sample app:

    sudo bash startsample.sh
    
  2. Wait for the sample app to display a message like this:

    ######################################################
    #       > > > > > NOT YET AUTHORIZED < < < < <       #
    #####################################################
    
    ############################################################################################
    #     To authorize, browse to: 'https://amazon.com/us/code' and enter the code: {XXXX}     #
    ############################################################################################
    
  3. Use a browser (either your PC or DragonBoard 410c) to navigate to the authorize URL specified in the message from the sample app.

  4. Authenticate using your Amazon user credentials.

  5. Enter the code specified in the message from sample app.

  6. Select “Allow”.

  7. Wait (it may take as long as 30 seconds) for CBLAuthDelegate to successfully get an access and refresh token from Login With Amazon (LWA). At this point the sample app will print a message like this:

    ########################################
    #       Alexa is currently idle!       #
    ########################################
    
  8. You are now ready to use the sample app. The next time you start the sample app, you will not need to go through the authorization process.

  9. Troubleshooting: This helps us do a simple speaker and microphone test, just to make sure that the hardware is functional.

    $ speaker-test -t wav
    $ arecord --format=S16_LE --duration=5 --rate=16000 --file-type=raw out.raw
    $ aplay --format=S16_LE --rate=16000 --file-type=raw out.raw
    

Integration and unit tests

You can run integration and unit tests using this command:

sudo bash test.sh

Enjoy your Google Assistant and don't forget to visit https://www.iotoi.io community for find out more projects.

Important considerations

About

Repository containing scripts/helpers for configuring a DragonBoard 410c to work with WizeIoT's AiVA-96

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%