Get Started on Mac Os - XPLProject



Mac OS users can use xPL4Java out of the box on their machines, as Java is already installed. Other alternatives are xPL Perl and Python.

Getting xPL Perl Running


You can download xPL Perl from its trac site. Download the tar.gz file. You can also download a PDF documentation about the scripts and the libraries.

As you are in the download phase, take the opportunity to fetch the Device Configuration Manager (DCM) from the xPL4Java site.


You will need the Apple xCode tools to run the make command. Install them from the Mac OS X install CD.

On the desktop, create the folder xPL and move your downloads into that folder.

Start the Terminal and

cd ~/Desktop/xPL/
tar -xvf xPL-Perl-*.tar.gz
cd xPL-Perl-*
perl Makefile.PL

At this point you might see warnings telling that one or more Perl modules are missing. Install them using the standard CPAN method.

For example, if you have the message:

Warning: prerequisite Date::Parse 0 not found.

You should run:

sudo perl -MCPAN -e 'install Date::Parse'

Once you have no more warning, continue the xPL-Perl installation:

make test
sudo make install
tar -xvf DCM.tgz

With this, you have the Perl scripts located in /usr/local/bin/xpl-* or in in /usr/bin/xpl-*, and the Device Configuration Manager in ~/Desktop/xPL/Desktop/DCM/DCM.jar. You might want to move this last one to some more convenient place such as /Applications.

If you plan to use xpl-dawndusk which sends dawn and dusk xpl-trig messages, you will have to install the Perl DateTime::Event::Sunrise module:

sudo perl -MCPAN -e 'install DateTime::Event::Sunrise'


Let's test the current scripts.

The very first thing we need in an xPL system is a hub. There should be a single one in you local network, so turn any other one off. Launch it in the Terminal:

xpl-hub -v

The -v (verbose) option will show you any discovered or removed xPL client.

Open a second Terminal window and

xpl-logger -v

As you can imagine, the logger will display all the xPL messages forwarded by the hub.

Open a third Terminal window and

xpl-clock -v --tick_interval 5

The xpl-logger should show the clock tick messages every 5 seconds, and other ones such as its own heart beats.

The xpl-hub should show the xPL applications: bnz-listener and bnz-clock. If you quit these, xpl-hub will reflect the changes after some time.

Start DCM.jar and check if you see the bnz>listener and bnz>clock clients. You can also have a look at the log tab.

Start xPL at boot

Mac OS X defines 2 ways of launching daemons:

  • with Mac OS X v10.3 and earlier, you must use startup items
  • from Mac OS X v10.4, the preferred method is to use launchd daemons

Why not use the most recent technique? Having the necessary privileges, create the Launchd Property List File /Library/LaunchDaemons/xPL.plist with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Here the username has been given as control. I have created this user with limited privileges. Replace the name with any other existing user's.

Reboot the Mac and check if xpl-hub is running:

 ps ax | grep hub | grep -v grep

or, as root:

 launchctl list | grep xPL

Restart the daemon with:

 launchctl stop xPL

Stop the daemon with:

 launchctl remove xPL

Start the daemon with:

 launchctl load /Library/LaunchDaemons/xPL.plist
This page was last modified on 13 March 2010, at 10:37. This page has been accessed 15,063 times.