AllJoyn and Linux

For some reason, there are no AllJoyn binary packages for Linux. Of course, most Linux users don’t mind building things from source, or they wouldn’t be Linux users.

I used this document as a guide to set up the development environment. There are a few other places in the documentation that list LInux prerequisites, but they were neither complete nor entirely correct. There are a couple of minor typos, and I had to make a one or two library substitutions for my Ubuntu 14.04 installation, but I was able to build the system. I didn’t bother with Javascript bindings or xulrunner, but I did find it helpful to install mono-gmcs to avoid errors from the Unity build package. In fact, I am installing Mono and the Gecko libraries on all development platforms, just to make it easier to deal with the build system.

Also, given that Sun requires an account to download archived JDKs and I did not feel like finding my password — and the fact that I am a little uncomfortable running really old Java — I went with the Java 7 SDK from Oracle. I had tried with the OpenJDK version 7, and did have some problems. Despite the dire warnings in the documentation, everything built fine. This may cause problems for me down the line, but so far everything has run as expected.

I had to define the LD_LIBRARY_PATH environment variable before the C++ samples would run, but that was my only problem. I had an issue with a thread-based exception in the client, but a little internet searching tells me it’s related to a bug that has already been fixed. I assume it will disappear with the next update to the source.

AllJoyn and the Internet of Things

Much of our group’s research involves applications that span a number of computers, input-output devices, and other electronics. Over the years we have connected the various pieces using sockets, web servers, Bonjour, OSC, and other technologies, weighing the tradeoffs for each application. Programming network connections can be time-consuming and error prone, or may use libraries or technologies that are — let’s say uneven — across platforms. Connectivity tends to consume a disproportionate amount of development time, leaving less to spend on interaction and functionality (i.e., the focus of our research).

Hence, we have been understandably interested in following the growth of the AllSeen Alliance, and the AllJoyn framework. AllJoyn was originally developed by the Qualcomm Innovation Center, and was contributed to the Alliance to serve as the foundation of an aspirational network of frameworks and applications to enable the “Internet of Everything.” With the addition of Microsoft to the alliance this year, AllJoyn has to be considered a viable competitor to Apple’s HomeKit and Samsung+Google’s Thread Group. To date, AllJoyn focuses on local connections between a number of device types, abstracting away the various transport mechanisms and OS layers that are supported. In theory, it sounds like a near-perfect solution to a set of challenges facing a growing number of developers. In reality, the framework seems to be suffering some growing pains, and the market impacts of some design decisions are still unknown.

I have been exploring the AllJoyn framework for the last week or so, and have only scratched the surface. Some of what I have seen is very appealing, while other aspects have impressed me less favorably.  The transition from Qualcomm to the AllSeen Alliance has created a bit of a mess of discontinuity between source code, SDK binaries, and documentation. I assume much of this will be straightened out in coming months, but I plan to document here some of what I learn in my efforts, for the benefit of anyone who is currently trying to walk the same path I have been on. Also, because I forget things.

Obtaining the AllJoyn Framework

The first challenge can be understanding where to get the current framework. One gets the impression that the system is in fairly rapid flux, and there are a number of sources for code and binaries. I would recommend avoiding the website unless you have a specific reason to be there. Most everything I have found useful is on the AllSeen Alliance site.

There are two pages on the AllSeen site that will be most useful. The first is the Download page, where you can obtain AllJoyn binaries for individual platforms, as well as a source tarball of the current release (14.06 at this writing) and a link to the git source code repository. Note that this is a repository on the AllSeen site. There is an AllJoyn repository on GitHub, but it is not active. Compiling any or all of the source is not for the faint of heart (or anyone on a deadline), so work from the binaries if you can. Having said that, there are resources in the source that are not in the binary packages (and vice-versa), so I prefer to have both available to me in most cases. So far, the git repository has been a better source for source than the source tarball, with one or two exceptions. I will try to be specific if it matters. I will try to cover specific cases as we go along. The Download page also contains a link to the AllSeen Wiki. I haven’t found too much there that was useful to me, but there were one or two helpful bits, so it’s worth mentioning.

The second important resource is the Developer Resources page. This is where much of the documentation for the framework is available. I would suggest starting with the Framework Tutorial to get an idea of the concepts, and then start working on a specific language and platform. For me, this generally involves downloading the binary and source and beginning to work through the documentation. I would like to say you could compile and run the BasicService and BasicClient samples for each platform — and in some cases you can — but in other cases you is probably simpler to build a Hello AllJoyn of your own.

I will post specifics on platforms and languages as I work through them, unless I grow tired of the whole thing.