Marple stands for Minerva Appliance Routing & ProtocoL Engine. This is a mechanism whereby you can control a TV card, media player, etc on one machine while utilizing an interface on another. This interface might be through any of the standard conduits, such as command line, web interface, or RF Cosmic.
Marple was introduced in Minerva
Marple utilizes a globally accessible list of devices and address on one central machine, along with the protocols available to control them. The devices do not need to know about which protocol, or device, is used, so if the global list specifies a CD player on machine 192.168.1.3 then, provided that machine agrees to let its CD player get used, you can send commands via Marple.
Currently Marple supports direct device control with SOAP packets. XAP/XPL and upnp is planned for the future.
The first file in which Marple looks to determine the address of the device is
minerva/etc/devices. There is one directory for each device, e.g.
cdplayer, x10, and so on. In each this directory is a file called devlist
which is formatted thus:
localhost dev /dev/dsp - -
default dev /dev/dsp - -
bedroom soap 192.168.1.123 19781 localhost
The columns are, in order:
- The device name, as used in cdplayer bedroom play 1
- Protocol type. Currently may be 'dev' or 'soap'.
- If the protocol is 'dev', then this represents a Linux-style style on the lo
cal machine. If it's 'soap', then it specifics the IP address of the machine to
- The port number associated with the IP address. This is unused for 'dev' protocols.
- The device name on the remote device. This is unused for 'dev' protocols.
The currently provided devices are:
- say (also used by announce)
Marple will look for a matching device name in the first column of the minerva/etc/devices file. If it finds one, it will either:
In the second case, the same command is sent to the remote machine, with the exception of the device name, which is replaced with that from the fourth column.
- Call the underlying Bearskin-wrappered program with the device name (if a device is given)
- Or send a network packet (e.g. soap) to the machine, for further processing.
If the device name can not be found (on either machine), then the second device list file is used. This file is stored in minerva/house/marple. It has the same format as the above file. If the device still can't be found then the original device name is passed to the bearskin script to see if it can understand it.
To take advantage of Marple, and send command using protocols other than SOAP (e.g. upnp) then you simply need toamend the minerva/bin/xmit directory
to include a directory name which matches that present in the devlist file.
Inside this directory you need to place a file called cmd. This will
be automatically called when a remote request is needed. The first two
arguments are the IP and port given in devlist. The remainder represent
a command in standard Bearskin format.
Note: if your device is not address by ip/port then you can re-appropriate
them to your desires.
For Marple to be used by Bearskin, each script needs to feature the following call to finddev:
# Reference usage for finddev...
# We've sent (and presumably rcv'd) a request from the finddev call
# 1. DEVICE is actually the output from that command, which we might
# need and so reflect to the calling command.
# 2. We exit now with a code of '0'. All Bearskin commands must check
# for 0. If they receive it, they must also exit immediately.
DEVICE=`$MINBIN/finddev mixer $*`
if [ $? == 0 ]; then
All the Bearskin commands provided feature this code.
The CD player program cdcd requires $HOME to be set, so rigging up a stand-alone machine to process SOAP requests for the CD player need an extra line of code.
By Abstracting the devices in this way allows you to create a device called 'bedroom'. Each specific device in the bedroom can then be controlled by a different machine, if desired.