alexa-pi / AlexaPi

Alexa client for all your devices! # No active development. PRs welcome # consider https://github.com/respeaker/avs instead
MIT License
1.33k stars 396 forks source link

Install won't complete - Amazon error: "We're sorry! An error occurred" #277

Closed nuentes closed 7 years ago

nuentes commented 7 years ago

I can't seem to complete the install... I'm stuck at the very last step. The amazon page will not load either on the local device or through the network, I always get this error message. From searching this issues list, it seems it's possible this is related to the .asoundrc file, which I did modify to:

pcm.!default {
        type hw
        card 0
        device 1
}

ctl.!default {
        type hw
        card 0
}

This was working fine while I was using the alexa-avs-sample-app, but I have decided to migrate to this fork. Here is my install log:

$ cd /opt
pi@PI-HOLE:/opt $ sudo git clone https://github.com/alexa-pi/AlexaPi.git
Cloning into 'AlexaPi'...
remote: Counting objects: 903, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 903 (delta 0), reused 0 (delta 0), pack-reused 900
Receiving objects: 100% (903/903), 521.80 KiB | 440.00 KiB/s, done.
Resolving deltas: 100% (565/565), done.
Checking connectivity... done.
pi@PI-HOLE:/opt $ sudo ./AlexaPi/src/scripts/setup.sh
TIP: When there is a value in brackets like [default_value], hit Enter to use it.

Which operating system are you using?
         debian - Debian, Raspbian, Armbian, Ubuntu or other Debian-based
      archlinux - Arch Linux or Arch Linux-based
Your OS [debian]: 
Which device are you using?
           chip - C.H.I.P.
       hyperion - Integrate with Hyperion Ambient Lightning Software
    magicmirror - Integrating with Magic Mirror project (MMM-AlexaPi)
       orangepi - Orange Pi or another H3 based board
          other - other SBCs, desktops, or anything else
    raspberrypi - all Raspberry Pi variants
         serial - an Arduino controled device for example; used for Teddy Ruxpin
Your device [raspberrypi]: 
Do you want AlexaPi to run on boot?
You have these options: 
0 - NO
1 - yes, use systemd (default, RECOMMENDED and awesome)
2 - yes, use a classic init script (for a very old PC or an embedded system)
Which option do you prefer? [1]: 1
Creating a user to run AlexaPi under ... done.
gpio:x:997:pi
audio:x:29:pi,pulse
Created symlink from /etc/systemd/system/default.target.wants/AlexaPi.service to /usr/lib/systemd/system/AlexaPi.service.
Would you like to also install Airplay support (Y/n)? n
Get:1 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]
Hit http://ppa.launchpad.net trusty InRelease                              
Get:2 http://archive.raspberrypi.org jessie InRelease [22.9 kB]            
Hit http://ppa.launchpad.net trusty/main Sources             
Hit http://ppa.launchpad.net trusty/main armhf Packages                    
Get:3 http://mirrordirector.raspbian.org jessie/main armhf Packages [9,533 kB] 
Hit http://ppa.launchpad.net trusty/main Translation-en                        
Get:4 http://archive.raspberrypi.org jessie/main armhf Packages [170 kB]       
Hit http://archive.raspberrypi.org jessie/ui armhf Packages                    
Ign http://archive.raspberrypi.org jessie/main Translation-en_US               
Ign http://archive.raspberrypi.org jessie/main Translation-en                  
Ign http://archive.raspberrypi.org jessie/ui Translation-en_US                 
Ign http://archive.raspberrypi.org jessie/ui Translation-en                    
Get:5 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [43.3 kB]
Get:6 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [84.2 kB]
Get:7 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B]   
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_US        
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en           
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_US           
Ign http://mirrordirector.raspbian.org jessie/main Translation-en              
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_US       
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en          
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_US            
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en               
Fetched 9,870 kB in 58s (168 kB/s)                                             
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version.
curl is already the newest version.
git is already the newest version.
python-setuptools is already the newest version.
python-setuptools set to manually installed.
vlc-nox is already the newest version.
libasound2-dev is already the newest version.
The following package was automatically installed and is no longer required:
  libffi5
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
  libavahi-client-dev libavahi-common-dev libdbus-1-dev libglib2.0-dev
  libopencore-amrnb0 libopencore-amrwb0 libpcre3-dev libpython-dev
  libpython2.7-dev libsox-fmt-alsa libsox-fmt-base libsox2 python2.7-dev
  swig2.0
Suggested packages:
  libglib2.0-doc libsox-fmt-all swig-doc swig-examples swig2.0-examples
  swig2.0-doc
The following NEW packages will be installed:
  libavahi-client-dev libavahi-common-dev libdbus-1-dev libglib2.0-dev
  libopencore-amrnb0 libopencore-amrwb0 libpcre3-dev libpulse-dev
  libpython-dev libpython2.7-dev libsox-fmt-alsa libsox-fmt-base
  libsox-fmt-mp3 libsox2 python-dev python2.7-dev sox swig swig2.0
0 upgraded, 19 newly installed, 0 to remove and 25 not upgraded.
Need to get 23.5 MB of archives.
After this operation, 41.4 MB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libopencore-amrnb0 armhf 0.1.3-2.1 [80.4 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libopencore-amrwb0 armhf 0.1.3-2.1 [42.0 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main libpython2.7-dev armhf 2.7.9-2+deb8u1 [17.9 MB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-dev armhf 2.7.9-1 [1,188 B]
Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main libsox2 armhf 14.4.1-5 [231 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ jessie/main libavahi-common-dev armhf 0.6.31-5 [61.4 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian/ jessie/main libdbus-1-dev armhf 1.8.22-0+deb8u1 [184 kB]
Get:8 http://mirrordirector.raspbian.org/raspbian/ jessie/main libavahi-client-dev armhf 0.6.31-5 [55.4 kB]
Get:9 http://mirrordirector.raspbian.org/raspbian/ jessie/main libpcre3-dev armhf 2:8.35-3.3+deb8u4 [413 kB]
Get:10 http://mirrordirector.raspbian.org/raspbian/ jessie/main libglib2.0-dev armhf 2.42.1-1 [2,472 kB]
Get:11 http://mirrordirector.raspbian.org/raspbian/ jessie/main libpulse-dev armhf 5.0-13 [87.2 kB]
Get:12 http://mirrordirector.raspbian.org/raspbian/ jessie/main libpython-dev armhf 2.7.9-1 [19.6 kB]
Get:13 http://mirrordirector.raspbian.org/raspbian/ jessie/main libsox-fmt-alsa armhf 14.4.1-5 [47.0 kB]
Get:14 http://mirrordirector.raspbian.org/raspbian/ jessie/main libsox-fmt-base armhf 14.4.1-5 [63.8 kB]
Get:15 http://mirrordirector.raspbian.org/raspbian/ jessie/main libsox-fmt-mp3 armhf 14.4.1-5 [52.1 kB]
Get:16 http://mirrordirector.raspbian.org/raspbian/ jessie/main python2.7-dev armhf 2.7.9-2+deb8u1 [287 kB]
Get:17 http://mirrordirector.raspbian.org/raspbian/ jessie/main sox armhf 14.4.1-5 [135 kB]
Get:18 http://mirrordirector.raspbian.org/raspbian/ jessie/main swig2.0 armhf 2.0.12-1 [1,071 kB]
Get:19 http://mirrordirector.raspbian.org/raspbian/ jessie/main swig armhf 2.0.12-1 [285 kB]
Fetched 23.5 MB in 23s (989 kB/s)                                              
Selecting previously unselected package libopencore-amrnb0:armhf.
(Reading database ... 125645 files and directories currently installed.)
Preparing to unpack .../libopencore-amrnb0_0.1.3-2.1_armhf.deb ...
Unpacking libopencore-amrnb0:armhf (0.1.3-2.1) ...
Selecting previously unselected package libopencore-amrwb0:armhf.
Preparing to unpack .../libopencore-amrwb0_0.1.3-2.1_armhf.deb ...
Unpacking libopencore-amrwb0:armhf (0.1.3-2.1) ...
Selecting previously unselected package libpython2.7-dev:armhf.
Preparing to unpack .../libpython2.7-dev_2.7.9-2+deb8u1_armhf.deb ...
Unpacking libpython2.7-dev:armhf (2.7.9-2+deb8u1) ...
Selecting previously unselected package libsox2:armhf.
Preparing to unpack .../libsox2_14.4.1-5_armhf.deb ...
Unpacking libsox2:armhf (14.4.1-5) ...
Selecting previously unselected package libavahi-common-dev.
Preparing to unpack .../libavahi-common-dev_0.6.31-5_armhf.deb ...
Unpacking libavahi-common-dev (0.6.31-5) ...
Selecting previously unselected package libdbus-1-dev:armhf.
Preparing to unpack .../libdbus-1-dev_1.8.22-0+deb8u1_armhf.deb ...
Unpacking libdbus-1-dev:armhf (1.8.22-0+deb8u1) ...
Selecting previously unselected package libavahi-client-dev.
Preparing to unpack .../libavahi-client-dev_0.6.31-5_armhf.deb ...
Unpacking libavahi-client-dev (0.6.31-5) ...
Selecting previously unselected package libpcre3-dev:armhf.
Preparing to unpack .../libpcre3-dev_2%3a8.35-3.3+deb8u4_armhf.deb ...
Unpacking libpcre3-dev:armhf (2:8.35-3.3+deb8u4) ...
Selecting previously unselected package libglib2.0-dev.
Preparing to unpack .../libglib2.0-dev_2.42.1-1_armhf.deb ...
Unpacking libglib2.0-dev (2.42.1-1) ...
Selecting previously unselected package libpulse-dev:armhf.
Preparing to unpack .../libpulse-dev_5.0-13_armhf.deb ...
Unpacking libpulse-dev:armhf (5.0-13) ...
Selecting previously unselected package libpython-dev:armhf.
Preparing to unpack .../libpython-dev_2.7.9-1_armhf.deb ...
Unpacking libpython-dev:armhf (2.7.9-1) ...
Selecting previously unselected package libsox-fmt-alsa:armhf.
Preparing to unpack .../libsox-fmt-alsa_14.4.1-5_armhf.deb ...
Unpacking libsox-fmt-alsa:armhf (14.4.1-5) ...
Selecting previously unselected package libsox-fmt-base:armhf.
Preparing to unpack .../libsox-fmt-base_14.4.1-5_armhf.deb ...
Unpacking libsox-fmt-base:armhf (14.4.1-5) ...
Selecting previously unselected package libsox-fmt-mp3:armhf.
Preparing to unpack .../libsox-fmt-mp3_14.4.1-5_armhf.deb ...
Unpacking libsox-fmt-mp3:armhf (14.4.1-5) ...
Selecting previously unselected package python2.7-dev.
Preparing to unpack .../python2.7-dev_2.7.9-2+deb8u1_armhf.deb ...
Unpacking python2.7-dev (2.7.9-2+deb8u1) ...
Selecting previously unselected package python-dev.
Preparing to unpack .../python-dev_2.7.9-1_armhf.deb ...
Unpacking python-dev (2.7.9-1) ...
Selecting previously unselected package sox.
Preparing to unpack .../sox_14.4.1-5_armhf.deb ...
Unpacking sox (14.4.1-5) ...
Selecting previously unselected package swig2.0.
Preparing to unpack .../swig2.0_2.0.12-1_armhf.deb ...
Unpacking swig2.0 (2.0.12-1) ...
Selecting previously unselected package swig.
Preparing to unpack .../swig_2.0.12-1_armhf.deb ...
Unpacking swig (2.0.12-1) ...
Processing triggers for man-db (2.7.5-1~bpo8+1) ...
Processing triggers for libglib2.0-0:armhf (2.42.1-1) ...
Processing triggers for mime-support (3.58) ...
Setting up libopencore-amrnb0:armhf (0.1.3-2.1) ...
Setting up libopencore-amrwb0:armhf (0.1.3-2.1) ...
Setting up libpython2.7-dev:armhf (2.7.9-2+deb8u1) ...
Setting up libsox2:armhf (14.4.1-5) ...
Setting up libavahi-common-dev (0.6.31-5) ...
Setting up libdbus-1-dev:armhf (1.8.22-0+deb8u1) ...
Setting up libavahi-client-dev (0.6.31-5) ...
Setting up libpcre3-dev:armhf (2:8.35-3.3+deb8u4) ...
Setting up libglib2.0-dev (2.42.1-1) ...
Setting up libpulse-dev:armhf (5.0-13) ...
Setting up libpython-dev:armhf (2.7.9-1) ...
Setting up libsox-fmt-alsa:armhf (14.4.1-5) ...
Setting up libsox-fmt-base:armhf (14.4.1-5) ...
Setting up libsox-fmt-mp3:armhf (14.4.1-5) ...
Setting up python2.7-dev (2.7.9-2+deb8u1) ...
Setting up python-dev (2.7.9-1) ...
Setting up sox (14.4.1-5) ...
Setting up swig2.0 (2.0.12-1) ...
Setting up swig (2.0.12-1) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libffi5 python-chardet python-colorama python-distlib python-html5lib
  python-ndg-httpsclient python-pyasn1 python-requests python-six
  python-urllib3 python-wheel
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  python-pip
0 upgraded, 0 newly installed, 1 to remove and 25 not upgraded.
After this operation, 481 kB disk space will be freed.
(Reading database ... 127049 files and directories currently installed.)
Removing python-pip (1.5.6-5) ...
Processing triggers for man-db (2.7.5-1~bpo8+1) ...
Searching for pip
Reading https://pypi.python.org/simple/pip/
Best match: pip 9.0.1
Downloading https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
Processing pip-9.0.1.tar.gz
Writing /tmp/easy_install-B4Lsew/pip-9.0.1/setup.cfg
Running pip-9.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-B4Lsew/pip-9.0.1/egg-dist-tmp-uX7a4l
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
  warnings.warn(msg)
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching '.landscape.yml'
warning: no previously-included files found matching 'pip/_vendor/Makefile'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'appveyor.yml'
no previously-included directories found matching '.github'
no previously-included directories found matching '.travis'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'contrib'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
Adding pip 9.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
Collecting requests>=2.13.0 (from -r ./requirements.txt (line 1))
  Downloading requests-2.18.1-py2.py3-none-any.whl (88kB)
    100% |????????????????????????????????| 92kB 736kB/s 
Collecting CherryPy>=10.1.1 (from -r ./requirements.txt (line 2))
  Downloading CherryPy-11.0.0-py2.py3-none-any.whl (435kB)
    100% |????????????????????????????????| 440kB 642kB/s 
Collecting python-vlc from git+https://github.com/oaubert/python-vlc.git#egg=python-vlc (from -r ./requirements.txt (line 3))
  Cloning https://github.com/oaubert/python-vlc.git to /tmp/pip-build-LJoYYX/python-vlc
Collecting pyalsaaudio>=0.8.4 (from -r ./requirements.txt (line 4))
  Downloading pyalsaaudio-0.8.4.tar.gz (315kB)
    100% |????????????????????????????????| 317kB 607kB/s 
Collecting webrtcvad>=2.0.10 (from -r ./requirements.txt (line 5))
  Downloading webrtcvad-2.0.10.tar.gz (66kB)
    100% |????????????????????????????????| 71kB 730kB/s 
Collecting pyyaml (from -r ./requirements.txt (line 6))
  Downloading PyYAML-3.12.tar.gz (253kB)
    100% |????????????????????????????????| 256kB 548kB/s 
Collecting pocketsphinx>=0.1.3 (from -r ./requirements.txt (line 7))
  Downloading pocketsphinx-0.1.3.zip (29.3MB)
    100% |????????????????????????????????| 29.3MB 867kB/s 
Collecting coloredlogs (from -r ./requirements.txt (line 8))
  Downloading coloredlogs-7.0-py2.py3-none-any.whl
Collecting future>=0.16.0 (from -r ./requirements.txt (line 9))
  Downloading future-0.16.0.tar.gz (824kB)
    100% |????????????????????????????????| 829kB 785kB/s 
Collecting certifi>=2017.4.17 (from requests>=2.13.0->-r ./requirements.txt (line 1))
  Downloading certifi-2017.4.17-py2.py3-none-any.whl (375kB)
    100% |????????????????????????????????| 378kB 527kB/s 
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.13.0->-r ./requirements.txt (line 1))
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |????????????????????????????????| 143kB 614kB/s 
Collecting urllib3<1.22,>=1.21.1 (from requests>=2.13.0->-r ./requirements.txt (line 1))
  Downloading urllib3-1.21.1-py2.py3-none-any.whl (131kB)
    100% |????????????????????????????????| 133kB 669kB/s 
Collecting idna<2.6,>=2.5 (from requests>=2.13.0->-r ./requirements.txt (line 1))
  Downloading idna-2.5-py2.py3-none-any.whl (55kB)
    100% |????????????????????????????????| 61kB 521kB/s 
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from CherryPy>=10.1.1->-r ./requirements.txt (line 2))
Collecting portend>=2.1.1 (from CherryPy>=10.1.1->-r ./requirements.txt (line 2))
  Downloading portend-2.1.2-py2.py3-none-any.whl
Collecting cheroot>=5.2.0 (from CherryPy>=10.1.1->-r ./requirements.txt (line 2))
  Downloading cheroot-5.7.0-py2.py3-none-any.whl (63kB)
    100% |????????????????????????????????| 71kB 731kB/s 
Collecting humanfriendly>=3.2 (from coloredlogs->-r ./requirements.txt (line 8))
  Downloading humanfriendly-4.3-py2.py3-none-any.whl (64kB)
    100% |????????????????????????????????| 71kB 768kB/s 
Collecting tempora>=1.8 (from portend>=2.1.1->CherryPy>=10.1.1->-r ./requirements.txt (line 2))
  Downloading tempora-1.8-py2.py3-none-any.whl
Collecting monotonic; python_version == "2.6" or python_version == "2.7" or python_version == "3.0" or python_version == "3.1" or python_version == "3.2" (from humanfriendly>=3.2->coloredlogs->-r ./requirements.txt (line 8))
  Downloading monotonic-1.3-py2.py3-none-any.whl
Collecting pytz (from tempora>=1.8->portend>=2.1.1->CherryPy>=10.1.1->-r ./requirements.txt (line 2))
  Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
    100% |????????????????????????????????| 491kB 541kB/s 
Installing collected packages: certifi, chardet, urllib3, idna, requests, pytz, tempora, portend, cheroot, CherryPy, python-vlc, pyalsaaudio, webrtcvad, pyyaml, pocketsphinx, monotonic, humanfriendly, coloredlogs, future
  Found existing installation: chardet 2.3.0
    Uninstalling chardet-2.3.0:
      Successfully uninstalled chardet-2.3.0
  Found existing installation: urllib3 1.9.1
    Uninstalling urllib3-1.9.1:
      Successfully uninstalled urllib3-1.9.1
  Found existing installation: requests 2.4.3
    Uninstalling requests-2.4.3:
      Successfully uninstalled requests-2.4.3
  Running setup.py install for python-vlc ... done
  Running setup.py install for pyalsaaudio ... done
  Running setup.py install for webrtcvad ... done
  Running setup.py install for pyyaml ... done
  Running setup.py install for pocketsphinx ... done
  Running setup.py install for future ... done
Successfully installed CherryPy-11.0.0 certifi-2017.4.17 chardet-3.0.4 cheroot-5.7.0 coloredlogs-7.0 future-0.16.0 humanfriendly-4.3 idna-2.5 monotonic-1.3 pocketsphinx-0.1.3 portend-2.1.2 pyalsaaudio-0.8.4 python-vlc-1.1.2 pytz-2017.2 pyyaml-3.12 requests-2.18.1 tempora-1.8 urllib3-1.21.1 webrtcvad-2.0.10
Requirement already satisfied: RPi.GPIO in /usr/lib/python2.7/dist-packages

Creating configuration file /etc/opt/AlexaPi/config.yaml ...
Enter your Device Type ID []: Raspberry_Pi
Enter your Security Profile Description []: Default
Enter your Security Profile ID []: amzn1.application.xxx101b1381c48599b796aa3xxxxxxx
Enter your Client ID []: amzn1.application-oa2-client.xxx528b1156d475ebc8a21149xxxxxxx
Enter your Client Secret []: xxxxxxxc5426aa4430bd88a76762c7b019be7348d764f6490fc375xxxxxxx
Ready goto http://192.168.1.11:5050 or http://localhost:5050  to begin the auth process
(Press Ctrl-C to exit this script once authorization is complete)
chixinmu commented 7 years ago

@nuentes it is because the URLs is not correct, refer to the installation of guide, it's http://ALEXA.DEVICE.IP.ADDRESS:5050/code where different to the alexa-avs-sample-app install guide.

nuentes commented 7 years ago

I'm going to the addresses provided by alexa-pi in the 2nd to last line of my last post:

both give the error I mentioned above.

Both give a 500 Internal Server error.

hellad commented 7 years ago

Try to use not local IP address, but rather your full.domain.name:5050 . Ensure port 5050 on your Raspberry is available from internet for Amazon servers. For me it works.

nuentes commented 7 years ago

I've tried all the following: 192.168.1.11:5050 (tested on both host and client) localhost:5050 (tested on host only) www.mydomain.com:5050 (tested on host and client)

All of them result in the Amazon error which I displayed. Isn't receiving the Amazon error proof that the connection is being made, anyway? Why else would all these tests resolve to Amazon.com? The connection can't possibly be the issue.

I've turned off my Pi's VPN entirely, and the issue persists. Port 5050 is not being used by any other service, as far as I know. If it were, I doubt I'd be able to load the page at all.

maso27 commented 7 years ago

So just to be sure, You went to developer.amazon.com and logged in.
Navigated to the settings for your alexa device. Under Security Profile / Web settings, you entered:

Now, edit your config file with sudo nano /etc/opt/AlexaPi/config.yaml Go down to the Amazon Alexa settings, and verify that you have the right things entered for:

They should match everything in your developer.amazon.com account from above. Exit and save changes.

Next, run sudo /opt/AlexaPi/src/auth_web.py. From a separate computer, on the same network, navigate to 192.168.1.11:5050 and log in with your amazon credentials.

That should work. If it doesn't, go back and make sure you haven't mis-typed something. Every time I've run into this problem I've fat-fingered something.

nuentes commented 7 years ago

Ah - there we go. I forgot to change the Allowed Origins and Allowed Return URLs in the Developer console from alexa-avs-sample-app. That took care of it. My bad. I'm an idiot.

maso27 commented 7 years ago

No worries! I've previously lost a couple days on a space where it shouldn't have been. :)

rbaudanza commented 6 years ago

I am getting the same error. Checked config.yaml, it matches everything I have for my security profile. The one difference is in the web settings it doesn't allow to use http for anything other than localhost. Here are my entries

Allowed Origins http://localhost:5050 https://192.186.86.40:5050
Allowed Return URLs http://localhost:5050/code

https://192.186.86.40:5050/code

Here is the error I'm getting from amazon. It's weird because I think it needs to have the return URL set to http://my.pi.ip.address:5050 but it won't let me add that on the amazon developer page. It only accepts https.

Error Summary 400 Bad Request The redirect URI you provided has not been whitelisted for your application. Please add your redirect URI in the 'Allowed Return URLs' section under 'Web Settings' for your Security Profile on Amazon Developer Portal. Request Details scope=alexa%3Aall redirect_uri=http%3A%2F%2F192.168.86.40%3A5050%2Fcode response_type=code client_id=I redacted this but verified it is correct in config.yaml. scope_data=%7B%22alexa%3Aall%22%3A+%7B%22productInstanceAttributes%22%3A+%7B%22deviceSerialNumber%22%3A+%22721d24bab2580c6cbe4fdb8f610b0d88c10144b6f4c88db74b216699a595deb2%22%7D%2C+%22productID%22%3A+%22Grace%22%7D%7D

bekirdag commented 6 years ago

In my case it was a cherrpy issue. I installed the 10.x version, but later installing the 17.4.0 version fixed the issue.

sudo pip install CherryPy==17.4.0

Details: When I tried to see if it was a cherrpy issue and tested a simple server, I started to get the below error: Module_six_moves_urllib_parse' object has no attribute 'unquote_to_bytes

I have upgraded the package called six (from v10 to v11) but it didn't solve the issue.

Why not upgrading to the latest version of cheerypy? Because <18.x requires <=python 3.5