PDA

View Full Version : run a script when an IR code received?



Jeff Shanholtz
2005-01-27, 21:35
I would like to have several buttons on my universal remote cause the
slimserver to execute a command. Is this possible? The closest I've come in
my searching around is the Execute plugin, but I don't want my commands to
execute on the events used in the plugin.

I'd prefer to tie the execution to a simple button press, but if there's a
plugin that will let me choose a command to run (from the menu), I could
live with that as well.

kdf
2005-01-27, 22:26
Quoting Jeff Shanholtz <jeffsubs (AT) shanholtz (DOT) com>:

> I would like to have several buttons on my universal remote cause the
> slimserver to execute a command. Is this possible? The closest I've come in
> my searching around is the Execute plugin, but I don't want my commands to
> execute on the events used in the plugin.
>
> I'd prefer to tie the execution to a simple button press, but if there's a
> plugin that will let me choose a command to run (from the menu), I could
> live with that as well.

you can navigate through the player UI to the execute plugin and select a script
to execute when you press PLAY.

-kdf

Jeff Shanholtz
2005-01-27, 23:07
On Thu, 27 Jan 2005 21:26:41 -0800, kdf wrote:

> you can navigate through the player UI to the execute plugin and select a script
> to execute when you press PLAY.

Really? Pressing play seems to activate the event-based execution as far as
I can tell. Remember, I don't want to execute a script when an "event" (as
your plugin defines it) occurs. I want to execute it ideally when an
otherwise unused button is pressed or at a minimum, when I tell it to
execute by navigating the (plugins) menu.

If it's still not quite clear, the script I want to run has NOTHING to do
with what my SB is doing. I just want to leverage the ability to customize
buttons in order to run a script that is unrelated to slim.

kdf
2005-01-27, 23:44
Quoting Jeff Shanholtz <jeffsubs (AT) shanholtz (DOT) com>:

> On Thu, 27 Jan 2005 21:26:41 -0800, kdf wrote:
>
> > you can navigate through the player UI to the execute plugin and select a
> script
> > to execute when you press PLAY.
>
> Really? Pressing play seems to activate the event-based execution as far as
> I can tell. Remember, I don't want to execute a script when an "event" (as
> your plugin defines it) occurs. I want to execute it ideally when an
> otherwise unused button is pressed or at a minimum, when I tell it to
> execute by navigating the (plugins) menu.


>
> If it's still not quite clear, the script I want to run has NOTHING to do
> with what my SB is doing. I just want to leverage the ability to customize
> buttons in order to run a script that is unrelated to slim.

yes, i got that. and what I'm saying is to set NO events. from the player UI,
NOT the web UI, navigate to Plugins, then Exectute, then pick an event...and a
script. moving up and down does SET the script to an event, but pressing PLAY
will execute that script immediately.

I can alter the plugin so that the event setting isn't saved when its not
wanted.

-kdf

Jeff Shanholtz
2005-01-28, 06:55
On Thu, 27 Jan 2005 22:44:30 -0800, kdf wrote:

> Quoting Jeff Shanholtz <jeffsubs (AT) shanholtz (DOT) com>:
>
>> On Thu, 27 Jan 2005 21:26:41 -0800, kdf wrote:
>>
>>> you can navigate through the player UI to the execute plugin and select a
>> script
>>> to execute when you press PLAY.
>>
>> Really? Pressing play seems to activate the event-based execution as far as
>> I can tell. Remember, I don't want to execute a script when an "event" (as
>> your plugin defines it) occurs. I want to execute it ideally when an
>> otherwise unused button is pressed or at a minimum, when I tell it to
>> execute by navigating the (plugins) menu.
>
>
>>
>> If it's still not quite clear, the script I want to run has NOTHING to do
>> with what my SB is doing. I just want to leverage the ability to customize
>> buttons in order to run a script that is unrelated to slim.
>
> yes, i got that. and what I'm saying is to set NO events. from the player UI,
> NOT the web UI, navigate to Plugins, then Exectute, then pick an event...and a
> script. moving up and down does SET the script to an event, but pressing PLAY
> will execute that script immediately.
>
> I can alter the plugin so that the event setting isn't saved when its not
> wanted.

I guess I misunderstood how to use it for this purpose then. I can try
that, but before I do that, I need to know where the scripts directory
should be. Unless I missed it, that's not really documented and nothing I
tried worked. Thanks.

P.S. I guess that means there is no way to just map a button to a script?
:(

Torgeir Veimo
2005-01-28, 06:59
On Fri, 2005-01-28 at 05:55 -0800, Jeff Shanholtz wrote:

> P.S. I guess that means there is no way to just map a button to a script?
> :(

You can also use a different remote than the squeezebox remote, by
enabling xpl remot control events, run an xpl hub on the computer where
the slimserver is running, executing whatever scripts you desire.

--
Torgeir Veimo <torgeir (AT) pobox (DOT) com>

Aaron Zinck
2005-01-28, 08:51
The scripts directory needs to be created in the slimserver Bin directory.
However, I still haven't been successful in getting this plugin to work. My
woes are documented here:
http://lists.slimdevices.com/archives/discuss/2004-December/040205.html

Any more suggestions on getting this to work for me (I'm running slimserver
as a service in win2k) would be greatly appreciated.


"Jeff Shanholtz" <jeffsubs (AT) shanholtz (DOT) com> wrote in
message news:1sddwr560qx98$.14y6el0gsvvdg$.dlg (AT) 40tude (DOT) net...
> On Thu, 27 Jan 2005 22:44:30 -0800, kdf wrote:
>
> > Quoting Jeff Shanholtz
<jeffsubs (AT) shanholtz (DOT) com>:
> >
> >> On Thu, 27 Jan 2005 21:26:41 -0800, kdf wrote:
> >>
> >>> you can navigate through the player UI to the execute plugin and
select a
> >> script
> >>> to execute when you press PLAY.
> >>
> >> Really? Pressing play seems to activate the event-based execution as
far as
> >> I can tell. Remember, I don't want to execute a script when an "event"
(as
> >> your plugin defines it) occurs. I want to execute it ideally when an
> >> otherwise unused button is pressed or at a minimum, when I tell it to
> >> execute by navigating the (plugins) menu.
> >
> >
> >>
> >> If it's still not quite clear, the script I want to run has NOTHING to
do
> >> with what my SB is doing. I just want to leverage the ability to
customize
> >> buttons in order to run a script that is unrelated to slim.
> >
> > yes, i got that. and what I'm saying is to set NO events. from the
player UI,
> > NOT the web UI, navigate to Plugins, then Exectute, then pick an
event...and a
> > script. moving up and down does SET the script to an event, but
pressing PLAY
> > will execute that script immediately.
> >
> > I can alter the plugin so that the event setting isn't saved when its
not
> > wanted.
>
> I guess I misunderstood how to use it for this purpose then. I can try
> that, but before I do that, I need to know where the scripts directory
> should be. Unless I missed it, that's not really documented and nothing I
> tried worked. Thanks.
>
> P.S. I guess that means there is no way to just map a button to a script?
> :(

kdf
2005-01-28, 10:36
Quoting Jeff Shanholtz <jeffsubs (AT) shanholtz (DOT) com>:

> On Thu, 27 Jan 2005 22:44:30 -0800, kdf wrote:
>
> > Quoting Jeff Shanholtz <jeffsubs (AT) shanholtz (DOT) com>:
> >
> >> On Thu, 27 Jan 2005 21:26:41 -0800, kdf wrote:
> >>
> >>> you can navigate through the player UI to the execute plugin and select a
> >> script
> >>> to execute when you press PLAY.
> >>
> >> Really? Pressing play seems to activate the event-based execution as far
> as
> >> I can tell. Remember, I don't want to execute a script when an "event" (as
> >> your plugin defines it) occurs. I want to execute it ideally when an
> >> otherwise unused button is pressed or at a minimum, when I tell it to
> >> execute by navigating the (plugins) menu.
> >
> >
> >>
> >> If it's still not quite clear, the script I want to run has NOTHING to do
> >> with what my SB is doing. I just want to leverage the ability to customize
> >> buttons in order to run a script that is unrelated to slim.
> >
> > yes, i got that. and what I'm saying is to set NO events. from the player
> UI,
> > NOT the web UI, navigate to Plugins, then Exectute, then pick an
> event...and a
> > script. moving up and down does SET the script to an event, but pressing
> PLAY
> > will execute that script immediately.
> >
> > I can alter the plugin so that the event setting isn't saved when its not
> > wanted.
>
> I guess I misunderstood how to use it for this purpose then. I can try
> that, but before I do that, I need to know where the scripts directory
> should be. Unless I missed it, that's not really documented and nothing I
> tried worked. Thanks.

The website mentions that you have to edit the module to point to your scripts.
however, by default it tries directory called scripts in the same place as
slim.exe or slimserver.pl.

> P.S. I guess that means there is no way to just map a button to a script?
> :(

not in the Execute plugin, but there are other ways. I'm just not familiar with
them.

-kdf

kdf
2005-01-28, 10:38
Quoting Aaron Zinck <azinck3 (AT) ufl (DOT) edu>:

> The scripts directory needs to be created in the slimserver Bin directory.
> However, I still haven't been successful in getting this plugin to work. My
> woes are documented here:
> http://lists.slimdevices.com/archives/discuss/2004-December/040205.html
>
> Any more suggestions on getting this to work for me (I'm running slimserver
> as a service in win2k) would be greatly appreciated.

did you activate the plugin from the player UI? It should only start triggering
events if you have done this. also, try turning on d_stdio to see the output
from the event tracker and script execution.

-kdf

Aaron Zinck
2005-01-28, 13:00
Yes, I did activate the plugin from the player UI. As I mentioned in my
last post in this thread:
http://lists.slimdevices.com/archives/discuss/2004-December/040205.html
I have it working to the point where, when one of the events occurs the
squeezebox displays that it's running the desired script, but the script
never actually seems to run. When I get back home this evening I'll try it
out and shoot you that log info. Thanks for your help.


"kdf" <slim-mail (AT) deane-freeman (DOT) com> wrote in
message news:1106933937.41fa78b1287b5 (AT) callisto (DOT) deane-freeman.com...
Quoting Aaron Zinck <azinck3 (AT) ufl (DOT) edu>:

> The scripts directory needs to be created in the slimserver Bin directory.
> However, I still haven't been successful in getting this plugin to work.
My
> woes are documented here:
> http://lists.slimdevices.com/archives/discuss/2004-December/040205.html
>
> Any more suggestions on getting this to work for me (I'm running
slimserver
> as a service in win2k) would be greatly appreciated.

did you activate the plugin from the player UI? It should only start
triggering
events if you have done this. also, try turning on d_stdio to see the output
from the event tracker and script execution.

-kdf

kdf
2005-01-28, 13:49
Quoting Aaron Zinck <azinck3 (AT) ufl (DOT) edu>:

> Yes, I did activate the plugin from the player UI. As I mentioned in my
> last post in this thread:
> http://lists.slimdevices.com/archives/discuss/2004-December/040205.html
> I have it working to the point where, when one of the events occurs the
> squeezebox displays that it's running the desired script, but the script
> never actually seems to run. When I get back home this evening I'll try it
> out and shoot you that log info. Thanks for your help.
>
no problem. I haven't actually used the plugin in a very long time myself, so it
could easily have been broken along the way somewhere. I'll take a look at it
when you send off the log.

-kdf

Jeff Shanholtz
2005-01-29, 00:08
On Fri, 28 Jan 2005 12:49:33 -0800, kdf wrote:

> Quoting Aaron Zinck <azinck3 (AT) ufl (DOT) edu>:
>
>> Yes, I did activate the plugin from the player UI. As I mentioned in my
>> last post in this thread:
>> http://lists.slimdevices.com/archives/discuss/2004-December/040205.html
>> I have it working to the point where, when one of the events occurs the
>> squeezebox displays that it's running the desired script, but the script
>> never actually seems to run. When I get back home this evening I'll try it
>> out and shoot you that log info. Thanks for your help.
>>
> no problem. I haven't actually used the plugin in a very long time myself, so it
> could easily have been broken along the way somewhere. I'll take a look at it
> when you send off the log.

I'm having the same problem as Aaron, yet I'm running in linux. Here's the
log info you requested:

2005-01-28 23:04:24.9691 path: /usr/local/slimserver/scripts
2005-01-28 23:04:24.9696 file: /usr/local/slimserver/scripts/Lights - Movie
Settings
2005-01-28 23:04:24.9698 Executing: /usr/local/slimserver/scripts/Lights -
Movie Settings

I see on the display that it is supposedly executing the script, yet it
doesn't. And in case it's somehow privileges related, here's the ls info on
my scripts:

-rwxr--r-- 1 slimserver slimserver 46 Jan 28 11:01 Lights - Movie
Settings
-rwxr--r-- 1 slimserver slimserver 38 Jan 28 11:04 Lights - Off
-rwxr--r-- 1 slimserver slimserver 52 Jan 28 11:03 Lights - On
Full

kdf
2005-01-29, 07:48
Quoting Jeff Shanholtz <jeffsubs (AT) shanholtz (DOT) com>:

> On Fri, 28 Jan 2005 12:49:33 -0800, kdf wrote:
>
> > Quoting Aaron Zinck <azinck3 (AT) ufl (DOT) edu>:
> >
> >> Yes, I did activate the plugin from the player UI. As I mentioned in my
> >> last post in this thread:
> >> http://lists.slimdevices.com/archives/discuss/2004-December/040205.html
> >> I have it working to the point where, when one of the events occurs the
> >> squeezebox displays that it's running the desired script, but the script
> >> never actually seems to run. When I get back home this evening I'll try
> it
> >> out and shoot you that log info. Thanks for your help.
> >>
> > no problem. I haven't actually used the plugin in a very long time myself,
> so it
> > could easily have been broken along the way somewhere. I'll take a look at
> it
> > when you send off the log.
>
> I'm having the same problem as Aaron, yet I'm running in linux. Here's the
> log info you requested:
>
> 2005-01-28 23:04:24.9691 path: /usr/local/slimserver/scripts
> 2005-01-28 23:04:24.9696 file: /usr/local/slimserver/scripts/Lights - Movie
> Settings
> 2005-01-28 23:04:24.9698 Executing: /usr/local/slimserver/scripts/Lights -
> Movie Settings
>
> I see on the display that it is supposedly executing the script, yet it
> doesn't. And in case it's somehow privileges related, here's the ls info on
> my scripts:
>
> -rwxr--r-- 1 slimserver slimserver 46 Jan 28 11:01 Lights - Movie
> Settings
> -rwxr--r-- 1 slimserver slimserver 38 Jan 28 11:04 Lights - Off
> -rwxr--r-- 1 slimserver slimserver 52 Jan 28 11:03 Lights - On
> Full


Probably a dumb question...are you running the server as user:group
slimserver:slimserver?
-kdf

Jeff Shanholtz
2005-01-29, 08:45
On Sat, 29 Jan 2005 06:48:21 -0800, kdf wrote:

> Quoting Jeff Shanholtz <jeffsubs (AT) shanholtz (DOT) com>:
>
>> On Fri, 28 Jan 2005 12:49:33 -0800, kdf wrote:
>>
>>> Quoting Aaron Zinck <azinck3 (AT) ufl (DOT) edu>:
>>>
>>>> Yes, I did activate the plugin from the player UI. As I mentioned in my
>>>> last post in this thread:
>>>> http://lists.slimdevices.com/archives/discuss/2004-December/040205.html
>>>> I have it working to the point where, when one of the events occurs the
>>>> squeezebox displays that it's running the desired script, but the script
>>>> never actually seems to run. When I get back home this evening I'll try
>> it
>>>> out and shoot you that log info. Thanks for your help.
>>>>
>>> no problem. I haven't actually used the plugin in a very long time myself,
>> so it
>>> could easily have been broken along the way somewhere. I'll take a look at
>> it
>>> when you send off the log.
>>
>> I'm having the same problem as Aaron, yet I'm running in linux. Here's the
>> log info you requested:
>>
>> 2005-01-28 23:04:24.9691 path: /usr/local/slimserver/scripts
>> 2005-01-28 23:04:24.9696 file: /usr/local/slimserver/scripts/Lights - Movie
>> Settings
>> 2005-01-28 23:04:24.9698 Executing: /usr/local/slimserver/scripts/Lights -
>> Movie Settings
>>
>> I see on the display that it is supposedly executing the script, yet it
>> doesn't. And in case it's somehow privileges related, here's the ls info on
>> my scripts:
>>
>> -rwxr--r-- 1 slimserver slimserver 46 Jan 28 11:01 Lights - Movie
>> Settings
>> -rwxr--r-- 1 slimserver slimserver 38 Jan 28 11:04 Lights - Off
>> -rwxr--r-- 1 slimserver slimserver 52 Jan 28 11:03 Lights - On
>> Full
>
>
> Probably a dumb question...are you running the server as user:group
> slimserver:slimserver?
> -kdf

I assume so; I used the RPM and all the other slimserver files are
slimserver:slimserver! :)

Joe Moon
2005-01-29, 11:26
On Jan 29, 2005, at 9:45 AM, Jeff Shanholtz wrote:
>>>>
>>>
>>> I'm having the same problem as Aaron, yet I'm running in linux.
>>> Here's the
>>> log info you requested:
>>>
>>> 2005-01-28 23:04:24.9691 path: /usr/local/slimserver/scripts
>>> 2005-01-28 23:04:24.9696 file: /usr/local/slimserver/scripts/Lights
>>> - Movie
>>> Settings
>>> 2005-01-28 23:04:24.9698 Executing:
>>> /usr/local/slimserver/scripts/Lights -
>>> Movie Settings
>>>
>>> I see on the display that it is supposedly executing the script, yet
>>> it
>>> doesn't. And in case it's somehow privileges related, here's the ls
>>> info on
>>> my scripts:
>>>
>>> -rwxr--r-- 1 slimserver slimserver 46 Jan 28 11:01 Lights -
>>> Movie
>>> Settings
>>> -rwxr--r-- 1 slimserver slimserver 38 Jan 28 11:04 Lights -
>>> Off
>>> -rwxr--r-- 1 slimserver slimserver 52 Jan 28 11:03 Lights -
>>> On
>>> Full
>>
>>
>> Probably a dumb question...are you running the server as user:group
>> slimserver:slimserver?
>> -kdf
>
> I assume so; I used the RPM and all the other slimserver files are
> slimserver:slimserver! :)
>
1. Have you tried 'chmod a+x' on the scripts?
2. Do your script names really have space characters in them? This
will cause a problem in your shell, unless they're quoted.

--Joe

kdf
2005-01-29, 18:18
Quoting Joe Moon <joe (AT) moonzone (DOT) net>:


> >>> -rwxr--r-- 1 slimserver slimserver 46 Jan 28 11:01 Lights -
> >>> Movie
> >>> Settings
> >>> -rwxr--r-- 1 slimserver slimserver 38 Jan 28 11:04 Lights -
> >>> Off
> >>> -rwxr--r-- 1 slimserver slimserver 52 Jan 28 11:03 Lights -
> >>> On
> >>> Full
> >>
> >>
> >> Probably a dumb question...are you running the server as user:group
> >> slimserver:slimserver?
> >> -kdf
> >
> > I assume so; I used the RPM and all the other slimserver files are
> > slimserver:slimserver! :)
> >
> 1. Have you tried 'chmod a+x' on the scripts?
> 2. Do your script names really have space characters in them? This
> will cause a problem in your shell, unless they're quoted.

good point! I'm spending too much time on windows machines. Those spaces will
definitely pose a problem. I'll see what I can do about fixing the plugin to
handle it.

-kdf

kdf
2005-01-29, 18:49
I've posted an upgraded version of the Execute Plugin so it should handle
scripts with spaces in the filenames a bit better.
http://www.deane-freeman.com/slimserver/
-kdf