Kodi Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174)
+---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



- hello_man - 2010-10-05

Also, what's the difference between AudioPlayer.SkipNext vs AudioPlaylist.SkipNext?

It seems there are lot of controls which are common between AudioPlayer and AudioPlaylist. Are they different in terms of what they do or they can be use interchangabely? Also, Do I need to use controls in VideoPlayer if I want to control video playback and AudioPlayer when playing audio file? Seems they should control the current media playback irrespective of what kind of media is playing.

Does it make sense? Can somebody please clarify?

thanks


- thezoggy - 2010-10-08

can we toggle something in the library as watched/unwatched with json at this time?


- erhnam - 2010-10-08

topfs2 or anyone else?

Is it possible to use json rpc to navigate through XBMC?


- topfs2 - 2010-10-08

No real difference between AudioPlayer.SkipNext and AudioPlaylist.SkipNext. One of those should probably go.

Cannot toggle watched status as of now.

Cannot navigate the GUI via jsonrpc, waiting on input abstraction redesign before adding it in jsonrpc (its a mess now for other input stuff so don't want to clutter jsonrpc with it).


- Tolriq - 2010-10-08

Since json is making progress i tried again to go with it Smile

It seems there's problem with playlist.getItems as depending on how you start the media you loose access to all database informations.

If you start the media from library it allmost all times works, but if you start the file from file mode (or with the httpapi with play(filename)) it don't works, even if the player shows the informations correctly and the httpapi with getnowplaying gives correct informations too.

And i reiterate my request that was discussed some times ago and mostly accepted, to getback some kind of thing similar to GetNowPlaying to avoid hamering XBMC with request (4 request per sec to get current player, volume , progress and media informations) that's a little too much Smile

Tolriq.


- topfs2 - 2010-10-08

Tolriq Wrote:And i reiterate my request that was discussed some times ago and mostly accepted, to getback some kind of thing similar to GetNowPlaying to avoid hamering XBMC with request (4 request per sec to get current player, volume , progress and media informations) that's a little too much Smile

Tolriq.

Been thinking of that too. Will need discussion, abit annoying to do 4 requests I agree.

Have you checked out the infobool and info strings getters? Should be able to get most of the skin stuff, i.e. nowplaying and such.

They really should be one method but waits on our guiinfomanager to use a variant for the stored data instead of strings OR bools.


retrieving fanart - uNhoLy - 2010-10-08

is it already possible, to retrieve the fanart of a specific movie?


- erhnam - 2010-10-09

topfs2 Wrote:No real difference between AudioPlayer.SkipNext and AudioPlaylist.SkipNext. One of those should probably go.

Cannot toggle watched status as of now.

Cannot navigate the GUI via jsonrpc, waiting on input abstraction redesign before adding it in jsonrpc (its a mess now for other input stuff so don't want to clutter jsonrpc with it).

Do you know if any input or navigation will be possible using jsonrpc with the final version of Dharma? Or do we need to use the HTTP-API / Event Server in Dharma for that?


- topfs2 - 2010-10-09

erhnam Wrote:Do you know if any input or navigation will be possible using jsonrpc with the final version of Dharma? Or do we need to use the HTTP-API / Event Server in Dharma for that?

Not gonna be a way to do it via jsonrpc in dharma, so yeah need to use http-api or event-server for it.

jsonrpc isn't really finialized for dharma but a stepping stone, until its final or atleast have enough features to deprecate http-api, http-api will remain Smile


Can't get it to work, must be doing something really stupid - barrygordon - 2010-10-10

I have spent all day trying to get this to work. I have been through the full thread and most of the auxiliary threads. I am running the LiveFreak version of XBMC Dharma Beta2.

If I use the http interface (which I do a lot with) it works fine

NOTE: In the examples of send and receive the string (CR) and the string (LF) represent the single corresponding bytes. I am sending to ip:8080 and make no changes to the basic programs that write to and receive from the ports.

First an example using the HTTP API:
SEND: GET /xbmcCmds/xbmcHttp?command=Action(3)(CR)(LF)(CR)(LF)
RCVD: HTTP/1.1 200 OK(CR)(LF)Content-Length: 22(CR)(LF)Date: Sat, 09 Oct 2010 23:09:30 GMT(CR)(LF)(CR)(LF)<html>(LF)<li>OK(LF)</html>(LF)


I tried this and got no where:
SEND: POST /jsonrpc/ HTTP/1.1(CR)(LF)Content-Length: 57(CR)(LF)HOST: 192.168.2.202:80(CR)(LF)(CR)(LF){"jsonrpc": "2.0", "method": "System.Shutdown", "id": 1}(CR)(LF)(CR)(LF)

RCVD: HTTP/1.1 404 Not Found(CR)(LF)Content-Length: 82(CR)(LF)Date: Sat, 09 Oct 2010 23:09:06 GMT(CR)(LF)(CR)(LF)<html><head><title>File not found</title></head><body>File not found</body></html>HTTP/1.1 404 Not Found(CR)(LF)Content-Length: 131(CR)(LF)Date: Sat, 09 Oct 2010 23:09:06 GMT(CR)(LF)(CR)(LF)<html><head><title>Not Supported</title></head><body>The method you are trying to use is not supported by this server</body></html>

If I remove the "/" after the POST /jsonrpc

SEND(130): POST /jsonrpc HTTP/1.1(CR)(LF)Content-Length: 56(CR)(LF)HOST: 192.168.2.202:80(CR)(LF)(CR)(LF){"jsonrpc": "2.0", "method": "System.Suspend", "id": 1}(CR)(LF)(CR)(LF)

Produces no reply from the server

I must be doing something very basic incorrectly. I have tried all of the System methods and the Version Method all with the same results.

I also tried using raw TCP to the port 9090 but that port is not opened. Is that the correct port or must I initialize it somewhere in XBMC?

I assume if I use the raw port I would just send
/jsonrpc {"jsonrpc": "2.0" . . . "id": 1}

Any help that will allow me to get started would be greatly appreciated.


- jonib - 2010-10-10

You seem to use port 80 with the jsonrpc, but use port 8080 with httpapi. You should use the same port for both.

jonib


- topfs2 - 2010-10-10

What jonib said and for 9090 use you need to enable it in xbmc, its called "Allow external applications to control xbmc" or something close to that.


- barrygordon - 2010-10-10

Thanks for the help guys. I pulled the Host clause and content length clause and everything started working through the HTTP api. I then enabled external applications and everything started working through the raw TCPIP Socket. I believe I will stick with the RAW TCP socket unless someone advises me otherwise. All the system commands do what they are supposed to and the version request returns 1.0 as the result formatted in JSON.


What I am doing is building an XBMC control system for the Philips Pronto PRO Remote. I will be using both the HTTP API for such things as sendkeys and the raw interface for JSON formatted things. My current endeavor is strictly control.

The only remaining problem with Dharma is that I can't get it to Wake on LAN and have posted that issue in the general section. My system dual boots between Camelot and Dharma for testing and evaluation. Camelot handles WOL fine, Dharma does not. But this is not a topic for here and I have posted a help request in what I think is the proper place.


- topfs2 - 2010-10-10

Does not matter which of the interfaces you use, its just a preference.

The tcp has the ability to get announcements, which might be very useful depending on the control. The http can download files which is needed for some remotes. The http can be password protected, although extremely crappy http base64 one (standard http one) but atleast its something. There will hopefully be an ssl encrypted option at some point.


- barrygordon - 2010-10-10

I have seen several references to the document that describes the JSON methods that have been implemented to date. The one I have is dated feb 15 2010. Is that the latest one? If not could some one post a URL to the latest one? I have ssen instructions on how to get to it but all I ever end up with is a blank web page or a web page not found

TIA