VoxCommando

Help and Support (Using VoxCommando) => Kodi (XBMC) Frodo / Gotham / Isengard / Jarvis => Topic started by: vulcanjedi on May 13, 2015, 01:36:26 PM

Title: Kodi Events
Post by: vulcanjedi 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?
Title: Re: Kodi Events
Post by: PegLegTV 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"

(https://voxcommando.com/forum/proxy.php?request=http%3A%2F%2Fi1296.photobucket.com%2Falbums%2Fag18%2Fpeglegtv%2FXJson_zpsxwdlour5.png&hash=4a13df6741172ab54bbb7aedc1ff7a65be9b78df)

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 (http://voxcommando.com/forum/index.php?topic=1696.msg14728#msg14728)



Title: Re: Kodi Events
Post by: jitterjames on May 13, 2015, 02:31:45 PM
Any insights friends?

Are you using a default VC config for Kodi, or creating your own?
Title: Re: Kodi Events
Post by: vulcanjedi 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.
Title: Re: Kodi Events
Post by: vulcanjedi 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.
Title: Re: Kodi Events
Post by: jitterjames 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?
Title: Re: Kodi Events
Post by: vulcanjedi 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
Title: Re: Kodi Events
Post by: jitterjames 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.
Title: Re: Kodi Events
Post by: vulcanjedi 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
Title: Re: Kodi Events
Post by: jitterjames 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.
Title: Re: Kodi Events
Post by: PegLegTV 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
Title: Re: Kodi Events
Post by: PegLegTV 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
Title: Re: Kodi Events
Post by: jitterjames 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.
Title: Re: Kodi Events
Post by: jitterjames 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.
Title: Re: Kodi Events
Post by: vulcanjedi 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.
Title: Re: Kodi Events
Post by: jitterjames on May 13, 2015, 06:17:49 PM
This is just a heads up that I updated my previous post with some explanations that might help a bit.
Title: Re: Kodi Events
Post by: PegLegTV on May 13, 2015, 06:20:17 PM
thanks for the explanation, greatly appreciated
Title: Re: Kodi Events
Post by: vulcanjedi on May 14, 2015, 01:52:46 AM
After trolling google, kodi wiki/forums, vc wiki/forums, virtualbox wiki/forums trying two VMs, exporting, reimporting, reverting, new building a stock image with nothing but VC and its prereqs. Win8.1, restore win7,  win10 tech preview. No UAC, no FW, run as admin.
Still nothing worked.
Remotes/webinterface/eventghost worked. Changed VM settings, NICs, ....etc. But not in VC.

Just before bed I realize i have a old kodi installation on my Mac, I update the plugin accordingly and poof....events are flying. Kodiv14.0 on Mac seems fine....but  my main htpc is running Kodibuntu updated to Kodiv14.2 the latest release pre v15 and the stable versions for DL. Still dont get if its a kodi problem how all the other things work just not to VC.
Title: Re: Kodi Events
Post by: jitterjames on May 14, 2015, 07:38:43 AM
It works fine with 14.2 on Windows.  I don't know if KodiBuntu is somehow different (it should not be) but I have not seen a proper log so I have no way of knowing. No one else has reported a problem but that doesn't mean much especially since there are probably not that many VoxCommando users who use KodiBuntu.
Title: Re: Kodi Events
Post by: PegLegTV on May 14, 2015, 11:19:20 AM
this may be a long shot but its easy to try,

You can change the port that Kodi broadcast its events on by adding this to your advancedsettings.xml (this goes in your Kodi userdata folder)

Code: [Select]
<advancedsettings>
    <jsonrpc>
       <tcpport>9091</tcpport>
    </jsonrpc>
</advancedsettings>

Then open the Xjson plugin in VC and change the port from 9090 to 9091 then restart Kodi and VC to see if you start reciving events

Title: Re: Kodi Events
Post by: vulcanjedi on May 14, 2015, 08:45:51 PM
I also forgot I have a raspberry PI, with an existing Kodi install. v14.0 via OpenElec
Events work there.
I said screw it, I woudl try OpenElec install on my main system. The base/stable OE is up to Kodiv14.2.
It doesn't work on my main system either.
Title: Re: Kodi Events
Post by: jitterjames on May 14, 2015, 09:10:47 PM
If I am following the long thread of this problem correctly, it sounds like the weak link here is your "main system" whatever that is.
Title: Re: Kodi Events
Post by: jitterjames on May 14, 2015, 09:23:18 PM
I just did a quick test with Kodi 15 Isengard beta 1 (on Windows) and events seem to work normally.
Title: Re: Kodi Events
Post by: jitterjames on May 15, 2015, 09:19:13 AM
I have now tested with KodiBuntu 14.0 and 14.2 and events work fine with zero effort.

It seems that you need to enable "Allow control of Kodi via UPnP" and then you need to restart KodiBuntu.  But I think you must have done this already or you would not be getting events in EventGhost and you would not be getting a "Connected" response in your log.

So I guess this problem is specific to the particular machine(s) / virtual machines(s) and setups you are using.

Sorry, I don't know what else I can test.
Title: Re: Kodi Events
Post by: vulcanjedi on May 15, 2015, 04:35:05 PM
Many thanks James, certainly more than I expected as well as anyone else that gave the thread a peek :)
i felt compelled after reverting skins and other things. Finding what else could be specific about this vs my other xbmc/kodi instances.
Found it.  The debug feature with specifc component things is nice, so you can get specific information on smb or network...etc. OpenElec even puts it in a nice easy place for you to find.
Anyways I discovered for some unknown reason I had some lingering thing in my advancedsettings.xml on this machine. I had compactoutput as false in my file.
This setting is apparently incompatible w/ VC.  Sorry for all the trouble friends, but now I get to try to make some cool event triggered commands! woot!
http://kodi.wiki/view/Advancedsettings.xml#.3Cjsonrpc.3E (http://kodi.wiki/view/Advancedsettings.xml#.3Cjsonrpc.3E)
Title: Re: Kodi Events
Post by: jitterjames on May 15, 2015, 05:04:14 PM
OK from now on I must insist that all users show me their complete advancedsettings.xml file before I try to troubleshoot Kodi problems!  :bonk
Title: Re: Kodi Events
Post by: vulcanjedi on May 15, 2015, 05:08:37 PM
Sorry for all the heartburn James, this one was bugging me. I dont recall why that setting was ever in there in the first place either. :( Maybe I can add a little note in the wiki to not have that set :) Appreciate the efforts as always.
Title: Re: Kodi Events
Post by: jitterjames on May 15, 2015, 05:28:05 PM
As with most things, identifying the problem was the hard part.

I've already fixed it so the next release will work regardless of this setting.  So thanks for figuring out what was causing it! :hugs