PDA

View Full Version : How to execute windows program using XPL or XAP



shen
2006-07-15, 18:40
Hi all,

I'm looking for a simple way to do the following:

On the machine slimserver is installed I want to start a windows program if a special button of the slimserver remote is pressed.

Sounds simple, but it seems not to be that simple :(

I googled a lot and found programs which can monitor XPL or XAP events sent by slimserver on the press of a remote button, but I did not find a simple way to start an executeble on such an event.

Isn't there a simple application which can listen to XPL or XAP messages from slimserver and on a special message (remote button) a program can be started?

Has anybody a solution for this?

Thanks ...

Stefan

gorstk
2006-07-16, 02:42
shen wrote:
> Hi all,
>
> I'm looking for a simple way to do the following:
>
> On the machine slimserver is installed I want to start a windows
> program if a special button of the slimserver remote is pressed.
>
> Sounds simple, but it seems not to be that simple :(
>
> I googled a lot and found programs which can monitor XPL or XAP events
> sent by slimserver on the press of a remote button, but I did not find
> a simple way to start an executeble on such an event.
>
> Isn't there a simple application which can listen to XPL or XAP
> messages from slimserver and on a special message (remote button) a
> program can be started?
>
> Has anybody a solution for this?

I am sure xplhal can do this.

Setup a 'determinator' in xplhal to listen for the IR message of the
'special' button. Then set the action to launch a program.

shen
2006-07-16, 03:08
I am sure xplhal can do this.

Setup a 'determinator' in xplhal to listen for the IR message of the
'special' button. Then set the action to launch a program.

Not really.

I did the following:

Installed xPLHAL Manager 1.53
It can see my SqueezeBox in "xPL" devices so far.

According to http://www.google.com/search?q=cache:vnYJSVMRfOwJ:www.xplproject.org.uk/modules.php%3Fop%3Dmodload%26name%3DSections%26fil e%3Dindex%26req%3Dprintpage%26artid%3D34+xpl+slims erver+execute+program&hl=de&gl=de&ct=clnk&cd=11
saying



SlimServer's xPL interface can handle infra-red signals in a variety of ways. By default, no xPL messages are sent when you press a button on your remote control. To change this, do the following:

- Open the xPLHal Manager and click on xPL Devices.

- Your player(s) should be listed, along with any other xPL devices you may have, in the right-hand window.

- Double-click on the name of your player to bring up it's configuration window.

- Select infrared from the list of configurable items.

- The value will probably be set to "none". Delete the current value, and enter the word buttons

- Click OK.

Your player will now send an xPL message whenever you press a button on it's remote control.


this does not work for me. Double clicking the player I get an error saying No information is currently available about this device. This device has not issued a config.list message, therefore xPLHal is not aware of which items can be cofigured
Looking at the integrated xPL Monitor, I can see messages from my SqueezeBox coming in.

I'm using SlimServer 6.3.0 with SoftSqueeze 2.7 and a SqueezeBox v3 with the latest firmware () installed.

Stefan

CouchPotatoe
2006-07-16, 05:44
First a caveat - the current version of xAP SlimServer was not written
for the current CLI that is in v 6 of SlimServer and particularly not
v6.3/6.5. It's use here is unsupported until a new version of the
conduit is released and that will not be in the near future until the
(excellent) new CLI stabilises and the conduit author finds some spare
time....(if !)

If you are just looking for the IR remote keypresses I'm fairly sure
this works fine however and you would then monitor these using any xAP
capable script engine (eg HomeSeer, MisterHouse, Girder, xAP Desktop,
xAP Floorplan). The latter one is free and particularly easy and you
don't need to use the inbuilt web (Ajax) based home automation front
end. You would just create a small script , triggered by the IR key
arrival from SlimServer to shell launch your .exe. Basically anything
that is VB scriptable can be actioned. Also for reference Girder has
inbuilt xAP support and is particularly well crafted for interaction
with external applications. Because it is so flexible and powerful it
takes a bit of getting to know. however

You should be able to achieve the same with xPL HAL and the inbuilt xPL
feature should you prefer - and it is probably a slightly easier setup.
The xAP conduit offered much more functionality with SlimServer than the
xPL one, although it is CLI attached rather than inbuilt. The fact it is
based around earlier SlimServer releases and not currently supported in
v6 may steer you away from this though.

Kevin

shen wrote:
> Hi all,
>
> I'm looking for a simple way to do the following:
>
> On the machine slimserver is installed I want to start a windows
> program if a special button of the slimserver remote is pressed.
>
> Sounds simple, but it seems not to be that simple :(
>
> I googled a lot and found programs which can monitor XPL or XAP events
> sent by slimserver on the press of a remote button, but I did not find
> a simple way to start an executeble on such an event.
>
> Isn't there a simple application which can listen to XPL or XAP
> messages from slimserver and on a special message (remote button) a
> program can be started?
>
> Has anybody a solution for this?
>
> Thanks ...
>
> Stefan
>
>
>

shen
2006-07-16, 07:49
Thanks Kevin,

but this all seems to me to be to complex for the simple thing I want to do. I installed a few of your recommended programs and they all seem to be a sort of overkill for the things I'm planning to do :(

Aren't there more simple alternatives to start a program unsing then remote? This should not be a plugin, because the script should be run when the SB is powered off.

Stefan

CouchPotatoe
2006-07-16, 08:19
shen wrote:
> Thanks Kevin,
>
> but this all seems to me to be to complex for the simple thing I want
> to do. I installed a few of your recommended programs and they all seem
> to be a sort of overkill for the things I'm planning to do :(
>
Well they do a lot more than just what you want as lots of people want
different things...
> Aren't there more simple alternatives to start a program unsing then
> remote?
Not via xAP and xPL I'm afraid - whichever way you will need other apps
to make the logic between the button press and the action - and this
flexibility is possibly required as there will be the inevitable next
question like - how do I quit the application I just started or how do I
select menu option 'whatever' or how do I stop it launching the
application twice. xPL via xPLHAL is the tidiest solution probably of
these two.
> This should not be a plugin, because the script should be run
> when the SB is powered off.
>
The SB's don't execute plugins so they can be powered off or on and this
would still work . However the plugin ,which is actually running on
SlimServer would have to be able to launch the app on whatever machine
you desired. Of course if the app runs on the same machine as
Slimserver then you could write a simple Perl plugin for SlimServer
directly.

K
> Stefan
>
>
>

shen
2006-07-16, 08:35
Kevin, I know the possibilities one has with these applications, but that's not the one for me :-)

Back to the program I want to run: It's a simple commandline script (PHP) which sends it's output via telnet to the SB. So there's no need to stop this program.

So let's say the SqueezeBox is turned off and with pressing the play button I want to start "php.exe my_script1.php" and with pressing stop "... my_script2.php" ... if I got you right this can be done with a plugin!? This would be my preferred solution - is there an example script for this?

I'm getting closer - thanks so far :)

Stefan

gorstk
2006-07-16, 09:30
shen wrote:
> gorstk Wrote:
>> I am sure xplhal can do this.
>>
>> Setup a 'determinator' in xplhal to listen for the IR message of the
>> 'special' button. Then set the action to launch a program.
>
> Not really.
>
> I did the following:
>
> Installed xPLHAL Manager 1.53
> It can see my SqueezeBox in "xPL" devices so far.
>
> According to
> http://www.google.com/search?q=cache:vnYJSVMRfOwJ:www.xplproject.org.uk/modules.php%3Fop%3Dmodload%26name%3DSections%26fil e%3Dindex%26req%3Dprintpage%26artid%3D34+xpl+slims erver+execute+program&hl=de&gl=de&ct=clnk&cd=11
> saying
>
>> SlimServer's xPL interface can handle infra-red signals in a variety of
>> ways. By default, no xPL messages are sent when you press a button on
>> your remote control. To change this, do the following:
>>
>> - Open the xPLHal Manager and click on xPL Devices.
>>
>> - Your player(s) should be listed, along with any other xPL devices you
>> may have, in the right-hand window.
>>
>> - Double-click on the name of your player to bring up it's
>> configuration window.
>>
>> - Select infrared from the list of configurable items.
>>
>> - The value will probably be set to "none". Delete the current value,
>> and enter the word buttons
>>
>> - Click OK.
>>
>> Your player will now send an xPL message whenever you press a button on
>> it's remote control.
>>
>
> this does not work for me. Double clicking the player I get an error
> saying
> _No_information_is_currently_available_about_this_ device._This_device_has_not_issued_a_config.list_m essage,_therefore_xPLHal_is_not_aware_of_which_ite ms_can_be_cofigured_
> Looking at the integrated xPL Monitor, I can see messages from my
> SqueezeBox coming in.
>
> I'm using SlimServer 6.3.0 with SoftSqueeze 2.7 and a SqueezeBox v3
> with the latest firmware () installed.

In the slimserver web interface (http://127.0.0.1:9000)
Server settings --> plugins --> ensure xPL interface checkbox is ticked
and click on apply
Server settings --> plugins --> xpl settgins (at the bottom of page for
me) --> heartbeat interval 5, infra red processing raw

In xplhal help menu --> update plugin library --> select all --> ok

In xplhal load up tools menu --> xpl monitor
Press the down button on your remote (or whichever button you want to
activate the script)
I get the message in xpl monitor
trig slimdev-slimserv.BATHROOM
zone=slimserver
device=BATHROOM
keys=7689b04f
power=off

In xplhal
right click on 'determinatory' --> select new --> click next
type in name and description that you wish --> next
add button (this is your ocnditions upon script will be run)
select the slimdevices player e.g. for me slimdev-slimserv.bathroom
select button pressed
in 'button name'' box insert e.g. for the down key 7689b04f (taken from
xplmonitor output above)
click ok, then next
click on add button to add an action
select xpl-xplhal.<computername>
select run a program
type in the full path to the program e.g.
c:\WINNT\system32\notepad.exe or c:\windows\system32\notepad.exe

To test right click on the 'determinator' you have created and click
execute.
The program /will/ be executed. (have a look in task manager)
However if xplhal is running a a 'system service' (most likely) then the
program will hide in the background and will NOT display on screen.
This may or may not be what you want depending on what you are wanting
to execute.
e.g. running a command line program to shutdown your pc will not require
the program to come on screen.

However if you do require the program to load up on your desktop then try
http://www.xplmonkey.com/xplexec.html
(try installing it as a service, and then going into 'services' in
control pannel and making it run as your user account)

Hope this helps

gorstk
2006-07-16, 09:34
shen wrote:
> Kevin, I know the possibilities one has with these applications, but
> that's not the one for me :-)
>
> Back to the program I want to run: It's a simple commandline script
> (PHP) which sends it's output via telnet to the SB. So there's no need
> to stop this program.
>
> So let's say the SqueezeBox is turned off and with pressing the play
> button I want to start "php.exe my_script1.php" and with pressing stop
> "... my_script2.php" ... if I got you right this can be done with a
> plugin!? This would be my preferred solution - is there an example
> script for this?
>
> I'm getting closer - thanks so far :)
>
> Stefan

Will this do then?

http://www.deane-freeman.com/slimserver/

Execute script plugin

shen
2006-07-16, 12:15
In the slimserver web interface (http://127.0.0.1:9000)
Server settings --> plugins --> ensure xPL interface checkbox is ticked
and click on apply
Server settings --> plugins --> xpl settgins (at the bottom of page for
me) --> heartbeat interval 5, infra red processing raw

In xplhal help menu --> update plugin library --> select all --> ok

In xplhal load up tools menu --> xpl monitor
Press the down button on your remote (or whichever button you want to
activate the script)
I get the message in xpl monitor
trig slimdev-slimserv.BATHROOM
zone=slimserver
device=BATHROOM
keys=7689b04f
power=off

In xplhal
right click on 'determinatory' --> select new --> click next
type in name and description that you wish --> next
add button (this is your ocnditions upon script will be run)
select the slimdevices player e.g. for me slimdev-slimserv.bathroom
select button pressed
in 'button name'' box insert e.g. for the down key 7689b04f (taken from
xplmonitor output above)
click ok, then next
click on add button to add an action
select xpl-xplhal.<computername>
select run a program
type in the full path to the program e.g.
c:\WINNT\system32\notepad.exe or c:\windows\system32\notepad.exe

To test right click on the 'determinator' you have created and click
execute.
The program /will/ be executed. (have a look in task manager)
However if xplhal is running a a 'system service' (most likely) then the
program will hide in the background and will NOT display on screen.
This may or may not be what you want depending on what you are wanting
to execute.
e.g. running a command line program to shutdown your pc will not require
the program to come on screen.

However if you do require the program to load up on your desktop then try
http://www.xplmonkey.com/xplexec.html
(try installing it as a service, and then going into 'services' in
control pannel and making it run as your user account)

Hope this helps

You made my day - this works exactly as I need it. Many thanks :-)