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 - 2manyhobbies - 2017-08-08

Quote:Thanks for the help, however when I click into the cloudwatch managment console and select logs there is no "lambda function to select". I get a welcome page with a quickstart guide, (definitely no links to a lambda function on the page). It makes no sense compared to the comments I see here?

I wonder if I've got some basic settings wrong with the aws setup, however as far as I can see it all setup perfectly in accordance with the github instructions.

Under your AWS Console, Click services at the top left, under Management tools click on cloudwatch. Click LOGS on the left side of your screen. Now it should show your log groups with you kodi-alexa app. If you don't see it, I would re-do the AWS part of the process.


RE: Amazon Echo skill for Kodi - nbhor - 2017-08-08

Hi, first of all thanks for such an amazing skill. I know its difficult to find time for ongoing support. I tried my best to get it working on my raspberry pi 2. I got to the point where my kodi (OSMC version) could understand the basic commands like Home, Back, Volume Up. But no matter what I do, I cannot get the movie played on kodi box. This is all through Skill Service Simulator app. I will try my echos very soon.

When I punch in "Play movie terminal", I can get the response Playing Terminal. But nothing happens on Kodi Box. Am I doing anything wrong? I checked following curl commands and they are working correctly too.

curl --data-binary "{\"jsonrpc\":\"2.0\", \"method\":\"VideoLibrary.GetMovies\", \"id\":1}" -H "content-type: application/json;" -u user:pwd http:
mycustom.domain.com:port/jsonrpc
-- all my movies in json format here
after requesting playback, I tried following command as well but results were not promising as nothing was playing on kodi box.

$ curl --data-binary "{\"jsonrpc\":\"2.0\", \"method\":\"Player.GetActivePlayers\", \"id\":1}" -H "content-type: application/json;" -u user:pwd http:
mycustom.domain.com:port/jsonrpc
{"id":1,"jsonrpc":"2.0","result":[]}

Any help is appreciated!

I am using port forwarding on router and reverse-proxy (apache) on windows machine forwarding to PI 2 (osmc).
My Kodi version - 15.2 on OSMC flavor

Thanks!


RE: Amazon Echo skill for Kodi - jingai - 2017-08-08

Post the skill logs and look at Kodi's log too.


RE: Amazon Echo skill for Kodi - elyad - 2017-08-08

hi guys,

i am receiving the bellow error message when i try to zappa init ,,, I also tried to rename the install folder and starting from scatch ut still getting the same error message...



It looks like this is a Flask application.
Oh no! An error occurred! Sad

==============

Traceback (most recent call last):
File "c:\kodi-alexa\venv\lib\site-packages\zappa\cli.py", line 2489, in handle
sys.exit(cli.handle())
File "c:\kodi-alexa\venv\lib\site-packages\zappa\cli.py", line 444, in handle
self.init()
File "c:\kodi-alexa\venv\lib\site-packages\zappa\cli.py", line 1506, in init
matches = detect_flask_apps()
File "c:\kodi-alexa\venv\lib\site-packages\zappa\utilities.py", line 143, in detect_flask_apps
lines = f.readlines()
File "c:\kodi-alexa\venv\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 301: character maps to <undefined>

==============

Need help? Found a bug? Let us know! Big Grin
File bug reports on GitHub here: https://github.com/Miserlou/Zappa
And join our Slack channel here: https://slack.zappa.io
Love!,
~ Team Zappa!


RE: Amazon Echo skill for Kodi - jingai - 2017-08-08

@elyad, you may want to bring that one to the Zappa team. The error you're getting isn't specific to our skill and they might be able to better help you.


RE: Amazon Echo skill for Kodi - nbhor - 2017-08-08

(2017-08-08, 22:02)jingai Wrote: Post the skill logs and look at Kodi's log too.

Do you mean CloudWatch logs?

START RequestId: f04425f8-7c5d-11e7-ab85-3d8f33f1d891 Version: $LATEST
Playing movie
Searching for movie "Winnie the pooh"
Sending request to http://domain:port/jsonrpc from device deviceId
Trying to match: winnie the pooh
Simple match on direct comparison
Simple match on direct comparison
Simple match on direct comparison
BEST MATCH: "Winnie the Pooh"
Sending request to http://domain:port/jsonrpc from device deviceId
Sending request to http://domain:port/jsonrpc from device deviceId
[INFO] 2017-08-08T17:20:58.183Z f04425f8-7c5d-11e7-ab85-3d8f33f1d891 72.21.217.155 - - [08/Aug/2017:17:20:58 +0000] "POST / HTTP/1.1" 200 249 "" "Apache-HttpClient/UNAVAILABLE (Java/1.8.0_112)" 0/1841.894
END RequestId: f04425f8-7c5d-11e7-ab85-3d8f33f1d891
REPORT RequestId: f04425f8-7c5d-11e7-ab85-3d8f33f1d891 Duration: 1842.60 ms Billed Duration: 1900 ms Memory Size: 512 MB Max Memory Used: 57 MB


I have also enabled the IO logs on my Apache server and I could see jsonrpc payload and response with correct parameters in it.
here is the sample log
Input
[Tue Aug 08 15:31:35 2017] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in (data-HEAP): {"params": {"movieid": 947, "properties": ["resume", "trailer"]}, "jsonrpc": "2.0", "method": "VideoLibrary.GetMovieDetails", "id": 1}
output
[Tue Aug 08 15:31:35 2017] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_out (data-HEAP): {"params": {"movieid": 947, "properties": ["resume", "trailer"]}, "jsonrpc": "2.0", "method": "VideoLibrary.GetMovieDetails", "id": 1}

I am cherry picking the log from apache, as they are huge in size.

Where can I find KODI logs?


RE: Amazon Echo skill for Kodi - jingai - 2017-08-08

@nhbor, the skill logs look as I'd expect for that command. Is Kodi itself complaining about anything in its log?


RE: Amazon Echo skill for Kodi - nbhor - 2017-08-08

(2017-08-08, 22:47)jingai Wrote: @nhbor, the skill logs look as I'd expect for that command. Is Kodi itself complaining about anything in its log?

I will look into kodi logs tonight to find out little more about it. One more question, does the python skill supports self signed certs? I am planning to switch the protocol to https.

Thanks for your help!


RE: Amazon Echo skill for Kodi - elyad - 2017-08-08

@jingai,,,thanks for the fast reply,,just another question... kodi.config should be txt extntion, right?!


RE: Amazon Echo skill for Kodi - jingai - 2017-08-08

You can also try issuing the play command by hand via cURL with something like:

Code:
curl --data-binary "{\"jsonrpc\":\"2.0\", \"method\":\"Player.Open\", "\params\": {\"item\": {\"movieid\": 947}, \"options\": {\"resume\": True}}, \"id\":1}" -H "content-type: application/json;" -u user:pwd http://mycustom.domain.com:port/jsonrpc

Which -- assuming I didn't fumble-finger any of that -- should be exactly what the skill is trying to send to Kodi.

(2017-08-08, 22:52)nbhor Wrote: One more question, does the python skill supports self signed certs? I am planning to switch the protocol to https.

We use the requests Python module, which I believe will not by default accept self-signed certs. You could either modify the code yourself or, even better, just get a free cert from Let's Encrypt.


RE: Amazon Echo skill for Kodi - jingai - 2017-08-08

(2017-08-08, 23:02)elyad Wrote: @jingai,,,thanks for the fast reply,,just another question... kodi.config should be txt extntion, right?!

No -- .config is the extension.


RE: Amazon Echo skill for Kodi - nbhor - 2017-08-08

(2017-08-08, 23:04)jingai Wrote: We use the requests Python module, which I believe will not by default accept self-signed certs. You could either modify the code yourself or, even better, just get a free cert from Let's Encrypt.

Thanks for clarification. Unfortunately my VPN is currently working on self signed certs. If I switch to LE cert, I will have to re-configure VPN service and create bunch of keys. I will try to see if I can change the code to accept/trust self signed cert.

Thanks


RE: Amazon Echo skill for Kodi - nbhor - 2017-08-09

(2017-08-08, 22:47)jingai Wrote: @nhbor, the skill logs look as I'd expect for that command. Is Kodi itself complaining about anything in its log?

As promised here is kodi log..



20:49:27 225566.375000 T:1523577888 DEBUG: webserver: request received for /jsonrpc
20:49:28 225566.750000 T:1523577888 DEBUG: RunQuery took 336 ms for 1273 items query: select * from movie_view
20:49:29 225567.734375 T:1772831776 DEBUG: webserver: request received for /jsonrpc
20:49:30 225569.281250 T:1958015536 DEBUG: Previous line repeats 1 times.
20:49:30 225569.281250 T:1958015536 DEBUG: CAnnouncementManager - Announcement: OnScreensaverDeactivated from xbmc
20:49:30 225569.281250 T:1958015536 DEBUG: GOT ANNOUNCEMENT, type: 4, from xbmc, message OnScreensaverDeactivated
20:49:30 225569.312500 T:1958015536 DEBUG: Loading settings for /mnt/USBHDD1/public/Movies/English/test.mkv
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerCoreFactory::GetPlayers(/mnt/USBHDD1/public/Movies/English/test.mkv)
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: hdhomerun/mms/udp
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdimage
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: radio
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
20:49:30 225569.328125 T:1958015536 DEBUG: CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (1)
20:49:30 225569.343750 T:1958015536 DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=0
20:49:30 225569.343750 T:1958015536 DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
20:49:30 225569.343750 T:1958015536 DEBUG: CPlayerCoreFactory::GetPlayers: adding player: DVDPlayer (1)
20:49:30 225569.343750 T:1958015536 DEBUG: CPlayerCoreFactory::GetPlayers: added 1 players
20:49:30 225569.343750 T:1958015536 NOTICE: DVDPlayer: Opening: /mnt/USBHDD1/public/Movies/English/test.mkv
20:49:30 225569.343750 T:1958015536 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
20:49:30 225569.343750 T:1958015536 DEBUG: CMMALRenderer::CMMALRenderer
20:49:30 225569.343750 T:1958015536 DEBUG: CRenderManager::UpdateDisplayLatency - Latency set to 0 msec
20:49:30 225569.343750 T:1958015536 DEBUG: CMMALRenderer::UnInitMMAL pool((nil))
20:49:30 225569.343750 T:1958015536 DEBUG: CMMALRenderer:TonguereInit
20:49:30 225569.343750 T:1523577888 NOTICE: Thread DVDPlayer start, auto delete: false
20:49:30 225569.343750 T:1523577888 NOTICE: Creating InputStream
20:49:30 225569.343750 T:1523577888 ERROR: CDVDPlayer::OpenInputStream - error opening [/mnt/USBHDD1/public/Movies/English/test.mkv]
20:49:30 225569.343750 T:1523577888 NOTICE: CDVDPlayer::OnExit()
20:49:30 225569.343750 T:1523577888 DEBUG: OnPlayBackStopped: play state was 1, starting 1
20:49:30 225569.343750 T:1523577888 DEBUG: Thread DVDPlayer 1523577888 terminating
20:49:30 225569.343750 T:1958015536 DEBUG: OnPlayBackStopped: play state was 3, starting 0
20:49:30 225569.343750 T:1958015536 DEBUG: CAnnouncementManager - Announcement: OnStop from xbmc
20:49:30 225569.343750 T:1958015536 DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnStop
20:49:30 225569.359375 T:1958015536 NOTICE: CDVDPlayer::CloseFile()
20:49:30 225569.359375 T:1958015536 NOTICE: DVDPlayer: waiting for threads to exit
20:49:30 225569.359375 T:1958015536 NOTICE: DVDPlayer: finished waiting
20:49:30 225569.359375 T:1958015536 DEBUG: CMMALRenderer::UnInitMMAL pool((nil))
20:49:30 225569.359375 T:1958015536 NOTICE: CDVDPlayer::CloseFile()
20:49:30 225569.359375 T:1958015536 NOTICE: DVDPlayer: waiting for threads to exit
20:49:30 225569.359375 T:1958015536 NOTICE: DVDPlayer: finished waiting
20:49:30 225569.359375 T:1958015536 DEBUG: CMMALRenderer::UnInitMMAL pool((nil))
20:49:31 225570.312500 T:1958015536 DEBUG: ------ Window Deinit () ------


RE: Amazon Echo skill for Kodi - jingai - 2017-08-09

Kodi is saying it can't open the file associated with that movieid. Why, I can't really say, but I'd check the path it's looking at first.

edit: If you don't see it, it's this:

Code:
ERROR: CDVDPlayer::OpenInputStream - error opening [/mnt/USBHDD1/public/Movies/English/Inside Out (2015)/2096673-BiRD.mkv]



RE: Amazon Echo skill for Kodi - nbhor - 2017-08-09

(2017-08-09, 02:59)jingai Wrote: Kodi is saying it can't open the file associated with that movieid. Why, I can't really say, but I'd check the path it's looking at first.

edit: If you don't see it, it's this:

Code:
ERROR: CDVDPlayer::OpenInputStream - error opening [/mnt/USBHDD1/public/Movies/English/test.mkv]

Ok, I will try to find out more about it.

Thanks