Looking for suggestions:
I have an X10 remote that connects to the serial port. I have a Perl
script (mouseremote.pl) that listens to the serial port and maps
keystrokes to commands that are issued via a system() call.
For example, I have the remote run these commands when in "CD" mode to
control xmms:
[CD]
Power xmms&
.VolUp xmms-shell -e 'upvolume 2'
.VolDown xmms-shell -e 'downvolume 2'
FF xmms-shell -e next
Pause xmms-shell -e pause
Play xmms-shell -e play
Rew xmms-shell -e previous
ab xmms-shell -e 'shuffle ON'
Disp xmms-shell -e 'shuffle OFF'
Stop xmms-shell -e stop
Mute xmms-shell -e pause
Is there a utility available to send commands to the slimserver via
a system call? I know I can connect to port 9090 -- but I'm wondering if
there's already a program available that will work with my existing
setup.
Thanks,
--
Bill Moseley
moseley (AT) hank (DOT) org
Results 1 to 7 of 7
Hybrid View
-
2005-05-11, 15:48 #1Bill MoseleyGuest
Command Line interface - X10 Remote
-
2005-05-11, 17:28 #2bill fumerolaGuest
Command Line interface - X10 Remote
On Wed, May 11, 2005 at 03:48:36PM -0700, Bill Moseley wrote:
> Is there a utility available to send commands to the slimserver via
> a system call? I know I can connect to port 9090 -- but I'm wondering if
> there's already a program available that will work with my existing
> setup.
you could use netcat[1] to simplify sending commands to tcp/9090.
-- bill
1. http://public.www.planetmirror.com/p...tcat/nc110.tgz
-
2005-05-11, 18:00 #3
I use the following little perl script to tell my slimserver to do a rescan whenever I sync new music onto it, you may be able to adapt it to your needs.
Code:use IO::Socket; $server="servername"; $port=9090; print "Connecting to SlimServer at ".$server.":".$port."...\n"; $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $server, PeerPort => $port, ) or die "ERROR: Cannot connect to SlimServer"; $remote->autoflush(1); print $remote "rescan\n"; $response = <$remote>; $response == "rescan" || die "ERROR: Bad response from SlimServer : $response\n"; print $remote "exit\n"; close $remote; print "SlimServer is rescanning the music library\n"; exit;
-
2005-05-11, 18:34 #4Bill MoseleyGuest
Re: Command Line interface - X10 Remote
On Wed, May 11, 2005 at 06:00:08PM -0700, radish wrote:
>
> I use the following little perl script to tell my slimserver to do a
> rescan whenever I sync new music onto it, you may be able to adapt it
> to your needs.
Thanks. I'll give it a try.
> $response == "rescan" || die "ERROR: Bad response from SlimServer : $response\n";
BTW - I think you want "eq" not "==".
--
Bill Moseley
moseley (AT) hank (DOT) org
-
2005-05-12, 12:34 #5You're right - thanks!
Originally Posted by Bill Moseley
Can you tell I'm not a professional perl coder?
-
2006-01-22, 15:54 #6Junior Member
- Join Date
- Jul 2005
- Posts
- 26
Thanks for that ! I've added the script to my transfer script.
Originally Posted by radish
I had to add
for the response test to work.Code:chomp $response;
-
2005-05-12, 15:14 #7John GorstGuest
Command Line interface - X10 Remote
Bill Moseley wrote:
> Looking for suggestions:
>
> I have an X10 remote that connects to the serial port. I have a Perl
> script (mouseremote.pl) that listens to the serial port and maps
> keystrokes to commands that are issued via a system() call.
>
> For example, I have the remote run these commands when in "CD" mode to
> control xmms:
>
> [CD]
> Power xmms&
> .VolUp xmms-shell -e 'upvolume 2'
> .VolDown xmms-shell -e 'downvolume 2'
> FF xmms-shell -e next
> Pause xmms-shell -e pause
> Play xmms-shell -e play
> Rew xmms-shell -e previous
> ab xmms-shell -e 'shuffle ON'
> Disp xmms-shell -e 'shuffle OFF'
> Stop xmms-shell -e stop
> Mute xmms-shell -e pause
>
> Is there a utility available to send commands to the slimserver via
> a system call? I know I can connect to port 9090 -- but I'm wondering if
> there's already a program available that will work with my existing
> setup.
Enable XPL interface in server setup.
Go to www.xplproject.org.uk
Download the perl xpl command line sender and hub
You can then have you perl script send xpl messages by using the xplsend
perl script. Slimserver will recieve the xpl messages and act on them
(e.e. fast forward, stop etc).
You cna find info on slimserver and xpl on the help section of the
slimserver web interface.
HTH

Reply With Quote
