Remote Receiver for KODI
 Page :   [ 1 ]    [ 2 ]    [ 3 ]    [ 4 ]    [ 5 ]  

I used to run KODI on a Mac Mini a few years back and got used to using the basic Apple remote that just had Arrow keys, Select, Play/Pause and a back button.  Now I run KODI by way of OpenELEC on an Odroid.  I tried a couple remotes with this setup but never got them to work and ended up just using an app on my phone to act as a remote.

Heres the Apple remote that I happen to have.

I much prefer the tactile response from a real remote so decided to make myself a simple IR receiver to take the input from a generic remote and then send appropriate commands to KODI to its JSON-RPC API over WiFi.

Simply browsing to "http://your-kodiserver/jsonrpc" will display the API which is helpful.  I figured it would also be helpful to see what the phone app did when buttons were pressed so I ran a HTTP proxy on my computer and proxied my phone through that so I could get a look at what was going on.

For example, pressing the RIGHT button sent the following 4 requests to the KODI API. (the responses are indented below each request).

{"method":"GUI.GetProperties","id":2065472424,"jsonrpc":"2.0","params":{"properties":["currentwindow","fullscreen"]}}
    {"id":2065472424,"jsonrpc":"2.0","result":{"currentwindow":{"id":12005,"label":"Fullscreen video"},"fullscreen":true}}

{"method":"XBMC.GetInfoBooleans","id":159177507,"jsonrpc":"2.0","params":{"booleans":["VideoPlayer.HasMenu","Pvr.IsPlayingTv"]}}
    {"id":159177507,"jsonrpc":"2.0","result":{"Pvr.IsPlayingTv":false,"VideoPlayer.HasMenu":false}}

{"method":"Player.GetActivePlayers","id":316340733,"jsonrpc":"2.0","params":{}}
    {"id":316340733,"jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}

{"method":"Player.Seek","id":-1750066680,"jsonrpc":"2.0","params":{"playerid":1,"value":"smallforward"}}
    {"id":-1750066680,"jsonrpc":"2.0","result":{"percentage":5.0306019783020019531,"time":{"hours":0,"milliseconds":65,"minutes":5,"seconds":48},"totaltime":{"hours":1,"milliseconds":953,"minutes":55,"seconds":18}}}

{"method":"Input.Right","id":-188546662,"jsonrpc":"2.0","params":{}}
    {"id":-188546662,"jsonrpc":"2.0","result":"OK"}

From this we can see that it does a couple checks first to see if its in full screen then makes sure that it's NOT playing TV and is NOT displaying a menu then gets the active Players.

If there is an active player it will send the "smallforward" to Player.Seek.

It then ends by doing the Input.Right.

The Up, Down and Left buttons do the same checks and will send various commands to Player.Seek and send their respective Input commands too.

The Select, Back and Play/Pause button do similar things and are straight forward too.

This all seemed easy enough.

The next page moves on to doing a schematic and making the circuit board.

 

 (Page 1 of 5)