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 - jingai - 2016-10-21

In your proxy configuration, what does proxy_pass look like? It should be:

Code:
proxy_pass http://local_kodiaddress:local_kodiport/;



RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21

Code:
location /kodi/ {
   proxy_pass http://192.168.1.68:8745/;
   proxy_set_header Host $host;
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}



RE: Amazon Echo skill for Kodi - jingai - 2016-10-21

Do you see the requests in kodi.log? You may have to enable debug mode, I forget.


RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21

(2016-10-21, 14:54)jingai Wrote: Do you see the requests in kodi.log? You may have to enable debug mode, I forget.
I will check. Heroku looks like its down at the moment, due to a DNS issue. Might be some time before I can test again.... :-(


RE: Amazon Echo skill for Kodi - jingai - 2016-10-21

One more thing. What does the "url = " line look like in your kodi.py? Near the top.


RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21

(2016-10-21, 15:03)jingai Wrote: One more thing. What does the "url = " line look like in your kodi.py? Near the top.

I hard coded it based on a previous post to:

Code:
url = "https://mydynamicdns:port/kodi/jsonrpc"



RE: Amazon Echo skill for Kodi - jingai - 2016-10-21

Pretty sure that's right. I'm assuming "mydynamicdns:port" is your actual host and port and you just masked it out to post it here.. but.. figured I'd verify Wink

edit: nvm, you showed it's getting there in your nginx logs already.

Well, I'm not sure. I'd say check the kodi.log once Heroku is back online to see if it's complaining about the requests, or if it's even seeing them at all.

You should see something like this if it's working:

Code:
21:43:35 T:123145315860480   DEBUG: CWebServer[8080]: request received for /jsonrpc



RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21

(2016-10-21, 15:07)jingai Wrote: Pretty sure that's right. I'm assuming "mydynamicdns:port" is your actual host and port and you just masked it out to post it here.. but.. figured I'd verify Wink
Lol yes!! Wink


RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21

(2016-10-21, 15:07)jingai Wrote: edit: nvm, you showed it's getting there in your nginx logs already.

Well, I'm not sure. I'd say check the kodi.log once Heroku is back online to see if it's complaining about the requests, or if it's even seeing them at all.

You should see something like this if it's working:

Code:
21:43:35 T:123145315860480   DEBUG: CWebServer[8080]: request received for /jsonrpc

Will do. Looks like Heroku is suffering due to a DDoS attack. Probably something I did!! Rofl

Will come back with an update when it's back online. Thanks very much for your help so far!!

**Update. Looks like Kodi is seeing the request
http://pastebin.com/pnimuETb


RE: Amazon Echo skill for Kodi - jingai - 2016-10-21

Only thing I can think of is the proxy is in some way munging the response.. I have no idea Sad

Maybe it's cut short? Maybe try setting the read timeout to something high for now?

Code:
proxy_read_timeout 90;

If that doesn't do anything (and it probably won't), you'd have to look at the actual response.


RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21

(2016-10-21, 16:05)jingai Wrote: Only thing I can think of is the proxy is in some way munging the response.. I have no idea Sad

Maybe it's cut short? Maybe try setting the read timeout to something high for now?

Code:
proxy_read_timeout 90;

If that doesn't do anything (and it probably won't), you'd have to look at the actual response.

Yep, no change..

Any ideas as to how I look at the actual response?


RE: Amazon Echo skill for Kodi - jingai - 2016-10-21

Can try adding

Code:
print r.text

after

Code:
r = requests.post(url, data=command, auth=(USER, PASS))



RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21

(2016-10-21, 16:14)jingai Wrote: Can try adding

Code:
print r.text

after

Code:
r = requests.post(url, data=command, auth=(USER, PASS))

Doesn't add anything to the log....

I feel like I am cats whisker away from nailing this but it is very frustrating.. !!


RE: Amazon Echo skill for Kodi - jingai - 2016-10-21

Ok.. let's just verify the JSON RPC interface is working at all.

If you have access to curl (or something like it), you can do:

Code:
curl --data-binary '{"jsonrpc":"2.0", "method":"VideoLibrary.GetMovies", "params":{"filter":{"field":"playcount", "operator":"lessthan", "value":"1"}}, "id":1}' -H 'content-type: application/json;' -u user:pass http://local_kodiaddr:local_kodiport/jsonrpc

You should get an object back with all your movies.


RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21

(2016-10-21, 21:53)jingai Wrote: Ok.. let's just verify the JSON RPC interface is working at all.

If you have access to curl (or something like it), you can do:

Code:
curl --data-binary '{"jsonrpc":"2.0", "method":"VideoLibrary.GetMovies", "params":{"filter":{"field":"playcount", "operator":"lessthan", "value":"1"}}, "id":1}' -H 'content-type: application/json;' -u user:pass http://local_kodiaddr:local_kodiport/jsonrpc

You should get an object back with all your movies.

You might need me to guide me a little. I can run this command from the raspbian command line but nothing is returned (no error messages either). Do I need to output to a file?

Many thanks!!