alexa / avs-device-sdk

An SDK for commercial device makers to integrate Alexa directly into connected products.
https://developer.amazon.com/alexa/alexa-voice-service
Apache License 2.0
1.26k stars 604 forks source link

AVS sample app - authorization with code does not work #1019

Closed the-smart-home-maker closed 6 years ago

the-smart-home-maker commented 6 years ago

Briefly summarize your issue:

When I open amazon.com/us/code or amazon.com/de/code respectively (no matter which language selected) and after logging into my account type in the code that is provided by the sample app, I receive an error which is not further explained: bildschirmfoto 2018-10-21 um 09 29 28

What is the expected behavior?

After entering the code, my device gets authorized

What behavior are you observing?

Instead of getting authorized, I receive an error (see screenshot above)

Provide the steps to reproduce the issue, if applicable:

  1. Start sample app on my Raspberry Pi with sudo bash startsample.sh
  2. Copy code in the command line interface
  3. Open amazon.com/us/code
  4. Log in with amazon account (same account that the device is registered in on developer.amazon.com > AVS)
  5. Paste the code from the command line interface to the input field "type in code" shown after Login

Tell us about your environment:

Raspberry Pi Model 3 B+, Raspbian 9 (Stretch)

What version of the AVS Device SDK are you using?

1.9.0

Tell us what hardware you're using:

Tell us about your OS (Type & version):

visayamv commented 6 years ago

Hi @danicalifornia , This error usually indicates that the productId value under the deviceInfo object in your AlexaClientSDKConfig.json is incorrect. Please double check that it matches the value titled "Product ID" on the "Product information" tab of the page for your device. You can reach this page from the developer console by selecting "Manage" on the row for the device you are trying to authorize.

the-smart-home-maker commented 6 years ago

Hi @visayamv,

thanks a lot!! That was exactly the issue! After having changed the product id, the sample app started.

Now I unfortunately still get some errors saying UNRECOVERABLE AUTHORIZATION ERROR: UNAUTHORIZED_CLIENT and when trying to ask Alexa something: DefaultClient:notifyOfWakeWord:action=ignoreAlexaWakeWord,reason=networkDisconnected

Do you have an idea what that means? My Raspberry is actually not disconnected.

visayamv commented 6 years ago

Hi @danicalifornia , This error is usually due to the incorrect clientID used.

Please make sure the value of clientId in your AlexaClientSDKConfig.json file is the clientId found under the Other devices and platforms tab on developer.amazon.com, not the one found under the Web tab. You can see the location here: https://developer.amazon.com/docs/alexa-voice-service/code-based-linking-other-platforms.html#step1

After that remove the CBL database file you are using and rerun the SampleApp. The CBL database is specified in the AlexaClientSDKConfig.json under databaseFilePath in CBLAuthDelegate.

Let me know if it works for you

the-smart-home-maker commented 6 years ago

Got it solved - needed to delete the CBLAuth... database file in order to get it refreshed with the right credentials. THANK YOU VERY MUCH!