[Question] Need AVS & AVS app test guide

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

I'm testing avs application with BCM43907 evb + SDK 5.1 but I can not find any application test guide for "demo/avs" & "demo/avs_app".

In "demo/avs" I can find "talk" command but not in "demo/avs_app" and also I can find "connect" command in "demo/avs_app"

but not in the "demo/avs", can any one tell me what's the difference between "avs_app" and "avs"?

what's the test procedure for sending a voice command and get response from the server?

As I guess, I should connect to the Amazone server first and then send a voice command like "joke.wave" in the SDK right and then

get a response from server right?

If so, why "connect" command and "talk" command is in different application seperately?

If there is any breif test guide about AVS please let me know.

Besides test procedure I get an error while connecting avs server like the following log.

Joining : MCS_wireless_5G
Successfully joined : MCS_wireless_5G
Obtaining IPv4 address via DHCP
DHCP CLIENT hostname WICED IP
IPv4 network ready IP: 192.168.0.9
Setting IPv6 link-local address
IPv6 network ready IP: FE80:0000:0000:0000:02A0:50FF:FE8F:5A65
0003 00:00:08.144 Initializing SNTP...
0004 19:57:02.110 Initializing HTTP2 library
0005 19:57:02.114 AVS client thread begin
0006 19:57:02.117 Initialize audio PLAYBACK device: ak4954_dac
0007 19:57:02.123 Audio_client: enabling playback support
0008 19:57:02.131 Audio render thread begin
0009 19:57:02.134 Audio client thread begin
0010 19:57:02.138 Begin app mainloop

> connect
0011 20:00:20.937 Received command: connect
> 0012 20:00:20.941 Attemping DNS lookup for api.amazon.com
0013 20:00:20.950 Connect to host: api.amazon.com (54.239.29.146), port 443, path /auth/o2/token
0014 20:00:22.063 Bad HTTP status returned from server: HTTP/1.1 400

Thanks,

Soohwan.

0 Likes
1 Solution
RaktimR_11
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

The demo.avs application demonstrates how to interface with Amazon's AVS using standard WICED components.I am trying to provide a general outline to implement the avs provided in WICED.

  1. Before compiling and running the application for the first time, users will have to modify the AVS_REFRESH_TOKEN, AVS_CLIENT_ID, and AVS_CLIENT_SECRET defines in avs_app_dct.h. The value of these parameters can be generated by running snip.avs_authorization application.
  2. Edit the wifi_config_dct.h to set the AP settings before compiling the avs_app.
  3. Boot the board and wait until 'Connection to AVS established' message is displayed.
  4. Type 'talk' and press enter in the console window. AVS should respond with a joke that is played on the speakers.
  5. Similarly, by using the play/pause command, you can use simple voice commands like tell me a joke and AVS should respond back.

The avs app demonstrates that the voice commands are processed and the appropriate response is played on the speaker.

The demo.avs_app application demonstrates how to interface with Amazon's AVS using the WICED avs_client service library. I am trying to list out the procedures first for this application.

  1. Before compiling and running the application for the first time, users will have to modify the AVS_APP_DEFAULT_REFRESH_TOKEN, AVS_APP_DEFAULT_CLIENT_ID, and AVS_APP_DEFAULT_CLIENT_SECRET defines in avs_app_dct.h
  2. Edit the wifi_config_dct.h before compiling the avs_application.
  3. Once the network has been correctly configured, boot the application and wait until the message "Begin app mainloop" is displayed on the console. Note that SNTP is initialized during application startup and the SNTP has an initial delay of between 300 milliseconds and 77 seconds as per RFC guidelines.
  4. Boot the board and wait until 'Begin app mainloop' is displayed
  5. Issue the 'connect' command to initialize the network connection to AVS.
  6. Press the Play/Pause button and speak a simple voice command such as tell me a joke

The setting of timers and alarms is supported by avs_app which was not there in avs. Set an alarm for 11:00 should result in a statement like whether the alarm should be 11 in the morning or in the evening. The mic should then be triggered automatically for the user reply.  Playback may be initiated via voice "Play radio" or "Play music from TuneIn." AVS should respond asking what type of music you would like to hear. You should also be able to stop music playback from the Alexa application as well as change the volume.

I hope the difference between both of the applications is somewhat clear now. avs_app uses the client service library whereas avs does not. The error that you have reported mostly occurs due to incorrect refresh token. Please let me know if you are still facing the issue and for your information, from SDK 5.2, you can see only the avs_app listed in SDK.

View solution in original post

6 Replies
RaktimR_11
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

The demo.avs application demonstrates how to interface with Amazon's AVS using standard WICED components.I am trying to provide a general outline to implement the avs provided in WICED.

  1. Before compiling and running the application for the first time, users will have to modify the AVS_REFRESH_TOKEN, AVS_CLIENT_ID, and AVS_CLIENT_SECRET defines in avs_app_dct.h. The value of these parameters can be generated by running snip.avs_authorization application.
  2. Edit the wifi_config_dct.h to set the AP settings before compiling the avs_app.
  3. Boot the board and wait until 'Connection to AVS established' message is displayed.
  4. Type 'talk' and press enter in the console window. AVS should respond with a joke that is played on the speakers.
  5. Similarly, by using the play/pause command, you can use simple voice commands like tell me a joke and AVS should respond back.

The avs app demonstrates that the voice commands are processed and the appropriate response is played on the speaker.

The demo.avs_app application demonstrates how to interface with Amazon's AVS using the WICED avs_client service library. I am trying to list out the procedures first for this application.

  1. Before compiling and running the application for the first time, users will have to modify the AVS_APP_DEFAULT_REFRESH_TOKEN, AVS_APP_DEFAULT_CLIENT_ID, and AVS_APP_DEFAULT_CLIENT_SECRET defines in avs_app_dct.h
  2. Edit the wifi_config_dct.h before compiling the avs_application.
  3. Once the network has been correctly configured, boot the application and wait until the message "Begin app mainloop" is displayed on the console. Note that SNTP is initialized during application startup and the SNTP has an initial delay of between 300 milliseconds and 77 seconds as per RFC guidelines.
  4. Boot the board and wait until 'Begin app mainloop' is displayed
  5. Issue the 'connect' command to initialize the network connection to AVS.
  6. Press the Play/Pause button and speak a simple voice command such as tell me a joke

The setting of timers and alarms is supported by avs_app which was not there in avs. Set an alarm for 11:00 should result in a statement like whether the alarm should be 11 in the morning or in the evening. The mic should then be triggered automatically for the user reply.  Playback may be initiated via voice "Play radio" or "Play music from TuneIn." AVS should respond asking what type of music you would like to hear. You should also be able to stop music playback from the Alexa application as well as change the volume.

I hope the difference between both of the applications is somewhat clear now. avs_app uses the client service library whereas avs does not. The error that you have reported mostly occurs due to incorrect refresh token. Please let me know if you are still facing the issue and for your information, from SDK 5.2, you can see only the avs_app listed in SDK.

Anonymous
Not applicable

Hi Rroy,

Thanks for the detail guide,

The error I reported had been solved and as you said it was due to the incorrect refresh token.

Now I've got correct response by running "talk" commnad in avs demo but about "capture" commnad it seems the application reset whenever I run capture command.

I didn't aware that I should press "play/pause" button when I run "avs_app" before say anything to AVS server.

I will try this.

P.S

Do you know what's the "capture" command in the application?

Best regards

Soohwan.

0 Likes
Anonymous
Not applicable

Hi Rroy,

According to your guidance I'm testing avs_app however I got disconnect from AVS wile getting voice data.

the following is the log I've got.

the log marked in red is sudden disconnection and I have no idea why disconnected while procesing voice data.

### process_get_voice_data ###

### process_get_voice_data ###

### process_get_voice_data ###

### process_get_voice_data ###

### process_get_voice_data ###

0113 00:00:57.139 Disconnect event

### connection is not ready

0114 00:00:57.144 Error writing audio data

0115 00:00:57.148 Stop talking!

### connection is not ready

0116 00:00:57.153 Error completing SpeechRecognizer request

0117 00:00:57.158 Error returned from http_disconnect: 20

0118 00:00:57.163 Connection to AVS disconnected

0119 00:00:57.168 Attemping DNS lookup for api.amazon.com

0120 00:00:57.178 Connect to host: api.amazon.com (54.239.26.244), port 443, path /auth/o2/token

0121 00:00:58.800 Attemping DNS lookup for avs-alexa-na.amazon.com

0122 00:00:58.878 Connecting to 54.239.21.157

0123 00:01:00.418 Establishing downchannel stream...

0124 00:01:00.422 Finished sending downchannel message.

0125 00:01:00.729 Sending initial synchronize state.

0126 00:01:02.272 Connection to AVS established

do you have nay idea?

Best regards

Soohwan

0 Likes
RaktimR_11
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

Hello Soohwan,

I was not able to reproduce the error. It seems to be an issue with particular AP. Once the connection to the AVS is established, it should work as expected. To understand the capture command, you can take a look at the avs_app_console.c which should be able to help you.

0 Likes
Anonymous
Not applicable

Hi Rroy,

Yes except for the audio capture procedure all other fucntion seems ok.

I ran the follow procedure

1.run AVS

2.connect AVS bia "avs" command.

3.press "play/pause" button or type "capture" (it seems same function)

4.say "tell me a joke"

5. got disconnect right away

I check DAC is correctly working however I never been checked wheather the ADC is ok or not.

I'm using general pin Mic below.

pastedImage_0.png

and used "demo.avs-BCM943907WCD1 download run" for compile.

Do you have any idea?

Best regards

Soohwan

0 Likes

Raktim Roy wrote:

The demo.avs application demonstrates how to interface with Amazon's AVS using standard WICED components.I am trying to provide a general outline to implement the avs provided in WICED.

Why the demo/avs_app is removed by sdk-6.0?

0 Likes