Wednesday 27 February 2013

LedBorg Server, Client and Android app


The new HTML interface
Since the original LedBorg Vala project, I have been working on a total re-write, moving it on from a single source file experiment. It's now been split into libledborg which is a shared library, and ledborg-server which is the new version of the server, which has a cleaner and more consistent protocol (though very similar to the version in the original project), and a vastly improved HTML interface shown here.

I've also used libledborg to not only build the new ledborg-server, but to also build a separate client package, imaginatively titled ledborg-client. This is a simple command-line client that could be called from scripts to communicate with the ledborg-server.


ross@raikkonen:~$ ledborg_client --help
Usage:
  ledborg_client [OPTION...]

LedBorg Client 0.1.0 is a simple command-line client that allows
 network control of an LedBorg add-on for the Raspberry Pi
 by talking to LedBorg Server

Help Options:
  -?, --help                              Show help options

Application Options:
  -p, --port                              Specify which port to connect on
  -h, --host=HOSTNAME or IPADDRESS        Specify the LedBorg server to connect to
  -c, --colour=LEDBORG COLOUR TRIPLET     Specify the colour to send to the server
  -o, --operation=get/set                 Operation to perform
  -V, --version                           Show version information

Both of these new packages have been developed using the GNU build system (autotools), which has been a bigger learning curve than Vala itself! In addition, to complete the learning experience, I've been using the git SCM to manage the code.

Android ledborg client
Finally, I've been firing up the Eclipse IDE to develop a basic Android client app. This has, of course, been in Java rather than Vala.

The source code to all three packages is now available on github.



The MagPi Magazine

This is going to be a quick one. Just to say thanks to the awesome people at The MagPi magazine for publishing my article on programming the Raspberry Pi and LedBorg add-on with Vala (based on my previous blog post).

The article appeared in the Feb 2013 issue, which can be downloaded as a PDF or viewed online here.