Kodi Community Forum

Full Version: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Currently there's no way to tell JSON-RPC not to wait until the dialog closes but I'll look into it.
OK, thanks;

Could you post the commands you use for calling "pvrosdchannels" and then navigating up/down for example?

I just want to see if I do anything differently.

PS. what is the "GUI.Window" command, compared to "GUI.ActivateWindow", can I use that? If yes, how?
I just copy pasted the JSON-RPC commands you posted and they worked fine for me. But as I said I had to open two HTTP connections because the first one was blocked until I closed the dialog.

There's no GUI.Window command. That is a type and just provides a list of possible windows that you can open with GUI.ActivateWindow.
(2012-10-21, 13:01)Montellese Wrote: [ -> ]I just copy pasted the JSON-RPC commands you posted and they worked fine for me. But as I said I had to open two HTTP connections because the first one was blocked until I closed the dialog.

There's no GUI.Window command. That is a type and just provides a list of possible windows that you can open with GUI.ActivateWindow.

OK, thanks for the info.

I'm using iRule on my iPad to control XBMC. I just need to setup XBMC as a network gateway (port 9090) and then assign the JSON commands to buttons.

Is there any way to make XBMC think it's two different connections? will changing the "id:" help for example?
I don't know how iRule works but every HTTP request counts as a connection so as long as iRule can handle doing a new HTTP request while another is still waiting for a response it should work.
9090 is not HTTP in his configuration I suppose but TCP listener.

@Ayla you should perhaps try to switch to HTTP.
(2012-10-21, 23:31)Tolriq Wrote: [ -> ]9090 is not HTTP in his configuration I suppose but TCP listener.

@Ayla you should perhaps try to switch to HTTP.

Thanks for the replies Smile

I have considered using HTTP instead, but isn't HTTP going away soon (or has it already, in the latest Frodo nightlies?) in favor of JSON-RPC?
That's the HTTP-API, which is completely seperate from JSON-RPC over HTTP.
Hello all. Sorry if this is in the wrong place.

I am new to XBMC (but not tech or media servers) and I am running fordo nighly from 10.21.2012. I am having an issue with JSON and and iRule on the iPad. I was working a few weeks ago (?).

I am able to type the following into a browser and it works:
Code:
http://192.168.111.10/jsonrpc?request={"jsonrpc":"2.0","method":"Input.Down","id":1}

However when I try to add the following button code to iRule it does not work:
Code:
jsonrpc?request={"jsonrpc":"2.0","method":"Input.Down","id":1}

I have my gateway setup to port 80, allowing remote control in XBMC, and have web service turned on; but I am seeing a lot of talk about port 9090. I have tried that port with no luck. Am I missing something?

I realized this is not iRule support and I appreciate all the work that has gone into XBMC.

EDIT:
I forgot to mention that my iRule gateway is set to port 80 HTTP method GET.

Thank you,
-PeaceKeeper
It couldn't have worked a few weeks ago because I just added that functionality two weeks ago.

You need to URL encode the JSON-RPC request before passing it to the "request" parameter.
(2012-10-24, 07:37)Montellese Wrote: [ -> ]It couldn't have worked a few weeks ago because I just added that functionality two weeks ago.

Sorry, I did not explain that very well. I was using the HTTP API. Not the JSON. The HTTP API stopped working a a few weeks ago on the nightly (?) so I am now trying switch to the new and inproved JSON. Smile

(2012-10-24, 07:37)Montellese Wrote: [ -> ]You need to URL encode the JSON-RPC request before passing it to the "request" parameter.

I am not sure what this means. I will search and see what I can find. Thank you for your help.
-PeaceKeeper
Hi,

I'm trying to build a custom bit of python code to make a few JSON calls over HTTP. The calls are all working find and I'm 99% there, with one exception/issue.

I'm running the 10/25/2012 build for Windows.

I want to run the following JSON-RPC call:

Code:
http://192.168.1.5:8080/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Just Added","message":"American Horror Story (Season 2, Episode 2 - Tricks and Treats)","image":"http://192.168.1.5:8080/image/image://smb://CPU/My Videos/Television/Series/American Horror Story/Folder.jpg"},"displaytime":10000,"id":1}

When calling the JSON-RPC, I have URL Encoded the above as follows:

Code:
http://192.168.1.5:8080/jsonrpc?request=%7B%22jsonrpc%22%3A%222.0%22%2C%22method%22%3A%22GUI.ShowNotification%22%2C%22params%22%3A%7B%22title%22%3A%22Just%20Added%22%2C%22message%22%3A%22American%20Horror%20Story%20%28Season%202%2C%20Episode%202%20-%20Tricks%20and%20Treats%29%22%2C%22image%22%3A%22http%3A//192.168.1.5%3A8080/image/image%3A//smb%3A//CPU/My%20Videos/Television/Series/American%20Horror%20Story/Folder.jpg%22%7D%2C%22displaytime%22%3A10000%2C%22id%22%3A1%7D

I have pulled the location of the thumbnail (Folder.jpg) using a call to GetTVShows. However, no matter what I do, in the pop-up notification in XBMC, the little icon is black. All other information is there and correct.

Can anyone give me a clue? The Folder.jpg file is 864x1296 and roughly 170KB in case that matters.

Thanks a lot for any guidance!
Are you sure that's how you got the image:// path from XBMC? Because everything after "image://" should be URL-encoded. And then when you pass the whole "image://foo/bar" URL to the webserver you need to URL-encode the whole image path again. But if the image is available to the XBMC instance you might be able to directly pass in either the path to the real image (without the "image://" part) or the "image://" URL without the http:// stuff.
Ah! No, it was encoded, but I decoded it, so that in full command everything is at same encode level.
I will try your suggestion as soon as I get a chance.

Thanks a lot!
Tried a couple of things:

Code:
http://192.168.1.5:8080/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Just Added","message":"American Horror Story (Season 2, Episode 2 - Tricks and Treats)","image":"http://192.168.1.5:8080/image/image://smb%3a%2f%2fCPU%2fMy%20Videos%2fTelevision%2fSeries%2fAmerican%20Horror%20Story%2fFolder.jpg"},"displaytime":10000,"id":1}

was encoded to the below and run. All still works, but the Image in the notification is black:

Code:
http://192.168.1.5:8080/jsonrpc?request=%7B%22jsonrpc%22%3A%222.0%22%2C%22method%22%3A%22GUI.ShowNotification%22%2C%22params%22%3A%7B%22title%22%3A%22Just%20Added%22%2C%22message%22%3A%22American%20Horror%20Story%20%28Season%202%2C%20Episode%202%20-%20Tricks%20and%20Treats%29%22%2C%22image%22%3A%22http%3A//192.168.1.5%3A8080/image/image%3A//smb%253a%252f%252fCPU%252fMy%2520Videos%252fTelevision%252fSeries%252fAmerican%2520Horror%2520Story%252fFolder.jpg%22%7D%2C%22displaytime%22%3A10000%2C%22id%22%3A1%7D


I then tried as you suggested without the image:// , and that worked:

Code:
http://192.168.1.5:8080/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Just Added","message":"American Horror Story (Season 2, Episode 2 - Tricks and Treats)","image":"http://192.168.1.5:8080/image/smb%3a%2f%2fCPU%2fMy%20Videos%2fTelevision%2fSeries%2fAmerican%20Horror%20Story%2fFolder.jpg"},"displaytime":10000,"id":1}

which encodes to:

Code:
http://192.168.1.5:8080/jsonrpc?request=%7B%22jsonrpc%22%3A%222.0%22%2C%22method%22%3A%22GUI.ShowNotification%22%2C%22params%22%3A%7B%22title%22%3A%22Just%20Added%22%2C%22message%22%3A%22American%20Horror%20Story%20%28Season%202%2C%20Episode%202%20-%20Tricks%20and%20Treats%29%22%2C%22image%22%3A%22http%3A//192.168.1.5%3A8080/image/smb%253a%252f%252fCPU%252fMy%2520Videos%252fTelevision%252fSeries%252fAmerican%2520Horror%2520Story%252fFolder.jpg%22%7D%2C%22displaytime%22%3A10000%2C%22id%22%3A1%7D


Any idea why the 'image://' part doesn't work? Is it needed for 'proper functionality' or if I end up with multiple XBMC installs?

Thanks as always!