Squeezebox

From MiOS
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
Displaying cover art for the current song
+
== Displaying cover art for the current song ==
  
 +
1. Create new camera device(s) for the room(s) equipped with Squeezebox(es)
  
Create new camera device(s) for the room(s) equipped with Squeezebox(es)
+
2. Configure the new camera device(s):
 +
*'''IP address:''' IP address and port of your Squeezebox Server (<ip address>:<port number>)
 +
*'''Path:''' music/current/cover.jpg?player=<MAC address> (replace <MAC address> with the MAC address of the player; IP address should work too)
  
Configure the new camera device(s):
 
  
    * IP address: IP address and port of your Squeezebox Server (<ip address>:<port number>)
+
== Using the SBS CLI ==
    * Path: music/current/cover.jpg?player=<MAC address>
+
      (replace <MAC address> with the MAC address of the player; IP address should work too)
+
  
 +
=== Luup/Lua skeleton ===
  
Using the SBS CLI
+
socket=require('socket')
 +
local client = socket.connect('<IP address of SBS>', 9090)
 +
client:send("<CLI command>\n")
 +
local result=client:receive()
 +
...
  
Luup/Lua skeleton
+
For a list of valid <CLI command> navigate to: SBS's Home / Technical Information / Help / Command Line Interface
  
socket=require('socket')
+
=== Some examples for <CLI command> ===
client = socket.connect('<IP address of SBS>', 9090)
+
client:send("<CLI command>\n")
+
result=client:receive()
+
...
+
  
For a list of valid <CLI command> navigate to SBS's Home / Technical Information / Help / Command Line Interface
+
<duration> does not work for Squeezebox Radio due to [http://bugs.slimdevices.com/show_bug.cgi?id=15749 Slimdevices bug #15749].
  
Some examples for <CLI command>
+
==== Displaying text ====
  
Displaying text
+
Syntax:  
<MAC address of player> display <line1> <line2> <duration>
+
client:send("00:04:20:XX:XX:XX display Hello%20World%201 Hello%20World%202 10\n")
+
  
Note: IIRC, <duration> does not work for Squeezebox Radio
+
<MAC address of player> display <line1> <line2> <duration>
  
'Pressing' a button on the remote
+
Example:
<MAC address of player> button <buttoncode>
+
client:send("00:04:20:XX:XX:XX button brightness_toggle\n")
+
client:send("00:04:20:XX:XX:XX button volume_up\n")
+
client:send("00:04:20:XX:XX:XX button volume_down\n")
+
  
<buttoncode> as defined in Default.map;
+
client:send("00:04:20:XX:XX:XX display Hello%20World%201 Hello%20World%202 10\n")
telnet to your SBS port 9090, type 'subscribe button' (without quotes),
+
press <RETURN>, press the buttons of the remote to get the buttoncodes
+
  
Skipping to the previous/next track
+
==== 'Pressing' a button on the Squeezebox remote ====
<MAC address of player> playlist index <index|+index|-index|?> <fadeInSecs>
+
client:send("00:04:20:XX:XX:XX playlist index -1\n")
+
client:send("00:04:20:XX:XX:XX playlist index +1\n")
+
  
Pause/Unpause playing
+
Syntax:
<MAC address of player> pause <0|1|>  <fadeInSecs>  <suppressShowBriefly> 
+
client:send("00:04:20:XX:XX:XX pause\n")
+
  
Changing the volume level
+
<MAC address of player> button <buttoncode>
<MAC address of player> mixer volume <0 .. 100|-100 .. +100|?>
+
client:send("00:04:20:XX:XX:XX mixer volume +10\n")
+
client:send("00:04:20:XX:XX:XX mixer volume -10\n")
+
  
 +
Example:
  
Sending IR codes (SB2/3 and Transporter)
+
client:send("00:04:20:XX:XX:XX button brightness_toggle\n")
 +
client:send("00:04:20:XX:XX:XX button volume_up\n")
 +
client:send("00:04:20:XX:XX:XX button volume_down\n")
  
1. Plug an IR transmitter into the phones jack of your Squeezebox/Transporter.
+
<buttoncode> as defined in Default.map; telnet to your SBS port 9090, type 'subscribe button' (without quotes), press <RETURN>, press the buttons of the remote to get the buttoncodes.
2. Install IRBlaster (http://www.gwendesign.com/slimserver/dev_hard_and_software.htm#irblaster,
+
  http://wiki.slimdevices.com/index.php/IRBlaster)
+
3. Install the IR remote files for the IR devices you are going to control (http://lirc.sourceforge.net/remotes/)
+
  or use the IR Learning Wizard (part of IRBlaster) to record the codes of your remote.
+
4. Reboot your SBS.
+
  
Now you are ready to send IR codes from Lua (adjust SBS_IP_address, SBS_CLI_port, playerid, remote_name,
+
==== Skipping to the previous/next track ====
and command_name accordingly):
+
  
socket=require('socket')
+
Syntax:
 +
 +
<MAC address of player> playlist index <index|+index|-index|?> <fadeInSecs>
  
local SBS_IP_address = '192.168.178.22'
+
Example:
local SBS_CLI_port  = 9090
+
local playerid     = '00:04:20:XX:XX:XX'
+
local remote_name    = 'Onkyo_RC-738M' -- as defined in the LIRC configuration file for this remote
+
local command_name  = 'PWR'          -- as defined in thr LIRC configuration file for this remote
+
  
local client = socket.connect( SBS_IP_address, SBS_CLI_port )
+
client:send("00:04:20:XX:XX:XX playlist index -1\n")
 +
client:send("00:04:20:XX:XX:XX playlist index +1\n")
  
function sendIR( device_MAC, remote, command )
+
==== Pause/Unpause playing ====
  
client:send( device_MAC .. ' irblaster ' .. remote .. ' ' .. command )
+
Syntax:  
client:receive()
+
  
end
+
<MAC address of player> pause <0|1|>  <fadeInSecs>  <suppressShowBriefly> 
 +
 
 +
Example:
 +
 
 +
client:send("00:04:20:XX:XX:XX pause\n")
 +
 
 +
==== Changing the volume level ====
 +
 
 +
Syntax:
 +
 +
<MAC address of player> mixer volume <0 .. 100|-100 .. +100|?>
 +
 +
Example:
 +
 
 +
client:send("00:04:20:XX:XX:XX mixer volume +10\n")
 +
client:send("00:04:20:XX:XX:XX mixer volume -10\n")
 +
 
 +
== Sending IR codes (SB2/3 and Transporter) ==
 +
 
 +
[http://wiki.slimdevices.com/index.php/IRBlaster Theory of operation]
 +
 
 +
1. Plug an IR transmitter into the phones jack of your Squeezebox/Transporter.
 +
 
 +
2. Install [http://www.gwendesign.com/slimserver/dev_hard_and_software.htm#irblaster IRBlaster].
 +
 
 +
3. Install the [http://lirc.sourceforge.net/remotes/ IR remote files] for the IR devices you are going to control
 +
or use the IR Learning Wizard (part of IRBlaster) to record the codes of your remote.
 +
 
 +
4. Restart your SBS.
 +
 
 +
Now you are ready to send IR codes via Lua (adjust SBS_IP_address, SBS_CLI_port, playerid, remote_name,
 +
and command_name accordingly):
  
sendIR( playerid, remote_name, command_name )
+
socket=require('socket')
 +
&nbsp;
 +
local SBS_IP_address = '192.168.178.22'
 +
local SBS_CLI_port  = 9090
 +
local playerid     = '00:04:20:XX:XX:XX'
 +
local remote_name    = 'Onkyo_RC-738M' -- as defined in the LIRC configuration file for this remote
 +
local command_name  = 'PWR'          -- as defined in thr LIRC configuration file for this remote
 +
&nbsp;
 +
local client = socket.connect( SBS_IP_address, SBS_CLI_port )
 +
&nbsp;
 +
function sendIR( device_MAC, remote, command )
 +
&nbsp;
 +
  client:send( device_MAC .. ' irblaster ' .. remote .. ' ' .. command )
 +
  client:receive()
 +
&nbsp;
 +
end
 +
&nbsp;
 +
sendIR( playerid, remote_name, command_name )

Revision as of 17:45, 1 June 2010

Contents

Displaying cover art for the current song

1. Create new camera device(s) for the room(s) equipped with Squeezebox(es)

2. Configure the new camera device(s):

  • IP address: IP address and port of your Squeezebox Server (<ip address>:<port number>)
  • Path: music/current/cover.jpg?player=<MAC address> (replace <MAC address> with the MAC address of the player; IP address should work too)


Using the SBS CLI

Luup/Lua skeleton

socket=require('socket')
local client = socket.connect('<IP address of SBS>', 9090)
client:send("<CLI command>\n")
local result=client:receive()
...

For a list of valid <CLI command> navigate to: SBS's Home / Technical Information / Help / Command Line Interface

Some examples for <CLI command>

<duration> does not work for Squeezebox Radio due to Slimdevices bug #15749.

Displaying text

Syntax:

<MAC address of player> display <line1> <line2> <duration>

Example:

client:send("00:04:20:XX:XX:XX display Hello%20World%201 Hello%20World%202 10\n")

'Pressing' a button on the Squeezebox remote

Syntax:

<MAC address of player> button <buttoncode>

Example:

client:send("00:04:20:XX:XX:XX button brightness_toggle\n")
client:send("00:04:20:XX:XX:XX button volume_up\n")
client:send("00:04:20:XX:XX:XX button volume_down\n")

<buttoncode> as defined in Default.map; telnet to your SBS port 9090, type 'subscribe button' (without quotes), press <RETURN>, press the buttons of the remote to get the buttoncodes.

Skipping to the previous/next track

Syntax:

<MAC address of player> playlist index <index|+index|-index|?> <fadeInSecs>

Example:

client:send("00:04:20:XX:XX:XX playlist index -1\n")
client:send("00:04:20:XX:XX:XX playlist index +1\n")

Pause/Unpause playing

Syntax:

<MAC address of player> pause <0|1|>  <fadeInSecs>  <suppressShowBriefly>  

Example:

client:send("00:04:20:XX:XX:XX pause\n")

Changing the volume level

Syntax:

<MAC address of player> mixer volume <0 .. 100|-100 .. +100|?>

Example:

client:send("00:04:20:XX:XX:XX mixer volume +10\n")
client:send("00:04:20:XX:XX:XX mixer volume -10\n")

Sending IR codes (SB2/3 and Transporter)

Theory of operation

1. Plug an IR transmitter into the phones jack of your Squeezebox/Transporter.

2. Install IRBlaster.

3. Install the IR remote files for the IR devices you are going to control or use the IR Learning Wizard (part of IRBlaster) to record the codes of your remote.

4. Restart your SBS.

Now you are ready to send IR codes via Lua (adjust SBS_IP_address, SBS_CLI_port, playerid, remote_name, and command_name accordingly):

socket=require('socket')
 
local SBS_IP_address = '192.168.178.22'
local SBS_CLI_port   = 9090
local playerid 	     = '00:04:20:XX:XX:XX'
local remote_name    = 'Onkyo_RC-738M' -- as defined in the LIRC configuration file for this remote
local command_name   = 'PWR'           -- as defined in thr LIRC configuration file for this remote
 
local client = socket.connect( SBS_IP_address, SBS_CLI_port ) 
 
function sendIR( device_MAC, remote, command )
 
 client:send( device_MAC .. ' irblaster ' .. remote .. ' ' .. command )
 client:receive()
 
end
 
sendIR( playerid, remote_name, command_name )
Personal tools