View Full Version : Kodi / XBMC JSON RPC - sending basic transport commands from Girder. Paypal offered.

November 27th, 2014, 05:38 AM

Looking to achieve this, but out of my depth:

1) Girder sends Kodi / XBMC simple music transport commands e.g. Play/Pause, Next, Previous, UP /Down/Left/Right/Select
2) Command / Action is triggered by a Girder event e.g. keyboard, remote, etc
3) JSON RPC used as device control
4) Girder 5. Kodi "Helix". JSON RPC 6 command set (KODI / XBMC version description).

I have wasted days trying to get this working. It's not going to be hard, merely out of my comfort zone in Girder - guessing LUA etc.

For anyone who can help, I can offer $30 via paypal. Yes, I'm that desperate! As I'm mentioning money, it's best to be absolutely clear on what I'm looking for:

1) A girder 5 GML file (not just script excerpts)
2) The GML file to work with Kodi (14 "Helix" or XBMC 13.2 "Gotham")
3) Girder actions / macros triggered by an event for the following MUSIC commands: Play/Pause, Next, Previous, UP, DOWN, LEFT, RIGHT, SELECT
4) Something that works before December 1st. Sorry but the project has to complete by then, and I will have to go with my clunky "keyboard spoofing"solution. (that has many compromises on usability)

Don't want to pay several helpful people, so it may be best to reply up front if you're kind enough to take this on.

Kodi / XBMC download: http://kodi.tv/download/
JSON RPC forum page: http://forum.kodi.tv/forumdisplay.php?fid=174

December 10th, 2014, 05:24 AM

Just to say that I'm still interested in a JSON solution - even beyond the rather sporty date I previously gave. The kit is now installed in the VW Campervan and working well, but I'd still love to upgrade all the keyboard spoofing to something that works in the background.

Paypal offer also extended...

Hoping someone out there can provide help at any level. Thanks.

December 10th, 2014, 11:38 AM
I've added initial support to Girder 6 and back-ported that to Girder 5. Play/Pause, Stop, Prev and Next for now. If this works for you we can add more. Extract the zip file in the Girder installation directory and hit script reset.

December 10th, 2014, 11:45 AM
Ah you only need up,down,left,right and select. I've added that real quick.

December 10th, 2014, 01:31 PM

Thankyou. It works like a dream. Using port 8080. Tested every command, and will have a go at adding a couple more now..

Please drop me your paypal email and I'll send on an early Christmas present - as I now have one of my own! (I'll look at my promixis>notifications>inbox for it).

This will really improve the user experience no end. Thanks again.

December 10th, 2014, 04:46 PM
Glad to be of help Tony, merry early Christmas!

December 10th, 2014, 09:00 PM
Great timing. I decided to look for this today and behold!

After dropping this in my Girder folder and resetting, should I see something in the available actions tree? I don't. I don't see any console errors, either.

December 10th, 2014, 09:14 PM
There is a GML included, load that.

December 10th, 2014, 09:21 PM
There is a GML included, load that.

Got it! Thanks.

December 10th, 2014, 09:28 PM
Hmm. I set my user and pass in the Lua but when I run it, I get:

Wed Dec 10 21:22:04 2014 [string "Connect - SET PASSWORD AND USERNAME THEN RUN ME"]:4: ')' expected near '"xbmc"'

I haven't updated in a while. I'm running - is that a problem?

December 10th, 2014, 10:24 PM
Wait - I nuked a comma when I changed the XBMC port.

I'm still getting errors, but they're different now - I'm going to upgrade my Girder install in the morning and take a look then.


December 10th, 2014, 10:44 PM
OK. Updated to the newest Girder.

If I leave the files in the structure from your zip (kodi.gml in Girder root, everything else in a 'luascript' folder) I get the error:

Wed Dec 10 22:32:36 2014 Connect / [string "Connect"]:2: module 'kodi.init' not found:
Wed Dec 10 22:32:36 2014 no field package.preload['kodi.init']
Wed Dec 10 22:32:36 2014 no file './kodi\init.lua'
Wed Dec 10 22:32:36 2014 no file 'C:/Program Files/Promixis/Girder 6/lua/kodi\init.lua'
Wed Dec 10 22:32:36 2014 no file 'C:/Program Files/Promixis/Girder 6/lua/kodi\init/init.lua'
Wed Dec 10 22:32:36 2014 no file '.\kodi\init.dll'
Wed Dec 10 22:32:36 2014 no file 'C:\Program Files\Promixis\Girder 6\kodi\init.dll'
Wed Dec 10 22:32:36 2014 no file 'C:\Program Files\Promixis\Girder 6\loadall.dll'
Wed Dec 10 22:32:36 2014 no file '.\kodi.dll'
Wed Dec 10 22:32:36 2014 no file 'C:\Program Files\Promixis\Girder 6\kodi.dll'
Wed Dec 10 22:32:36 2014 no file 'C:\Program Files\Promixis\Girder 6\loadall.dll'
Wed Dec 10 22:32:36 2014 stack traceback:
Wed Dec 10 22:32:36 2014 [C]: in function 'require'
Wed Dec 10 22:32:36 2014 [string "Connect"]:2: in main chunk

Is my mistake trying to run this with G6? And this was intended for 5?

December 11th, 2014, 08:18 AM
Ah you are running the Girder 5 version on Girder 6. Give me a few minutes and I'll post of in Girder 6 forum with the correct file.

April 28th, 2015, 03:35 AM
Hi Folks,

Girder working well with Kodi - thanks Ron. I've been able to replace most of my keyboard "spoofing" controls with JSON RPC commands - apart from 2, which are very commonly used in music:

Add to queue
Play selected item(s)

I've looked through the Kodi documentation, but no luck in getting this incorporated to date. Has anyone managed to do this??