Closed amahlaka closed 8 years ago
AAND i found it by trying out random urls AuthUrl: "https://api.amazon.com" BaseUrl: "https://avs-alexa-na.amazon.com"
and found some more missing configs, like EventPath
Did you sign up here first? https://developer.amazon.com/login.html
Here is my config (developer info redacted)
# Rename this file to config.yaml and fill in the fields
sound:
# Name of your microphone/soundcard in arecord -L
# you can also try setting it to 'default'
device: "plughw:0"
# Amazon Alexa settings
debug:
alexa: 'debug'
#hpack: 'debug'
#hyper: 'debug'
#requests: 'debug'
alexa:
AuthUrl: "https://api.amazon.com"
BaseUrl: "https://avs-alexa-na.amazon.com"
EventPath: "/events"
API_Version: "v20160207"
Client_ID: ""
Client_Secret: ""
ProductID: "my_device"
Security_Profile_Description: ""
Security_Profile_ID: ""
refresh_token: ""
sphinx:
trigger_phrase: alexa
raspberrypi:
# GPIO Pin with button connected
button: 18
# GPIO Pin for the playback/activity light
plb_light: &plb_light 24
# GPIO Pin for the recording light
rec_light: &rec_light 25
# GPIO Pins with LED's connected
lights: [*plb_light, *rec_light]
alexa: Client_ID: "xx" Client_Secret: "x" ProductID: "AlexaPi" Security_Profile_Description: "AlexaPi description" Security_Profile_ID: "amzn1.application.x" refresh_token: "x" AuthUrl: "https://api.amazon.com" BaseUrl: "https://avs-alexa-na.amazon.com" EventPath: "/events" API_Version: "v20160207"
@davidmroth
Did you run the python ./auth_web.py
command to authorize your hardware?
yes
Please enable logging:
# Amazon Alexa settings
debug:`
alexa: 'debug'
#hpack: 'debug'
#hyper: 'debug'
#requests: 'debug'
2016-11-24 20:42:33,619 - alexa.http.http - INFO - Checking Internet Connection...
2016-11-24 20:42:33,622 - alexa.http.http - INFO - Connection OK
2016-11-24 20:42:34,778 - alexa.http.http - ERROR - <function <lambda> at 0x75691d30>(): Could not open AVS downchannel stream - https://avs-alexa-na.amazon.com/v20160207/directives
Can you comment out line 99 of src/alexa/http/http.py
?
`
`
Technically, this isn't working anyway, so it shouldn't be a problem. Pretty sure you're going to run into another issue. Still thinking something could be wrong with your config or developer settings.
2016-11-24 20:55:05,407 - alexa.http.http - ERROR - error: [Errno 32] Broken pipe
Traceback (most recent call last):
File "/opt/AlexaPi/src/alexa/http/http.py", line 191, in post
request = self.__session.post(full_url, headers=headers, files=payload, stream=True, timeout=None)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 522, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/contrib.py", line 78, in send
request.headers
File "/usr/local/lib/python2.7/dist-packages/hyper/common/connection.py", line 103, in request
method=method, url=url, body=body, headers=headers
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 183, in request
self._send_headers(method, url, headers)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 228, in _send_headers
self._sock.send(b' '.join([method, url, b'HTTP/1.1\r\n']))
File "/usr/lib/python2.7/ssl.py", line 667, in send
v = self._sslobj.write(data)
after i say Alexa and alexa says yes, it says instantly after that: error processing request
I'm almost positive Amazon is rejecting your security settings (broken pipe). Can you checkout the master branch and see if you have the same problem? Or maybe you have done that already. Let me know.
BTW, did you install the hyper package? My guess is you did. Just checking though...
hmm, maybe i try with new security profile
I would first checkout another branch and verify if the problem persists. That will isolate the issue to your profile or my branch. Again, I checked out the branch and it working for me, so something is different.
Let me know what you find...
i had a working installation on the master branch
Traceback (most recent call last):
File "./auth_web.py", line 12, in <module>
import alexapi.config
ImportError: No module named alexapi.config
Probably doesn't mean much, but I noticed your line 191 isn't the same as my line 191. Just to make sure, can you post line 191?
i made a clean reinstall just now
Traceback (most recent call last):
File "./auth_web.py", line 12, in <module>
import alexapi.config
ImportError: No module named alexapi.config
change import alexapi.config
to from alexa.helper.config import config
and then remove lines:
with open(alexapi.config.filename, 'r') as stream:
config = yaml.load(stream)
!! Traceback (most recent call last):
!! File "main.py", line 221, in
hmm i did the changes to auth_web, but after i click yes on the page it gives me error 500
Add to line: 20
else:
Debug = False
to src/alexa/helper/shared.py
Should look like this when you're done:
#Get config
if config and 'debug' in config and 'alexa' in config['debug']:
if config['debug']['alexa']: debug = True
else:
debug = False
Also, if you update your config.yaml
with these line:
# Amazon Alexa settings
debug:
alexa: 'debug'
#hpack: 'debug'
#hyper: 'debug'
#requests: 'debug'
hmm, still getting problems with the auth_web
What problem now?
Error 500 after clicking Yes on the auth page
btw, are you in the alexapi Gitter?
What do you have configured in your developer settings?
Make it look like mine, but use the IP address of your device.
Send me a screen shot. BTW, you can paste images directly into the comment box.
Error: A URL must be between 1 and 2000 characters.
What? Doesn't make sense. Post an image of what you're trying to save. ...before you press save.
You probably need to remove the blank lines.
i cant
Right, just checked. Just duplicate the settings in the blank boxes
Wait... I'm getting the same error. Sorry... Let me see what the issue is... BRB
when did you last push?
So, here's the deal. Its been a few months since I've had to use this process. Hence the reason why my code base was not in sync with ./auth_web.py.
Looking into this now... Should have a fix shortly...
you need that :p
Ok, fixed!
Please do a git pull
from the avs_v2 branch.
Yeah, I deserve that... :-(
BTW, it's not like I didn't warn you... This is far from complete.
hmm,
alexa.http.http - ERROR - <function <lambda> at 0x755fbd30>(): Could not open AVS downchannel stream - https://avs-alexa-na.amazon.com/v20160207/directives
Traceback (most recent call last):
File "/opt/AlexaPi/src/alexa/http/http.py", line 146, in __open_downchannel_stream
response = self.__session.get(full_url, headers=headers, stream=True, timeout=None)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 488, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/contrib.py", line 80, in send
resp = conn.get_response()
File "/usr/local/lib/python2.7/dist-packages/hyper/common/connection.py", line 129, in get_response
return self._conn.get_response(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 204, in get_response
response = self.parser.parse_response(self._sock.buffer)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/parser.py", line 52, in parse_response
version, status, reason = temp_buffer[0:index].split(None, 2)
ValueError: need more than 2 values to unpack
2016-11-24 22:30:04,620 - alexa.http.http - ERROR - error: need more than 2 values to unpack
Traceback (most recent call last):
File "/opt/AlexaPi/src/alexa/http/http.py", line 146, in __open_downchannel_stream
response = self.__session.get(full_url, headers=headers, stream=True, timeout=None)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 488, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/contrib.py", line 80, in send
resp = conn.get_response()
File "/usr/local/lib/python2.7/dist-packages/hyper/common/connection.py", line 129, in get_response
return self._conn.get_response(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 204, in get_response
response = self.parser.parse_response(self._sock.buffer)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/parser.py", line 52, in parse_response
version, status, reason = temp_buffer[0:index].split(None, 2)
ValueError: need more than 2 values to unpack
2016-11-24 22:30:04,782 - alexa.http.http - ERROR - <function <lambda> at 0x755fbd30>(): Could not synchronize state - %s
Traceback (most recent call last):
File "/opt/AlexaPi/src/alexa/http/http.py", line 164, in __synchronize_state
request = self.__session.post(full_url, headers=headers, files=payload, stream=True, timeout=None)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 522, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/contrib.py", line 80, in send
resp = conn.get_response()
File "/usr/local/lib/python2.7/dist-packages/hyper/common/connection.py", line 129, in get_response
return self._conn.get_response(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 204, in get_response
response = self.parser.parse_response(self._sock.buffer)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/parser.py", line 52, in parse_response
version, status, reason = temp_buffer[0:index].split(None, 2)
ValueError: need more than 2 values to unpack
2016-11-24 22:30:04,785 - alexa.http.http - ERROR - error: need more than 2 values to unpack
Traceback (most recent call last):
File "/opt/AlexaPi/src/alexa/http/http.py", line 164, in __synchronize_state
request = self.__session.post(full_url, headers=headers, files=payload, stream=True, timeout=None)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 522, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/contrib.py", line 80, in send
resp = conn.get_response()
File "/usr/local/lib/python2.7/dist-packages/hyper/common/connection.py", line 129, in get_response
return self._conn.get_response(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 204, in get_response
response = self.parser.parse_response(self._sock.buffer)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/parser.py", line 52, in parse_response
version, status, reason = temp_buffer[0:index].split(None, 2)
ValueError: need more than 2 values to unpack
2016-11-24 22:30:14,512 - alexa.http.http - ERROR - <function <lambda> at 0x755fbd30>(): Could not post to: https://avs-alexa-na.amazon.com/v20160207/events/
Traceback (most recent call last):
File "/opt/AlexaPi/src/alexa/http/http.py", line 191, in post
request = self.__session.post(full_url, headers=headers, files=payload, stream=True, timeout=None)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 522, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/contrib.py", line 78, in send
request.headers
File "/usr/local/lib/python2.7/dist-packages/hyper/common/connection.py", line 103, in request
method=method, url=url, body=body, headers=headers
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 183, in request
self._send_headers(method, url, headers)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 228, in _send_headers
self._sock.send(b' '.join([method, url, b'HTTP/1.1\r\n']))
File "/usr/lib/python2.7/ssl.py", line 667, in send
v = self._sslobj.write(data)
error: [Errno 32] Broken pipe
2016-11-24 22:30:14,516 - alexa.http.http - ERROR - error: [Errno 32] Broken pipe
Traceback (most recent call last):
File "/opt/AlexaPi/src/alexa/http/http.py", line 191, in post
request = self.__session.post(full_url, headers=headers, files=payload, stream=True, timeout=None)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 522, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/contrib.py", line 78, in send
request.headers
File "/usr/local/lib/python2.7/dist-packages/hyper/common/connection.py", line 103, in request
method=method, url=url, body=body, headers=headers
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 183, in request
self._send_headers(method, url, headers)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 228, in _send_headers
self._sock.send(b' '.join([method, url, b'HTTP/1.1\r\n']))
File "/usr/lib/python2.7/ssl.py", line 667, in send
v = self._sslobj.write(data)
error: [Errno 32] Broken pipe
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/AlexaPi/src/alexa/avs/directive_dispatcher.py", line 76, in processor
log.debug("{}(process_response Error){} Status Code: {} - {}".format(shared.bcolors.WARNING, shared.bcolors.ENDC, r.status_code, r.text))
AttributeError: 'bool' object has no attribute 'status_code'
hmm i changed the port in the auth_web to 5050 as my 5000 is in use btw, it works after your update but still after i give alexa command, it says error processing
Are you one a Windows or Linux?
im on rasbian distro of debian on raspi
If port 5000 is in use, it could mean you have another python instance running. Can you run the command: ps aux | grep python
?
i know what is using it tho
Oh. Got it. Sorry
Missing info about newly required config parametres: AuthUrl, BaseUrl and API_Version related file: /src/alexa/http/http.py