Kodi Community Forum
Release Kanzi: Amazon Alexa skill for Kodi - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: Release Kanzi: Amazon Alexa skill for Kodi (/showthread.php?tid=254502)



RE: Amazon Echo skill for Kodi - sveni_lee - 2017-04-15

Hi maybe someone can help me.
I tried to host the Skill on my own Apche2 Webserver.
so I follwed this guide http://forum.kodi.tv/showthread.php?tid=254502&pid=2411411#pid2411411 and change some little thinks according to the new
version 2.5 of the Skill.

default-ssl.conf
Code:
DocumentRoot /var/www/html
WSGIScriptAlias /kodi-alexa /var/www/html/kodi-alexa/alexa.wsgi

but when I Test the setup I allways get an error.

Code:
There was an error calling the remote endpoint, which returned HTTP 404 : NOT FOUND

my Apache others_vhost_access.log shows the following error
Code:
mein_server.de:443 72.21.217.182 - - [15/Apr/2017:10:21:53 +0200] "POST /kodi-alexa/alexa.wsgi HTTP/1.1" 404 3510 "-" "Apache-HttpClient/UNAVAILABLE (Java/1.8.0_112)"

any Idea?


RE: Amazon Echo skill for Kodi - wellsecond - 2017-04-15

I am getting this when trying pip install awscli:

Code:
Collecting awscli
  Using cached awscli-1.11.76-py2.py3-none-any.whl
Collecting colorama<=0.3.7,>=0.2.5 (from awscli)
  Using cached colorama-0.3.7-py2.py3-none-any.whl
Requirement already satisfied: s3transfer<0.2.0,>=0.1.9 in ./Library/Python/2.7/lib/python/site-packages (from awscli)
Collecting botocore==1.5.39 (from awscli)
  Using cached botocore-1.5.39-py2.py3-none-any.whl
Requirement already satisfied: docutils>=0.10 in ./Library/Python/2.7/lib/python/site-packages (from awscli)
Collecting rsa<=3.5.0,>=3.1.2 (from awscli)
  Using cached rsa-3.4.2-py2.py3-none-any.whl
Collecting PyYAML<=3.12,>=3.10 (from awscli)
Requirement already satisfied: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in ./Library/Python/2.7/lib/python/site-packages (from s3transfer<0.2.0,>=0.1.9->awscli)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /usr/local/lib/python2.7/site-packages (from botocore==1.5.39->awscli)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in ./Library/Python/2.7/lib/python/site-packages (from botocore==1.5.39->awscli)
Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli)
  Using cached pyasn1-0.2.3-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore==1.5.39->awscli)
  Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: colorama, botocore, pyasn1, rsa, PyYAML, awscli, six
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/lib/python2.7/site-packages/colorama-0.3.7.dist-info/RECORD'



RE: Amazon Echo skill for Kodi - fantasticn - 2017-04-15

Sorry if this a question that has been given an answer before. But heading through the thread I could not find any:
I have five media players running kodi at my place. What would I have to adjust to control them by there respective names? Do I need to have a separate server running on Heroku or Lambda for every one of them?
Thanx in advance for any explanation!


RE: Amazon Echo skill for Kodi - bill_orange - 2017-04-15

This release of the Kodi skill searches way faster than the prior release. I don't know if that is a result of the use of Zappa or tighter code but either way it makes it much more usable on big music libraries. Thanks for the hard work.

I tested the new capability to run addons with mixed results. "Alexa, ask kodi media to run pandoki often resulted in Alexa giving me the current play time. It works well in the simulator.

I have also gotten a few "there is a problem with your skills request" errors in attempting to run addons. Here's a log results:


Playing album or song

14:47:31
Sending request to http://redacted.duckdns.org:8080/jsonrpc

14:47:36
[2017-04-15 14:47:36,179] ERROR in c:\users\william\appdata\local\temp\pip-build-_pp9vb\Flask\flask\app: Exception on / [POST]

14:47:36
Traceback (most recent call last):

14:47:36
File "c:\users\william\appdata\local\temp\pip-build-_pp9vb\Flask\flask\app.py", line 1982, in wsgi_app

14:47:36
File "c:\users\william\appdata\local\temp\pip-build-_pp9vb\Flask\flask\app.py", line 1614, in full_dispatch_request

14:47:36
File "c:\users\william\appdata\local\temp\pip-build-_pp9vb\Flask\flask\app.py", line 1517, in handle_user_exception

14:47:36
File "c:\users\william\appdata\local\temp\pip-build-_pp9vb\Flask\flask\app.py", line 1612, in full_dispatch_request

14:47:36
File "c:\users\william\appdata\local\temp\pip-build-_pp9vb\Flask\flask\app.py", line 1598, in dispatch_request

14:47:36
File "c:\users\william\appdata\local\temp\pip-build-_pp9vb\flask-ask\flask_ask\core.py", line 563, in _flask_view_func

14:47:36
File "/var/task/alexa.py", line 525, in alexa_listen_album_or_song

14:47:36
located = kodi.matchHeard(heard_artist, artists_list, 'artist')

14:47:36
UnboundLocalError: local variable 'heard_artist' referenced before assignment

14:47:36
[INFO] 2017-04-15T14:47:36.197Z 740afb23-21ea-11e7-9e6d-33579cebdb94 72.21.217.76 - - [15/Apr/2017:14:47:36 +0000] "POST / HTTP/1.1" 500 291 "" "Apache-HttpClient/4.5.x (Java/1.8.0_112)" 0/5035.738

14:47:36
END RequestId: 740afb23-21ea-11e7-9e6d-33579cebdb94

14:47:36
REPORT RequestId: 740afb23-21ea-11e7-9e6d-33579cebdb94 Duration: 5037.50 ms Billed Duration: 5100 ms Memory Size:



Seems odd. To my inexperienced eyes, it looks like it misinterpreted the 'run pandoki' utterance in a way that caused an un-trapped error.

I thought you would like to see this and I am curious if anyone can duplicate it.


RE: Amazon Echo skill for Kodi - m0ngr31 - 2017-04-15

I can see the issue in the code. I'll get it fixed today.


RE: Amazon Echo skill for Kodi - wellsecond - 2017-04-15

(2017-04-15, 18:27)m0ngr31 Wrote: I can see the issue in the code. I'll get it fixed today.

Could you give me a hand with the error reported in my previous post? I can't install awscli.


RE: Amazon Echo skill for Kodi - m0ngr31 - 2017-04-15

I think you'll have to use "sudo" to install it.


RE: Amazon Echo skill for Kodi - wellsecond - 2017-04-15

(2017-04-15, 19:50)m0ngr31 Wrote: I think you'll have to use "sudo" to install it.

Won't it mess up my system python?


RE: Amazon Echo skill for Kodi - jingai - 2017-04-15

(2017-04-15, 14:52)fantasticn Wrote: Sorry if this a question that has been given an answer before. But heading through the thread I could not find any:
I have five media players running kodi at my place. What would I have to adjust to control them by there respective names? Do I need to have a separate server running on Heroku or Lambda for every one of them?
Thanx in advance for any explanation!

Yes, you need to have a separate skill for for each instance of Kodi at the moment.


RE: Amazon Echo skill for Kodi - wellsecond - 2017-04-16

Well, I succeeded with sudo -H pip install awscli --upgrade --ignore-installed six.


RE: Amazon Echo skill for Kodi - bill_orange - 2017-04-16

I reboot Kodi a lot. A reboot causes the TV and Receiver to turn on in one operation. The new echo skill does not reboot reliably. I have had it work once or twice. Usually it goes like this.

Alexa, ask Kodi media to reboot.

Are you sure?

Yes.

Are you sure?

Yes.

There was a problem communicating with the requested skill.

I took a look in cloudwatch and here's what I found.

22:15:10
[DEBUG] 2017-04-15T22:15:10.410Z fd68f5f3-2228-11e7-b265-0d1825bac136 Zappa Event: {u'body': u'eyJ2ZXJzaW9uIjoiMS4wIiwic2Vzc2lvbiI6eyJuZXciOnRydWUsInNlc3Np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sgn2', u'resourcePath': u'/', u'httpMethod': u'POST', u'requestId': u'fd612e22-2228-11e7-b46c-5de8ed706784', u'accountId': u'703057253001', u'identity': {u'apiKey': None, u'userArn': None, u'cognitoAuthenticationType': None, u'accessKey': None, u'caller': None, u'userAgent': u'Apache-HttpClient/4.5.x (Java/1.8.0_112)', u'user': None, u'cognitoIdentityPoolId': None, u'cognitoIdentityId': None, u'cognitoAuthenticationProvider': None, u'sourceIp': u'72.21.217.181', u'accountId': None}, u'stage': u'dev'}, u'queryStringParameters': None, u'httpMethod': u'POST', u'pathParameters': None, u'headers': {u'Content-Type': u'application/json; charset=utf-8', u'Via': u'1.1 4a470688318a5a155ec4569c394ac52f.cloudfront.net (CloudFront)', u'CloudFront-Is-Desktop-Viewer': u'true', u'CloudFront-Is-SmartTV-Viewer': u'false', u'SignatureCertChainUrl': u'https://s3.amazonaws.com/echo.api/echo-api-cert-4.pem', u'CloudFront-Is-Mobile-Viewer': u'false', u'X-Forwarded-For': u'72.21.217.181, 54.239.145.72', u'CloudFront-Viewer-Country': u'US', u'X-Forwarded-Port': u'443', u'Accept': u'application/json', u'User-Agent': u'Apache-HttpClient/4.5.x (Java/1.8.0_112)', u'X-Amzn-Trace-Id': u'Root=1-58f29b6e-7a7248f92bea73462320829d', u'Accept-Charset': u'utf-8', u'Host': u'5fj5egsgn2.execute-api.us-east-1.amazonaws.com', u'X-Forwarded-Proto': u'https', u'X-Amz-Cf-Id': u'8yvXaKOIlacNEl6H048vcHyYZtK5Pe10zK25lwX4UXM6uHNmVOCQ4w==', u'CloudFront-Is-Tablet-Viewer': u'false', u'Signature': u'ef3tzc0aCmw+XlSThdtJC1ZHh5qMxAOnRi3xvT49Oh2vvUFDJKrIY6RiI61/sygd8fXnW3AN435kn0SY45cnVb2YXNq8iWc29bMM80nZvz3nA7aVoge3qrLVM5RNBuGPMsVP9+8Rj1mLJtJ+jnX10UAWiTpNMKSnfTfH6sE9zA5EJ/c3vykJBNdTz4PCrGnrSpNNqIzXumobouH/ZywaTnMPlOytH8NPy+59sfVuh2pX7T+bstQ2IKl7FXoBnkjVNqvXM9Cgz6yr/Z3ZcCAgJyBdiz6DZbSyYnIfGbgZKCRDN+uz/tdSo1L6mXYz+dA4TtVTAYM4HjSdDSdx/Mo4fw==', u'CloudFront-Forwarded-Proto': u'https'}, u'stageVariables': None, u'path': u'/', u'isBase64Encoded': True}

All Greek to me. Not sure if I should have redacted anything form that.

Does that give you enough to figure this out?

Bill


RE: Amazon Echo skill for Kodi - jingai - 2017-04-16

(2017-04-15, 17:09)bill_orange Wrote: I tested the new capability to run addons with mixed results. "Alexa, ask kodi media to run pandoki often resulted in Alexa giving me the current play time. It works well in the simulator.

If it works every time in the simulator, then she's just hearing you incorrectly. You might try specifying 'addon' in your utterance and see if it improves her recognition:

"Alexa, ask Kodi media to run addon Pandoki"


RE: Amazon Echo skill for Kodi - jingai - 2017-04-16

(2017-04-16, 00:23)bill_orange Wrote: I reboot Kodi a lot. A reboot causes the TV and Receiver to turn on in one operation. The new echo skill does not reboot reliably. I have had it work once or twice. Usually it goes like this.

Alexa, ask Kodi media to reboot.

Are you sure?

Yes.

Are you sure?

Yes.

There was a problem communicating with the requested skill.

I just asked for reboot 5 times and all 5 times worked. There's not a whole lot there that can go wrong, honestly. We'd need to see the logs from the skill to see if it's doing something wrong, or your utterance is simply not making it to the skill.

It kind of sounds like she's not hearing you well. Instead of saying "yes," try something with more syllables, like "affirmative." If that works reliably, the trouble is with your Echo or Amazon's service.


RE: Amazon Echo skill for Kodi - jingai - 2017-04-16

@bill_orange, in the Alexa app, go to Settings->History and check that she's hearing what you're saying correctly.


RE: Amazon Echo skill for Kodi - bill_orange - 2017-04-16

(2017-04-16, 01:08)jingai Wrote: @bill_orange, in the Alexa app, go to Settings->History and check that she's hearing what you're saying correctly.

She heard "sure yes" rather than yes.

I would not expect the "There was a problem communicating with the requested skill' and the debug dump from that misunderstanding.

Odd.


This forum uses Lukasz Tkacz MyBB addons.