Support for XBMC2 plugin (formerly XBMCRepeat)

Questions and comments specific to a particular plugin should go here.
jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Sat Apr 06, 2013 4:15 pm

Supersevereid wrote:Sorry to say, I've run into a new problem.
(Darth Vaders Voice) Noooooooooooooooo!
If my HTPC goes into sleep, is turned off or XBMC is quit and restarted the events wont reconnect.

I've setup an event with ping to run JSONRPCEventsconnect and disconnect, but it doesnt seem to work.
Any ideas?
Unfortunately the code to connect/disconnect is not fully tested especially disconnect, but I thought I had fixed the disconnect problem. I'll hopefully get something done this weekend and hopefully get the event stuff finished.
Edit:
Only way I can get it to recieve xbmc events again is to restart EG it seems
That should definitely not be needed. :cry:

Are you running XBMC and EventGhost on the same or different systems?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

Supersevereid
Posts: 11
Joined: Mon Apr 01, 2013 11:26 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Supersevereid » Sat Apr 06, 2013 5:17 pm

XBMC and EG are running on two different systems.
No idea what it might be, but i'm executing actions left and right after a disconnect, but only a restart of EG seems to remedy the issue

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Sun Apr 07, 2013 10:22 pm

krantzet wrote:The first problem is that when I configuring the JSON-RPC the Namespace and Method drop down lists are empty and I can't add anything to them (se attached pic1). I was playing along with another computer and somehow managed to get the dropdown-lists full of JSONRPC-commands, but i have no idea how I did. I cant repeat it on my XBMC-computer, but found out that the file %appdata%\Roaming\EventGhost\plugins\XBMC2\jsonrpc.dat was the key.
The XBMC2 plugin can't connect to XBMC, so you are not using the right IP and or port in the plugin, something is using or blocking the port, try a different port.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Sun Apr 07, 2013 11:53 pm

Supersevereid wrote:If my HTPC goes into sleep, is turned off or XBMC is quit and restarted the events wont reconnect.
Everytime XBMC is started JSONRPCEventsconnect needs to be run to make a connection. as the JSON-RPC notifications needs a active connection. I would like to make it reconnect automatically but I don't know a way at the moment. The sleeping part I don't know anything about as I have never used that feature, but I guess the connection gets disconnected.
I've setup an event with ping to run JSONRPCEventsconnect and disconnect, but it doesnt seem to work.
Any ideas?
So the disconnect works but the plugin needs to get an event from XBMC before the connection is closed, you will get a "Not listening for XBMC JSON-RPC events" in the EventGhost log. I haven't figured out how to disconnect directly as the event receiving code is running in a different thread and waiting for an event.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

krantzet
Posts: 5
Joined: Sat Apr 06, 2013 6:03 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by krantzet » Mon Apr 08, 2013 7:46 am

The XBMC2 plugin can't connect to XBMC, so you are not using the right IP and or port in the plugin, something is using or blocking the port, try a different port.
Hmm. I doubt that.
Everything about the XBMC2-plugin except JSONRPC is working.
I have set up about 100 events/actions from XBMC2 that passes on to XBMC like a charm.
It is just the JSONRPC part that is not working.
(All firewalls and antivirus programs are shut down.)

Is the jsonrpc.dat identical on all PCs?
Is it possible to move that file from one pc to another like i tried to do?

How do I go from No Namespaces to a full list of actions?

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Mon Apr 08, 2013 1:38 pm

krantzet wrote:
The XBMC2 plugin can't connect to XBMC, so you are not using the right IP and or port in the plugin, something is using or blocking the port, try a different port.
Hmm. I doubt that.
Do you have the "Allow control of XBMC via HTTP" activated in XBMCs Services\Webserver activated?
Everything about the XBMC2-plugin except JSONRPC is working.
I have set up about 100 events/actions from XBMC2 that passes on to XBMC like a charm.
It is just the JSONRPC part that is not working.
(All firewalls and antivirus programs are shut down.)
If the other actions work then the IP is correct but JSON-RPC uses a different port, then the port has to be blocked/in use/wrong.
Is the jsonrpc.dat identical on all PCs?
The plugin gets the list from XBMC, so it's XBMC version dependent.
Is it possible to move that file from one pc to another like i tried to do?
Sure, if you are going to control XBMC with the same version.
How do I go from No Namespaces to a full list of actions?
XBMC needs to be running then you press the "update" button in the JSON-RPC config dialog. Now you should get all actions supported by XBMC.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

krantzet
Posts: 5
Joined: Sat Apr 06, 2013 6:03 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by krantzet » Mon Apr 08, 2013 8:09 pm

Do you have the "Allow control of XBMC via HTTP" activated in XBMCs Services\Webserver activated?
Yeah, its activated.
and I can login to http://127.0.0.1:80 on a web browser or use a remote controller from android/ios to control XBMC.
If the other actions work then the IP is correct but JSON-RPC uses a different port, then the port has to be blocked/in use/wrong.
Can I see/edit the JSON-RPC port in some config file?
Is the jsonrpc.dat identical on all PCs?
The plugin gets the list from XBMC, so it's XBMC version dependent.
Is it possible to move that file from one pc to another like i tried to do?
Sure, if you are going to control XBMC with the same version.
I am using Frodo 12.0 on my test pc and Frodo 12.1 on my XBMC Computer.
Can that be the reason that its not working?
Is XBMC2/JSON-RPC compatible with 12.1 too?
XBMC needs to be running then you press the "update" button in the JSON-RPC config dialog. Now you should get all actions supported by XBMC.
That only gives me
"Error opening: jsonrpc.dat
JSON-RPC connection error: http://127.0.0.1:80
{"jsonrpc": "2.0", "id": 1, "method": "JSONRPC.Version"}
Error opening: jsonrpc.dat"

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Mon Apr 08, 2013 11:09 pm

krantzet wrote:Yeah, its activated.
and I can login to http://127.0.0.1:80 on a web browser or use a remote controller from android/ios to control XBMC.
The code that does the connection is very simple so I can't think of anything else to try, sorry.
Can I see/edit the JSON-RPC port in some config file?
It's in the XBMC2 configuration dialog (Doubleclick on Autostart\XBMC2) the second editbox is the port.
I am using Frodo 12.0 on my test pc and Frodo 12.1 on my XBMC Computer.
Can that be the reason that its not working?
Is XBMC2/JSON-RPC compatible with 12.1 too?
I'm using 12.1 and it's working great, so can't be it.
That only gives me
"Error opening: jsonrpc.dat
JSON-RPC connection error: http://127.0.0.1:80
{"jsonrpc": "2.0", "id": 1, "method": "JSONRPC.Version"}
Error opening: jsonrpc.dat"
The update command uses JSON-RPC actions to retrieve the JSON-RPC actions list, so it won't work when it can't connect for whatever reason. :cry:

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

Supersevereid
Posts: 11
Joined: Mon Apr 01, 2013 11:26 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Supersevereid » Tue Apr 09, 2013 7:14 pm

jonib wrote:
Supersevereid wrote:If my HTPC goes into sleep, is turned off or XBMC is quit and restarted the events wont reconnect.
Everytime XBMC is started JSONRPCEventsconnect needs to be run to make a connection. as the JSON-RPC notifications needs a active connection. I would like to make it reconnect automatically but I don't know a way at the moment. The sleeping part I don't know anything about as I have never used that feature, but I guess the connection gets disconnected.
I've setup an event with ping to run JSONRPCEventsconnect and disconnect, but it doesnt seem to work.
Any ideas?
So the disconnect works but the plugin needs to get an event from XBMC before the connection is closed, you will get a "Not listening for XBMC JSON-RPC events" in the EventGhost log. I haven't figured out how to disconnect directly as the event receiving code is running in a different thread and waiting for an event.

jonib
The actions run as intended using the ping plugin so check if the HTPC is alive or not.
JSONRPCEventsConnect doesn't work after it has been disconnected for whatever reason, so it seems like there is an issue with the handshake, also i never get "Not listening for XBMC JSON-RPC events" as it hasnt connected in the first place after a disconnect (Nor does it seem to work if i run it while already connected)

The only way i can make it handshake again is by restarting EG

EDIT: I also have the same issue as krantzet with the update button not working when usin JSONRPC

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Tue Apr 09, 2013 10:16 pm

krantzet wrote:
Do you have the "Allow control of XBMC via HTTP" activated in XBMCs Services\Webserver activated?
Yeah, its activated.
I forgot there is one more setting in XBMC "Services\Remote control\Allow programs on this/other system(s) to control XBMC " do you have that enabled also?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Tue Apr 09, 2013 10:24 pm

Supersevereid wrote:The actions run as intended using the ping plugin so check if the HTPC is alive or not.
JSONRPCEventsConnect doesn't work after it has been disconnected for whatever reason, so it seems like there is an issue with the handshake, also i never get "Not listening for XBMC JSON-RPC events" as it hasnt connected in the first place after a disconnect (Nor does it seem to work if i run it while already connected)
I'll see if I can improve the connect/disconnect for the next version.
EDIT: I also have the same issue as krantzet with the update button not working when usin JSONRPC
You also get an "JSON-RPC connection error:"?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

krantzet
Posts: 5
Joined: Sat Apr 06, 2013 6:03 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by krantzet » Wed Apr 10, 2013 9:16 am

I forgot there is one more setting in XBMC "Services\Remote control\Allow programs on this/other system(s) to control XBMC " do you have that enabled also?
Yes, it's also enabled.

Supersevereid
Posts: 11
Joined: Mon Apr 01, 2013 11:26 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Supersevereid » Wed Apr 10, 2013 6:53 pm

EDIT: I also have the same issue as krantzet with the update button not working when usin JSONRPC
You also get an "JSON-RPC connection error:"?
Actually I get an error as soon as I try to add the macro, it wont even let me add it - I got the same error as krantzet using the old init.py
Image

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Wed Apr 10, 2013 7:18 pm

Supersevereid wrote:Actually I get an error as soon as I try to add the macro, it wont even let me add it - I got the same error as krantzet using the old init.py
I think there is missing code to create the "introspect.dat" that's causing the error. If you want you can try putting the attached "introspect.zip" (rename to "introspect.dat") in %APPDATA%\EventGhost\plugins\XBMC2.

But it's probably best to just use the older test version here.

I'm just working on making a proper release. Hopefully it wont take too long this time.

jonib
Attachments
Introspect.zip
(169.66 KiB) Downloaded 185 times
XBMC2 plugin to control XBMC. If you want to flatter me Image

blaher
Experienced User
Posts: 494
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by blaher » Thu Apr 11, 2013 3:40 am

krantzet wrote:
Yeah, its activated.
and I can login to http://127.0.0.1:80 on a web browser or use a remote controller from android/ios to control XBMC.
Mine wouldn't work until I changed the port in both XBMC & EventGhost to 8080. Might be worth a shot...
Attachments
screenshot000 (Large).jpg

Post Reply