Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Support for XBMC2 plugin (formerly XBMCRepeat)

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

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

sidynele wrote:I was able to get it working with your previous suggestion,
Thanks for reporting back, It's a lot easier for me to help if I know it actually worked.
The correct parameter to open the XBMC Pandora addon is as follows:

Code: Select all

['script.audio.pandora']
Good to know. I can't use Pandora so I did not test the previous command.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
Silverhawk
Posts: 16
Joined: Sun Nov 10, 2013 6:19 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Silverhawk »

Been using this with my xbox controller, seems to work quite well for most stuff, can't get the following things to work correctly though:

When I use XBMC: Left/Right Trigger, nothing seems to happen. While my xbox triggers are fast scroll left/right and shoulder buttons are que/go to que.

And more problematic: The XBMC: A action doesn't seem to work properly. I use this to select/pause when in a movie but when I use the EventGhost command I get an error saying PVR addons aren't running.

Any help would be much appreciated.
[email protected]
Posts: 5
Joined: Tue Dec 03, 2013 12:16 am

XBMC events?

Post by [email protected] »

Sorry to ask this again, i've been up and down both eventghost and xbmc forums and I must be missing something obvious. How can I do a command in eventghost once I'm playing a movie in xbmc? all the posts I find seem to be from 2008 or 2011. The closest I've got is something about the JSONRPC action from the XBMC2 plugin. But even if I do that, does it just check the xbmc server ever second? or ever few seconds? I was hopping automating this would be pretty easy but I'm just not able to find anything I can make sense of.

Thanks for the help.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: XBMC events?

Post by jonib »

[email protected] wrote:Sorry to ask this again, i've been up and down both eventghost and xbmc forums and I must be missing something obvious. How can I do a command in eventghost once I'm playing a movie in xbmc? all the posts I find seem to be from 2008 or 2011. The closest I've got is something about the JSONRPC action from the XBMC2 plugin. But even if I do that, does it just check the xbmc server ever second? or ever few seconds? I was hopping automating this would be pretty easy but I'm just not able to find anything I can make sense of.
Did you search for XBMC and events, that should have given you several discussions how to activate events in the XBMC2 plugin.

Anyway you need a recent test version of the XBMC2 plugin (latest here) here is info about some new things in the test version.

Put the test version in (EventGhost dir)\plugins\XBMCRepeat. And then you need to activate "JSON-RPC notifications" to get events from XBMC. To be safe backup your EventGhost config before.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
KairuByte
Posts: 8
Joined: Sat Dec 01, 2012 12:24 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by KairuByte »

Hi!

So, I'm trying to have a user profile load when I hit a certain button. Ultimately I want the password prompt but at the moment I'm fiddling and just trying to get it to work in general. I'm using your most recent test version.

When I try to run Profiles.LoadProfile with the parameters {"profile" : "Default" , "prompt" : false} it throws this error:

Code: Select all

   Error in Action: "XBMC2: JSONRPC: Profiles.LoadProfile"
   Traceback (most recent call last) (1640):
     File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
       return self(*args)
     File "C:\Program Files (x86)\EventGhost\plugins\XBMCRepeat\__init__.py", line 920, in __call__
       responce = self.plugin.JSON_RPC.send(method, ast.literal_eval(ParseString2(param)))
     File "ast.pyc", line 68, in literal_eval
     File "ast.pyc", line 63, in _convert
     File "ast.pyc", line 62, in <genexpr>
     File "ast.pyc", line 67, in _convert
   ValueError: malformed string
Am I doing something wrong? Do you have any advice?
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

KairuByte wrote:So, I'm trying to have a user profile load when I hit a certain button. Ultimately I want the password prompt but at the moment I'm fiddling and just trying to get it to work in general. I'm using your most recent test version.

Am I doing something wrong? Do you have any advice?
Looks like there is something weird with boolean support, I get it to work without the prompt. I'll have to look into it more later (hopefully soon)

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

Silverhawk wrote:Been using this with my xbox controller, seems to work quite well for most stuff:
Nice.
When I use XBMC: Left/Right Trigger, nothing seems to happen. While my xbox triggers are fast scroll left/right and shoulder buttons are que/go to que.
I never looked into how the analog inputs work, so looks like they don't. :D I'll look into it later unfortunately there are a lot I need to look into with higher priority.
And more problematic: The XBMC: A action doesn't seem to work properly. I use this to select/pause when in a movie but when I use the EventGhost command I get an error saying PVR addons aren't running.
Gamepad:A seems to work fine for me. So I need a bit more specific info where you have the problem and have you modified the gamepad keymap? and what XBMC version?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
Silverhawk
Posts: 16
Joined: Sun Nov 10, 2013 6:19 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Silverhawk »

I'm using frodo, 12.3 with an unmodified keymap. Kinda gave up on using the xbox controller though, didn't like it that much. Using Yatse now with some tasker stuff so I can use my phone as a remote by flipping it over.
gechu
Experienced User
Posts: 58
Joined: Sat Jan 07, 2012 10:35 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by gechu »

Trying to send a specific directory to XBMC using the VideoLibrary.Scan method. http://wiki.xbmc.org/index.php?title=JS ... brary.Scan

Selected VideoLibrary and Scan, and as parameter I gave:

Code: Select all

{"directory":"d:\\Media\\TV shows\\my show"}
XBMC picked up the library scan request, however the parameter wasn┬┤t handled correctly / or there is a bug in the Windows version of XBMC because my library didn┬┤t get updated.

Anyone else here with experence from using this method?

/E
supertusse
Posts: 8
Joined: Sat Nov 20, 2010 10:12 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by supertusse »

Hello

I've been having problems with xbmc2 crashing (latest eventghost, xbmc2 testversion, xbmc gotham), seemingly related to handling ssdp-messages. I know far to little about this to provide a proper fix, but after changing line 1634 (or thereabouts, I added some debugging statements, so it might not be 100% accurate) to...

Code: Select all

 if "NOTIFY * HTTP/1.1" == headers.get('Start-line','qwerty'):
... everything seems to be working alright. The error message I received indicated that 'Start-line' was not a key in the dict headers. Using the get method makes sure something ('qwerty') is returned and the if test is valid.

best regards,
tusse
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

supertusse wrote:I've been having problems with xbmc2 crashing (latest eventghost, xbmc2 testversion, xbmc gotham), seemingly related to handling ssdp-messages.
There is not much error checking in the SSD code, so I'm surprised there has not been more error reports about it. Thanks for reporting.
I know far to little about this to provide a proper fix, but after changing line 1634 (or thereabouts, I added some debugging statements, so it might not be 100% accurate) to...

Code: Select all

 if "NOTIFY * HTTP/1.1" == headers.get('Start-line','qwerty'):
... everything seems to be working alright. The error message I received indicated that 'Start-line' was not a key in the dict headers. Using the get method makes sure something ('qwerty') is returned and the if test is valid.
I'll add more code to handle missing information. I would prefer to see any error messages as those give better understanding what went wrong. But thanks for the debugging anyway.

Damn XBMC Gotham is already at beta 4 and I am not done with the proper release. :cry:

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

gechu wrote:Trying to send a specific directory to XBMC using the VideoLibrary.Scan method. http://wiki.xbmc.org/index.php?title=JS ... brary.Scan

Selected VideoLibrary and Scan, and as parameter I gave:

Code: Select all

{"directory":"d:\\Media\\TV shows\\my show"}
XBMC picked up the library scan request, however the parameter wasn┬┤t handled correctly / or there is a bug in the Windows version of XBMC because my library didn┬┤t get updated.

Anyone else here with experence from using this method?
I haven't had a chance to look into this yet, but I think this kinda question is better asked at the XBMC JSON-RPC Forum.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
supertusse
Posts: 8
Joined: Sat Nov 20, 2010 10:12 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by supertusse »

jonib wrote:I'll add more code to handle missing information. I would prefer to see any error messages as those give better understanding what went wrong. But thanks for the debugging anyway.
Yeah, I understand the need for debugging output, my main problem with that was that I couldn't actually get anything sensible out of it. I tried printing everything coming into the Headers() function to try to figure out which message caused the crashing, but couldn't get any.

The crashing seemed kind of random, but usually it happened around the time when I was expecting an OnScanFinished (or similar) event from xbmc. Here's my understanding of what happens:

1. xbmc2 goes into a loop, looking for xbmc to show up on the SSDP "channel"
2. I start xbmc, the plugin detects it and sets itself up for receiving notifications
3. i trigger a video library scan from eventghost, this works fine. I get a onscanstartet notification back into eventghost
4. eventghost goes into listening mode with xbmc2 running in the background. misc services (e.g dvbviewer) send messages in ssdp, these are received and discarded by xbmc2
5. suddenly, the data = recv(4096) picks up "something" (i tried to print it, nothing showed up in the log), and the Headers() function tries to parse this into something sensible. however, it was just an "empty" message, so there's no 'start-line' key in the resulting headers dict, and the if test blows up. (The error message from xbmc2 was about this specifically, KeyError in headers)

Because I couldn't figure out what was picked up in that recv() that triggered the Headers parsing method, I just circumvented it my making sure the if test on the start-line value doesn't crash, and the code exits back to the waiting state in the next if test anyway.

I -think- this error showed up around Gotham beta 1, I've been running monthly's for a while, with no problems. I rarely change anything on this computer except upgrading xbmc.

I'll see about getting the error message out from an untouched xbmc2 plugin, but if you could possibly make a new testing version with more debugging output around the receiving and parsing of ssdp messages, that could be useful (I'm pretty clueless about Python, really).

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

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

supertusse wrote:Yeah, I understand the need for debugging output, my main problem with that was that I couldn't actually get anything sensible out of it. I tried printing everything coming into the Headers() function to try to figure out which message caused the crashing, but couldn't get any.
No problem, it just seemed you had gotten an error message. I asked for it just because some people describe the problem but miss sending the actual error that would make the debugging easier, but if you did not get one you can't give it to me. :)
I'll see about getting the error message out from an untouched xbmc2 plugin, but if you could possibly make a new testing version with more debugging output around the receiving and parsing of ssdp messages, that could be useful (I'm pretty clueless about Python, really).
I have attached a new version that should give more info if you have debugging activated in the plugin, and should not crash the SSDP thread.
I -think- this error showed up around Gotham beta 1, I've been running monthly's for a while, with no problems. I rarely change anything on this computer except upgrading xbmc.
I'll try to move over to Gotham soon as I haven't done that yet (I have it installed but don't use it other then quick tests). So I can fix any Gotham related problems then.

This was a quick code change as I don't have much time this weekend, so hopefully it can give more info about the problem

ps
I updated the attached file fixing an indentation bug, should work now. :oops: (Teaches me not to test code before posting.)

jonib
Attachments
__init__.py
XBMC2 SSDP debug version 0.6.15a (fixed a stupid indentation bug )
(105.16 KiB) Downloaded 221 times
XBMC2 plugin to control XBMC. If you want to flatter me Image
gechu
Experienced User
Posts: 58
Joined: Sat Jan 07, 2012 10:35 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by gechu »

jonib wrote:
gechu wrote:Trying to send a specific directory to XBMC using the VideoLibrary.Scan method. http://wiki.xbmc.org/index.php?title=JS ... brary.Scan

Selected VideoLibrary and Scan, and as parameter I gave:

Code: Select all

{"directory":"d:\\Media\\TV shows\\my show"}
XBMC picked up the library scan request, however the parameter wasn┬┤t handled correctly / or there is a bug in the Windows version of XBMC because my library didn┬┤t get updated.

Anyone else here with experence from using this method?
I haven't had a chance to look into this yet, but I think this kinda question is better asked at the XBMC JSON-RPC Forum.

jonib
Off course you┬┤re right, thanks for the reply.
Post Reply