• 1
  • 155
  • 156
  • 157(current)
  • 158
  • 159
  • 176
Release Kanzi: Amazon Alexa skill for Kodi
Hello,

first things first - I really  appreciate your work in this project! Great work so far!
May I ask for your help:
I don’t want to use the aws lamda service so I googled and found an Docker Image for self hosting on my media station (libreelec): 
https://hub.docker.com/r/mboeru/kodi-alexa/

•    On my raspPi I installed lexigram-cli
•    configured kodi.config to use local IP Address of Libreelec
•    pi: lexigram init-skill kanzi (without any error)
•    pi: lexigram deploy kanzi
  1. choosing “2” for KODI as invocation name
  2. URL for Skill server: https://xxxxx.ddns.net:8000/
Then I got this error:
Error:
Code:
::: 2018-05-04 08:25:14 :::
Error: Command failed: /home/pi/.nvm/versions/node/v9.11.1/lib/node_modules/lexigram-cli/dist/../node_modules/.bin/ask deploy -t skill
[Error]: Invalid url info.
Cannot find valid lambda function with the given name, nor find sourceDir as codebase path to create lambda function.

Q: I don’t want to use Lamda but it seems that the scripts wants to publish something with lamda function, is my configuration wrong?
Second and most important:: How can I solve this issue?
A view posts ago, I read about substitution URI with sourceDir in kanzi/skill.json but when I restart deploy process I guess the skill.json will be generated again and my changes will be overwritten, right?

Thanks in advanced!
Reply
Quote:Q: I don’t want to use Lamda but it seems that the scripts wants to publish something with lamda function, is my configuration wrong?
Second and most important:: How can I solve this issue?
A view posts ago, I read about substitution URI with sourceDir in kanzi/skill.json but when I restart deploy process I guess the skill.json will be generated again and my changes will be overwritten, right?

Amazon's error messages for this are pretty lame. They don't always seem to point to the correct thing. My best guess is that it doesn't like adding a port to the URL. Try dropping the `:8000` and deploying again. I know it won't make the skill work, but it'll be interesting to see if that resolves the error.

If that doesn't work, we can try some other things.
Reply
I'm attempting to self-host in a container on opensuse Leap 42.3.
I've deployed the Kanzi skill, changed the endpoint to use a self-signed certificate and uploaded the certificate but Alexa responds:
"There was a problem with the requested skill response" (it was a 500 server error). The relevant logs are:

[client 54.240.197.98:9476] [2018-05-04 18:16:37,796] ERROR in app: Exception on / [POST]
[client 54.240.197.98:9476] Traceback (most recent call last):
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
[client 54.240.197.98:9476]     response = self.full_dispatch_request()
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
[client 54.240.197.98:9476]     rv = self.handle_user_exception(e)
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
[client 54.240.197.98:9476]     reraise(exc_type, exc_value, tb)
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
[client 54.240.197.98:9476]     rv = self.dispatch_request()
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
[client 54.240.197.98:9476]     return self.view_functions[rule.endpoint](**req.view_args)
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/flask_ask/core.py", line 728, in _flask_view_func
[client 54.240.197.98:9476]     ask_payload = self._alexa_request(verify=self.ask_verify_requests)
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/flask_ask/core.py", line 662, in _alexa_request
[client 54.240.197.98:9476]     cert = verifier.load_certificate(cert_url)
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/flask_ask/verifier.py", line 21, in load_certificate
[client 54.240.197.98:9476]     if not _valid_certificate(cert):
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/flask_ask/verifier.py", line 63, in _valid_certificate
[client 54.240.197.98:9476]     value = str(extension)
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/OpenSSL/crypto.py", line 779, in __str__
[client 54.240.197.98:9476]     return self._subjectAltNameString()
[client 54.240.197.98:9476]   File "/usr/lib/python2.7/site-packages/OpenSSL/crypto.py", line 740, in _subjectAltNameString
[client 54.240.197.98:9476]     method = _lib.X509V3_EXT_get(self._extension)
[client 54.240.197.98:9476] AttributeError: 'module' object has no attribute 'X509V3_EXT_get'


I've also done an strace on the apache processes and that reveals that it fails when it can not find /var/lib/ca-certificates/openssl/8ad296c9.0 which should be a Certificate Authority file but doesn't exist. This isn't associated with my self generated cert or the one deployed at certifi/cacert.pem since they have different issuer/subject hashes.

Any ideas?

NOTE  for area2051 you can not specify a custom port for the endpoint, it has to use the default https port (443)

pip list
aniso8601 (1.2.0)
asn1crypto (0.24.0)
boto3 (1.7.12)
botocore (1.10.12)
bottle (0.12.8)
click (6.7)
configparser (3.5.0)
cryptography (2.2.2)
cupshelpers (1.0)
docutils (0.14)
Flask (0.12.1)
Flask-Ask (0.9.8)
fuzzywuzzy (0.16.0)
gunicorn (19.8.1)
idna (2.6)
itsdangerous (0.24)
Jinja2 (2.10)
jmespath (0.9.3)
Kodi-Voice (1.1.2)
MarkupSafe (1.0)
num2words (0.5.6)
pip (7.1.2)
py (1.4.31)
pyasn1 (0.1.9)
pycups (1.9.72)
pycurl (7.19.5.1)
pygobject (3.20.1)
pyocclient (0.4)
pyOpenSSL (17.0.0)
pysmbc (1.0.15.4)
python-dateutil (2.7.2)
pytz (2018.4)
PyYAML (3.12)
requests (2.7.0)
roman (2.0.0)
s3transfer (0.1.13)
setuptools (39.1.0)
simplejson (3.8.2)
six (1.11.0)
Werkzeug (0.14.1)
Reply
I've seen that error before from cryptography being at a incompatible version. Should be: cryptography==2.1.4 if you are on the latest master branch.
Reply
I’m just gonna drop this here for anyone that wants a solution that just works.

Amazon Echo Alexa Video Skill for Kodi
https://github.com/kodi-connect/kodi-ale.../readme.md
Reply
Cheers that sorted it.
When I installed kodi-voice that automatically installed the latest version of cryptography and I didn't spot that the requirement was for a specific version.

Next problem.

I'm talking to kodi and requests such as "Ask Kanzi to open music" or "Play all Music" work, but when I ask it to play something specific I get the "there was a problem with the requested skill response" (500 server error). Here are the relevant logs:

 [2018-05-04 23:22:30,891] ERROR in app: Exception on / [POST]
 Traceback (most recent call last):
   File "/srv/www/htdocs/Kanzi/flask/app.py", line 1982, in wsgi_app
     response = self.full_dispatch_request()
   File "/srv/www/htdocs/Kanzi/flask/app.py", line 1614, in full_dispatch_request
     rv = self.handle_user_exception(e)
   File "/srv/www/htdocs/Kanzi/flask/app.py", line 1517, in handle_user_exception
     reraise(exc_type, exc_value, tb)
   File "/srv/www/htdocs/Kanzi/flask/app.py", line 1612, in full_dispatch_request
     rv = self.dispatch_request()
   File "/srv/www/htdocs/Kanzi/flask/app.py", line 1598, in dispatch_request
     return self.view_functions[rule.endpoint](**req.view_args)
   File "/srv/www/htdocs/Kanzi/flask_ask/core.py", line 767, in _flask_view_func
     result = self._map_intent_to_view_func(self.request.intent)()
   File "/srv/www/htdocs/Kanzi/alexa.py", line 74, in decorated_function
     kodi = Kodi(config, context)
   File "/srv/www/htdocs/Kanzi/kodi_voice/kodi.py", line 387, in __init__
     if not self.scheme or not self.address or not self.port or not self.username or not self.password:
 AttributeError: Kodi instance has no attribute 'password'



Any ideas?
Reply
(2018-05-04, 23:39)tkislan Wrote: I’m just gonna drop this here for anyone that wants a solution that just works.

Amazon Echo Alexa Video Skill for Kodi
https://github.com/kodi-connect/kodi-ale.../readme.md
 Just an FYI on your solution: Amazon will never let you publish the skill. Having a perpetual beta is pretty awful since you can only do it for 90 days at a time and only have 500 users per beta. Have fun keeping the beta going constantly. I wish you the best of luck.
Reply
(2018-05-05, 00:41)Paranoid247 Wrote: Cheers that sorted it.
When I installed kodi-voice that automatically installed the latest version of cryptography and I didn't spot that the requirement was for a specific version.

Next problem.

I'm talking to kodi and requests such as "Ask Kanzi to open music" or "Play all Music" work, but when I ask it to play something specific I get the "there was a problem with the requested skill response" (500 server error). Here are the relevant logs:

 [2018-05-04 23:22:30,891] ERROR in app: Exception on / [POST]
 Traceback (most recent call last):
   File "/srv/www/htdocs/Kanzi/flask/app.py", line 1982, in wsgi_app
     response = self.full_dispatch_request()
   File "/srv/www/htdocs/Kanzi/flask/app.py", line 1614, in full_dispatch_request
     rv = self.handle_user_exception(e)
   File "/srv/www/htdocs/Kanzi/flask/app.py", line 1517, in handle_user_exception
     reraise(exc_type, exc_value, tb)
   File "/srv/www/htdocs/Kanzi/flask/app.py", line 1612, in full_dispatch_request
     rv = self.dispatch_request()
   File "/srv/www/htdocs/Kanzi/flask/app.py", line 1598, in dispatch_request
     return self.view_functions[rule.endpoint](**req.view_args)
   File "/srv/www/htdocs/Kanzi/flask_ask/core.py", line 767, in _flask_view_func
     result = self._map_intent_to_view_func(self.request.intent)()
   File "/srv/www/htdocs/Kanzi/alexa.py", line 74, in decorated_function
     kodi = Kodi(config, context)
   File "/srv/www/htdocs/Kanzi/kodi_voice/kodi.py", line 387, in __init__
     if not self.scheme or not self.address or not self.port or not self.username or not self.password:
 AttributeError: Kodi instance has no attribute 'password'



Any ideas?
 Yeah, there isn't a great solution on the crypto package. Versions are all over the place. I included the correct version in the requirements.txt file, but if you install kodi-voice after that (shouldn't need to though), it could mess it up.

Can you tell me what specific intent it failed on? I'll look into why that was breaking.
Reply
Here's some logs from Alexa.
Alexa heard: "ask kodi to play all music"  - Party Mode - Starting party play
Alexa heard: "ask kodi to skip" - Playing next item
Alexa heard: "ask kodi to start over" - Starting current item over
Alexa heard: "ask kodi to pause" - Play/Pause
Alexa heard: "ask kodi to go back" - Skill response was marked as failure - The skill responded with 500 HTTP status code
Alexa heard: "ask kodi to stop" - Stopping playback - Playback stopped
Alexa heard: "ask kodi to" - Skill response was marked as failure - The skill responded with 500 HTTP status code
Alexa heard: "ask kodi what's playing" - Skill response was marked as failure - The skill responded with 500 HTTP status code

The "go back" command caused kodi to go back in the menu's rather than the playlist. Is it configured for a specific skin?
Tomorrow I'll snoop the communications between kodi and the host and see if can spot anything obvious.

(Kodi version 17.6., OSMC 2018-04-1, Skin Confluence 3.1.43)
Reply
where does init-config get downloaded when running:
C:\WINDOWS\system32>lexigram init-config
Reply
(2018-05-05, 02:24)drizzt09 Wrote: where does init-config get downloaded when running:
C:\WINDOWS\system32>lexigram init-config
 The current directory. It looks like you're running as an administrator which you don't need to do. I'd change directories to something more local to your user.

(2018-05-05, 01:38)Paranoid247 Wrote: Here's some logs from Alexa.
Alexa heard: "ask kodi to play all music"  - Party Mode - Starting party play
Alexa heard: "ask kodi to skip" - Playing next item
Alexa heard: "ask kodi to start over" - Starting current item over
Alexa heard: "ask kodi to pause" - Play/Pause
Alexa heard: "ask kodi to go back" - Skill response was marked as failure - The skill responded with 500 HTTP status code
Alexa heard: "ask kodi to stop" - Stopping playback - Playback stopped
Alexa heard: "ask kodi to" - Skill response was marked as failure - The skill responded with 500 HTTP status code
Alexa heard: "ask kodi what's playing" - Skill response was marked as failure - The skill responded with 500 HTTP status code

The "go back" command caused kodi to go back in the menu's rather than the playlist. Is it configured for a specific skin?
Tomorrow I'll snoop the communications between kodi and the host and see if can spot anything obvious.

(Kodi version 17.6., OSMC 2018-04-1, Skin Confluence 3.1.43)
 I'll take a look at this over the weekend and see if I can replicate it.
Reply
Should I start over and change directory and run non-admin. Or just do it for the config? And continue.
Reply
I'd just change your directory since you already did admin. It might mess up permissions if you don't.
Reply
(2018-05-04, 18:32)m0ngr31 Wrote:
Quote:Q: I don’t want to use Lamda but it seems that the scripts wants to publish something with lamda function, is my configuration wrong?
Second and most important:: How can I solve this issue?
A view posts ago, I read about substitution URI with sourceDir in kanzi/skill.json but when I restart deploy process I guess the skill.json will be generated again and my changes will be overwritten, right?

Amazon's error messages for this are pretty lame. They don't always seem to point to the correct thing. My best guess is that it doesn't like adding a port to the URL. Try dropping the `:8000` and deploying again. I know it won't make the skill work, but it'll be interesting to see if that resolves the error.

If that doesn't work, we can try some other things. 
Thanks for your feedback!
dropping :8000 was not the answer - still the same issue. maybe it's something with my raspPi?  Anyhow I tried with Ubuntu and this works!
Anyhow - we should document that amazon only supports 443 ports! I guess this will remove some pain for user users Smile

Thanks!!
Reply
(2018-05-05, 07:43)area2051 Wrote: Thanks for your feedback!
dropping :8000 was not the answer - still the same issue. maybe it's something with my raspPi?  Anyhow I tried with Ubuntu and this works!
Anyhow - we should document that amazon only supports 443 ports! I guess this will remove some pain for user users Smile

Thanks!! 
Amazon have a guide for setting up your endpoint. It includes the fact that you can not use any port other than 443. I wasted a couple of hours on this myself. The guide is here and it is essential reading if you are self hosting.
Reply
  • 1
  • 155
  • 156
  • 157(current)
  • 158
  • 159
  • 176

Logout Mark Read Team Forum Stats Members Help
Kanzi: Amazon Alexa skill for Kodi15