-
Notifications
You must be signed in to change notification settings - Fork 192
Issues with Amazon Alexa Voice Service #225
Comments
Thanks for raising this issue! So it seems like Amazon has done the same as Apple's push notifications service, and only offers ALPN for the negotiation. Your machine seems like it doesn't have a new enough OpenSSL to negotiate with ALPN, so hyper concludes that it can't safely use HTTP/2: Amazon concludes otherwise. The current development branch has a |
Sure, can I just check how to install the dev branch to get the CLI? for this one I just did pip install |
Sure, run |
root@AlexaPiV2:~# pip install git+https://github.com/Lukasa/hyper.git@development Cleaning up... root@AlexaPiV2:~# cat /root/.pip/pip.log/usr/bin/pip run on Mon Apr 18 10:49:43 2016 Cleaning up... |
What pip version do you have? Seems like it can't handle the pip version specifiers being used. |
root@AlexaPiV2:~# pip -V pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7) I'm running on a RaspberryPi with the latest Raspian build On Mon, Apr 18, 2016 at 12:10 PM, Cory Benfield [email protected]
|
Yeah, pip 1.5.6 is quite old. This might be fixable on the development branch but I'm currently on my phone at an airport so I can't check until later. In the meantime, if you're familiar with virtualenv you can create one of those and then upgrade pip inside it ( |
Thanks, I'll have a play later, should get back to the day job! have a good On Mon, Apr 18, 2016 at 12:30 PM, Cory Benfield [email protected]
|
Got the dev branch installed in a venv, however now I'm getting a new error: |
Ah, yes. Ok, that's a real bug. I'll take a swing at it in the next 24 hours: should be an easy fix. |
oh cool thanks :) On Tue, Apr 19, 2016 at 8:13 PM, Cory Benfield [email protected]
|
@sammachin I believe I've fixed this: want to try again with the new tip? |
I've been following this thread since its inception, and I'm happy to say that hyper is now working just fine with Amazon's AVS. Thanks for actively developing hyper and keeping up on this kind of stuff! It is much appreciated. |
@nicholasjconn Happy to do it! I've got a release of hyper-h2 upcoming: when I've shipped that, I should have some time to spare to get this library into shape for a new release. |
Yep seems to be working, thanks for sorting this so quickly :) Now to try and decipher the rest of this AVS api! |
Correct me if I'm wrong, but if I'm using hyper with the requests adapter, it seems there's no way to to set the |
Correct; that work is sitting in #214 and is as-yet unfinished. To get this to work without that option you'll need OpenSSL 1.0.2. What OS are you using? |
I'm on raspbian (debian) jessie, having a hard time finding a package for it. Might just trying to build it unless you have any tips. |
Hm, installed openssl 1.0.2h from debian/testing and I'm still getting the same error. Tried recompiling python 3.5 as well. Any ideas? |
@joshdover To be clear, what error are you getting? Also, can you please confirm that the Python you're using is linked against your new OpenSSL? |
Amazon have released a new API for Alexa but its HTTP/2 only, this is my first attempts with http/2 but there seems to be a problem with accessing the amazon API using hyper, other test servers work fine and I can also connect using curl, I get this error using either hyper on the command line or in a script.
(Token redacted to XXXXX, message me if you need a token to test with)
root@AlexaPiV2:
/curl-7.48.0# hyper --debug GET https://avs-alexa-na.amazon.com/v20160207/directives 'Authorization:Bearer XXXXXXXXXXXXXXXX'/curl-7.48.0#Url Info: {'secure': True, 'fragment': None, 'netloc': 'avs-alexa-na.amazon.com', 'host': 'avs-alexa-na.amazon.com', 'query': None, 'path': '/v20160207/directives', 'scheme': 'https', 'port': 443}
Commandline Argument: Namespace(_url='https://avs-alexa-na.amazon.com/v20160207/directives', body=None, debug=True, h2=False, headers={'Authorization': 'Bearer XXXXXXXXXXXX'}, items=[<hyper.cli.KeyValue object at 0x766c45f0>], method='GET', url=<hyper.cli.UrlInfo object at 0x766c4710>)
Selected protocol: None
Traceback (most recent call last):
File "/usr/local/bin/hyper", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/hyper/cli.py", line 244, in main
data = request(args)
File "/usr/local/lib/python2.7/dist-packages/hyper/cli.py", line 234, in request
response = conn.get_response()
File "/usr/local/lib/python2.7/dist-packages/hyper/common/connection.py", line 124, in get_response
return self._conn.get_response(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/hyper/http11/connection.py", line 199, 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 1 value to unpack
root@AlexaPiV2:
The text was updated successfully, but these errors were encountered: