• 1
  • 18
  • 19
  • 20(current)
  • 21
  • 22
  • 226
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
Hi there

I'm about to start work on a python library for the JSON api , just wanted to check nobody had one already working before I start this. I've read through the thread and nobody seems to be working in python besides topfs2
Reply
Mnuu Wrote:Hi there

I'm about to start work on a python library for the JSON api , just wanted to check nobody had one already working before I start this. I've read through the thread and nobody seems to be working in python besides topfs2

Probably because few devices uses python but I don't know many that uses it beyond XBMC scripts (which can access jsonrpc).

At any rate, if you want to use python outside XBMC I'd suggest the jsonrpc python library that already exist (not xbmc specific) since it wraps jsonrpc extremely nice.

Somewhat like this:
xbmc = JSONRPC.Connect(IP, port)
xbmc.Ping()
xbmc.Introspect()

At some point I would like to do such a wrapping for xbmc scripts aswell which uses jsonrpc.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
Could you point me in the direction of the particular library you are referencing, there seems to a large number of jsonrpc librarys for python, all of varying quality. An example of using said library to deal with announcements would be super nice also.
Reply
Any chance we could get an on screen notification function like the HTTP API ?
Didn't see one looking through function list on built in development page index.

-Jonan
Reply
an executebuiltin is definitely on the todo.
Reply
I have been through all 29 pages of this thread (kudos to all who have contributed) and believe I have gained the knowledge to convert what I have written for the HTTP API to the JSON API.

My Application runs on a Pronto PRO remote control taking to XBMC (Asrock ION 330PR0) running XBMCLiveCD (9.11). My only aim is to control the presentation of the info on the main screen out of XBMC so it is basically control only (screen navigation, transport commands etc.).

Before I knock my brains out trying to figure out why it is or is not working, does what I am running now (LiveCD 9.11) contain the JSON API code or just the HTTP API?

If the anwer to the above is no (does not contain the JSON API code), what should I download and install to checkout the conversion of my application from the HTTP API to the JSON API?

Thanks.
Reply
9.11 contains only the HTTP API. You'll need a Dharma nightly (you can try the ISO from xbmcfreak.nl which is pretty much identical to what is in SVN) to use the JSON-RPC interface.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
I just noticed this but I saw pieces of it in the code.

I'm working on refactoring the Addon system so that different language choices can be plugged in.

This means I'm separating the 4 builtin python modules into an "Addon API" and a set of Python bindings.

I hope to have an alternate repository up this weekend (per spiff's request) to get feedback on the direction I'm taking.

In any case, does it make sense that a json-rpc implementation would be simply another binding?
Reply
definitely makes sense. i'm not sure just how much overlap there will be though.
Reply
Yeah - looking through the functionality there might not be a lot of overlap. But I tend to think there's no reason there shouldn't be. If I can call it using json-rpc why not from an addon?

Anyway - it's way ahead of where I am now and maybe if what I'm doing works out they can be collapsed together later.
Reply
I've made an iPhone app (Plexures) which is using the http api, and I'd like to implement support for this new JSON-RCP api. But I can't figure out how to send key commands. Any updates on the progress on this?

These are the keys I'd like to be able to send:
arrow up
arrow down
arrow left
arrow right
enter
esc
m
i
c
tab

With these ten keys you can do everything in XBMC, so I'd say they are essential to a client api.

And it seems like I'm not the only one requesting this:

Ishiro Wrote:Hello,

I'd like to make a simple remote controller for XBMC optimized for iPhone, with a nice UI.

I tought it will quite easy to do something with some HTML, CSS and JS using JSON-RPC, but I can't find a good way to send keyboard events... Unless with HTTP API (ie. http://machine:port/xbmcCmds/xbmcHttp?co...ndKey(code)) which seems to be deprecated.

So, any advice ? Will XBMC implement a similar function in the future (through JSON-RPC) ?

Secondly, is there a nice way to start XBMC with a remote based on http ? (I think no, because the web server is not started, but perhaps a helper exists...).

Thanks !
Reply
If the only thing you are running on the box is XBMC then you could send it a "Magic Packet" to perform Wake on LAN. That is how I use my ION 330. It is powered off normally and when it receives WOL it boots right to XBMC running from a HDD (9.11 Live CD). If you are running other things then it depends a lot on which OS is running.

For example, building a little windows app that would be always be running in the background (or as a service) which monitors a particular Port on the win machine could then wait for a specific message at that port and launch the XBMC application.
Reply
I'm currently trying to make the xbmc web interface available from my domain through an apache server. I've been successful in doing this for other programs such as sabnzbd, sick-beard, tvheadend, transmission and couchpotato.

Using the following code to set up a virtual host in apache

Code:
ProxyRequests Off

ProxyPass /xbmc/ http://localhost:8080/

<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>

ProxyPassReverse /xbmc/ /

I am able to access it at http://mydomain.com/xbmc/ (css and all) however I am unable to browse any of my content (movies, music etc) as the json calls must not be going to the right location or something. The same behaviour occurs when using the Xbmc Web Media Manager (XWMM) package as well.

Just wondering if you've had any success in achieving the json-rpc to work behind apache, if not I'll wait until development has finished before I request support.

EDIT: Okay I did a bit of mucking around and found I need to change all references to "/jsonrpc" to "/xbmc/jsonrpc/" any chance of a urlbase setting or something along those lines?
Reply
Is there a way to swap and/or remove audio/video playlist items? I see the commands for virtual playlists, but I don't know how I can do it for AudioPlaylist and VideoPlaylist.

Also, does the UnShuffle method work, because I can't get it to do anything. In addition, I cannot get the Shuffle method to shuffle more than once, is this by design?
Reply
I had some trouble using python-jsonrpc to interface with the jsonrpc api, I dont think it has support for jsonrpc 2.0. So I've written a bit of code that wraps the xbmc jsonrpc api. the code can be found here: http://pastebin.com/0YCe8n90

its completely lacking any documentation, but its very easy to use:

Code:
>>> import xbmcproxy
>>>proxy = xbmcproxy.XBMCProxy("http://127.0.0.1:8080/jsonrpc")
>>>proxy.VideoPlayer.PlayPause()
{'paused': True, 'playing': True}
>>>proxy.VideoLibrary.GetSeasons(tvshowid=10)
etc.

I hope others find it helpful.
Reply
  • 1
  • 18
  • 19
  • 20(current)
  • 21
  • 22
  • 226

Logout Mark Read Team Forum Stats Members Help
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC8