Author Topic: Kodi Events  (Read 10279 times)

0 Members and 4 Guests are viewing this topic.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Kodi Events
« on: May 13, 2015, 01:36:26 PM »
Trying to use Kodi events? win8.1 // VC 2.142
But not seeing them in the Vc history pane
Installed Eventghost to see if my configuration for kodi was incorrect but event ghost worked and produced an event
XBMC2.Player.OnStop.episode {u'item': {u'id': 82792}, u'end': False}
I use a different http port than 80 but the test on both EventGhost / VC test fine. my Webinterface is fine.
EventServer on EventGhost is defaulted at 9777 and the JSON RPC notifications is 9090 I have both set to enable.
The Json plugin setting for notifications is too on 9090?
Any insights friends?
« Last Edit: May 13, 2015, 02:12:44 PM by vulcanjedi »

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Kodi Events
« Reply #1 on: May 13, 2015, 02:27:03 PM »
For my Xjson plugin the only thing I have checked is "Subscribe to notifications on port" "9090"

for the "Http Port:" you will find this at: System> Services> Web Server
Make sure that you Enable "Allow Control of XBMC Via Http"



I use port 5680 (no reason just a random port number not in use)

I don't use a username or password on mine


This post might be of some help as well
http://voxcommando.com/forum/index.php?topic=1696.msg14728#msg14728




jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Events
« Reply #2 on: May 13, 2015, 02:31:45 PM »
Any insights friends?

Are you using a default VC config for Kodi, or creating your own?

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Kodi Events
« Reply #3 on: May 13, 2015, 02:33:15 PM »
thanks PegLegTV, I'm pretty sure i have that set in XBMC/Kodi but I'm at work at the moment.
The fact I can start a vid from the webinterface makes me believe it is set as well.

Per the wiki I have also tried running as Administrator w/ no noticable change.
Also the Show All Events is enabled. The log doesnt really have anything related of note that I can tell.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Kodi Events
« Reply #4 on: May 13, 2015, 02:36:47 PM »
Are you using a default VC config for Kodi, or creating your own?
I'm sorry James I'm not sure what you mean a default VC Config?
I installed the english kodi.zip during the VC install and just use the plugins that are provided by default for xJSON and xMySQL.
The only 'custom' thing I have is providing my specific values in the plugin config windows; I have a custom port vs the standard 80 or 8080 Kodidefaults to and I use user/pass enabled webservice.
I haven't changed any of the event / notification ports and per the Kodi wiki it says must be done via advancedsettings.xml and that its actually unknown how to accomplish that at this time.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Events
« Reply #5 on: May 13, 2015, 04:18:24 PM »
I'm sorry James I'm not sure what you mean a default VC Config?
I installed the english kodi.zip during the VC install and just use the plugins that are provided by default for xJSON and xMySQL.
That is precisely what I mean.

Are you running Kodi on the same machine as Vox?

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Kodi Events
« Reply #6 on: May 13, 2015, 04:58:57 PM »
No I am not Kodi runs on its own little htpc box, runing Kodibuntu. Man I still cant get over how odd it is to write / say Kodi.
Eventghost doesnt seem to have any issues on 2 other machines seeing the events.
EG seems nice I am sure I could 'workaround' with using EG but I'd rather keep everything in VC  vs managing 2 apps

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Events
« Reply #7 on: May 13, 2015, 05:13:39 PM »
OK, it's because Kodi is running on another PC.  If Kodi is already running when you start VC then it will probably work for you.

The default config for Kodi will try to "connect" whenever Kodi gets focus, but if you run Kodi on another machine that will never happen so you will need to find some other way to connect.  EventGhost is doing it over and over again every 5 seconds which is not something I would ever do by default (yech).

http://voxcommando.com/mediawiki/index.php?title=Plugin_XJson#Connect

You could put it into your command that launches Kodi, but you'll need to put a decent delay into it because you can't connect to Kodi until after it has finished loading.  Once connected you should be good until either VC or Kodi closes.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Kodi Events
« Reply #8 on: May 13, 2015, 05:45:25 PM »
Hmm thats interesting.
Thanks James.  I tried to add to VC.loaded event. But I would still need to implement the delay.
Should I be able to try to manually connect just to verify?
I rarely power off my htpc, except to reboot as needed.
I see XJson.Connects in the History but still no events (from pausing/starting/stopping video via the web interface).
I ran the default Kodi Notifications and Events\connect command that ships with the default zip for helix Kodi and VC install and i added OSD to the text and says I'm connected.

voxlog:
5/13/2015 3:36:29 PM   VoxLog created / UAC test passed.
5/13/2015 3:36:29 PM   837   OS: Microsoft Windows NT 6.2.9200.0
5/13/2015 3:36:29 PM   837   Build: 9200
5/13/2015 3:36:29 PM   837   .Net version: 4.0.30319.34209
5/13/2015 3:43:00 PM   18   doCommand:kodi event viewer
5/13/2015 3:43:00 PM   18   action repeat set to: 1
5/13/2015 3:43:00 PM   18   Action:  XJson.Connect -
5/13/2015 3:43:00 PM   18   [action] XJson.Connect:

5/13/2015 3:43:00 PM   18   [plugin] prepare socket for notifications
5/13/2015 3:43:00 PM   18   [plugin] socket appears to be open already
5/13/2015 3:43:00 PM   18   [plugin] socket sending: {"jsonrpc": "2.0", "method": "JSONRPC.SetConfiguration","params":{ "notifications": {"Playlist":false,"gui":true}},"id": "0"}
5/13/2015 3:43:00 PM   18   [plugin] socket sending: {"jsonrpc": "2.0", "method": "jsonrpc.GetConfiguration","id": "0"}
5/13/2015 3:43:00 PM   18   Action INFO: Connected
« Last Edit: May 13, 2015, 05:51:29 PM by vulcanjedi »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Events
« Reply #9 on: May 13, 2015, 05:48:31 PM »
I have no idea then.  If it says it connected, then I can't imagine why no events would be generated.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Kodi Events
« Reply #10 on: May 13, 2015, 05:54:57 PM »
Quote
Jitterjames You could put it into your command that launches Kodi, but you'll need to put a decent delay into it because you can't connect to Kodi until after it has finished loading.  Once connected you should be good until either VC or Kodi closes.

like Jitterjames said you will need a decent wait period for XBMC/KODI to load I would start around 6-10 Seconds

I have a Script I use to force close XBMC on the the rare occasion it freezes, first it triggers an event to have VC disconnect from XBMC (so VC Doesn't crash too) then closes XBMC and then I have it wait six seconds and launch XBMC then waits another 8 Seconds to trigger an Event to have VC connect to XBMC,

it used to wait six seconds before connecting but I switched to a "heavier" skin (Aeon Nox Gotham) so it takes longer to load, you will have to test out the time span that works best for your system and Skin

I would use the "XJson.SetConnection" to connect I have a Map that has all my XBMC system IP's so I can Say "Connect to my tablet" and send voice commands to navigate XBMC on my tablet by voice

NOTE: Jitterjames responded while I was responding, but thought I should share in case it might help some how

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Kodi Events
« Reply #11 on: May 13, 2015, 06:01:48 PM »
Quote
voxlog:
5/13/2015 3:36:29 PM   VoxLog created / UAC test passed.
5/13/2015 3:36:29 PM   837   OS: Microsoft Windows NT 6.2.9200.0
5/13/2015 3:36:29 PM   837   Build: 9200
5/13/2015 3:36:29 PM   837   .Net version: 4.0.30319.34209
5/13/2015 3:43:00 PM   18   doCommand:kodi event viewer
5/13/2015 3:43:00 PM   18   action repeat set to: 1
5/13/2015 3:43:00 PM   18   Action:  XJson.Connect -
5/13/2015 3:43:00 PM   18   [action] XJson.Connect:

5/13/2015 3:43:00 PM   18   [plugin] prepare socket for notifications
5/13/2015 3:43:00 PM   18   [plugin] socket appears to be open already
5/13/2015 3:43:00 PM   18   [plugin] socket sending: {"jsonrpc": "2.0", "method": "JSONRPC.SetConfiguration","params":{ "notifications": {"Playlist":false,"gui":true}},"id": "0"}
5/13/2015 3:43:00 PM   18   [plugin] socket sending: {"jsonrpc": "2.0", "method": "jsonrpc.GetConfiguration","id": "0"}
5/13/2015 3:43:00 PM   18   Action INFO: Connected

@Jitterjames, in the log it says the action used is XJson.Connect wouldn't XJson.SetConnection be whats used to connect to a remote Computer since an ip address and port would have to be entered
« Last Edit: May 13, 2015, 06:17:12 PM by PegLegTV »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Events
« Reply #12 on: May 13, 2015, 06:05:06 PM »
If VJs HTPC is always running, and Kodi is always on, then none of this really matters, and you shouldn't even need to run the action since the xJson plugin will try to connect automatically when VC starts if "subscripe to notifications on port:" is selected.

There appears to be some other issue here.

I just did a quick test on a fresh install on my laptop and it has no problems getting events from another computer.

If you want to do a Team session I can come take a look.

I would suggest some other problem like a maladjusted firewall etc. except that your other commands are working and the log shows a successful connection to the socket.

I suppose that EG could be interfering somehow, but it's a long shot.  If Kodi doesn't want to stay connected to multiple clients for some reason then EG would take control away from VC by constantly reconnecting.
« Last Edit: May 13, 2015, 06:19:38 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Events
« Reply #13 on: May 13, 2015, 06:07:28 PM »
@Jitterjames, in the log it says the action used it XJson.Connect wouldn't XJson.SetConnection be whats used to connect to a remote Computer since an ip address and port would have to be entered

No. It's a different thing.

http://voxcommando.com/mediawiki/index.php?title=Plugin_XJson#SetConnection

The words "SetConnection" and "Connect" are confusing because they sound like they are talking about the same thing but I have to keep action names relatively short.

Set Connection does not actually connect.  It just sets the parameters that will be used when connecting to Kodi to give normal actions.  Actually when sending normal commands it is using HTTP REST and does not actually hang on to the connection.

But in order to receive events from Kodi we need to open a socket (normally on port 9090) and keep it open so that Kodi can send us events at any time.  This is what the "Connect" action does.  It's also what the plugin does automatically on startup is the notifications box is checked in the xJson plugin settings.
« Last Edit: May 13, 2015, 06:15:45 PM by jitterjames »

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Kodi Events
« Reply #14 on: May 13, 2015, 06:13:58 PM »
I agree all my other things appear to be working. I only just now installed EG to help validate network issue. Since it works that didn't seem to be the case. So trying to troubleshoot. I haven't used the events triggers in the past except for VC based ones.
This is a newly installed system with just chrome, and VC installed in this VM. I will keep playing. I appreciate both your efforts and welcome anyone elses. I do have some other automation and if I couple w/ VC events that would be pretty neat.