Tuesday, 16 March 2010

Argot meets Contiki (Part 2)

Back in October last year I wrote about building an example of using Argot on Contiki. After releasing Argot recently under a BSD licence, I've been working on preparing that small project for release. I'm happy to say that release is now done. It builds on Argot, Colony and the newly released Argot MCG (Micro Code Generator) which generates C code from Argot dictionary files. You can find all the project files at www.einet.com.au/Downloads.

At a high level the Contiki Argot project shows embedding a protocol meta data description in a small Contiki device. The meta data is used by a client to verify the definition of a protocol before sending a request to the device. Placing Argot meta data on the device allows each part of an interface to be versioned and allows clients to perform full protocol discovery on devices with only a few kb of read only memory. On the client side, a developer is able to use java interfaces which bind to the protocol description allowing fast development of clients. This form of protocol discovery allows tight binding between client and server while still maintaining loose coupling. For details of what the example shows you can read the details in the post from October.

If you're interested in trying out the example, I suggest downloading the instant contiki vmware development environment. From a command shell in Contiki get the project:
wget http://www.einet.com.au/files/ContikiArgot-1.0.0.zip
unzip argot-contiki-1.0.0.zip
cd argot-contiki
To build the server a small change needs to be made to the Contiki build system (applies to contiki-2.4). The following command will patch the makefile with the required changes:
patch -d /home/user/contiki-2.4
In these instructions the server is being built to be run using the minimal-net configuration which is run on the unix host. This is useful for debugging and as a demonstration of the code. The Contiki minimal-net configuration uses the tap0 unix networking driver to put the host into a different network. This is configured in the “contiki-2.4/platform/minimal/contiki-main.c” file. I use ip, netmask, gateway In the “contiki-2.4/cpu/native/net/tapdev.c” the tap0 configuration needs to be adjusted for your selected IP address. Around line 107, change the line “ifconfig tap0 inet” to match your configuration.

Following configuring the network components of the example you can build the server:
cd examples/test
To run the server:
sudo ./argot-server.minimal-net
Leave the server running and open a different shell. To build the Java client code, two jar files need to be copied into the Apache Ant build libraries. This is a one off task:
cp lib/junit.jar /usr/share/ant/lib
cp lib/ant-junit.jar /usr/share/ant/lib
You can then build the java client by calling ant at the base of the project:
After the client has been successfully built, you can call the simple test code:
java -jar lib/contiki-argot-1.0.0.jar
If everything is successful you should have an output that ends with “doSomething returned: 30”.

Obviously, this example is still quite rudimentary. However, it does demonstrate calling a Contiki based service which uses only a few kb of memory. It also shows a client which only requires a Java Interface to be coded to make the call. Next steps are to improve the functionality of the test and look further into the transport protocols used in this environment.

Sunday, 14 February 2010

Argot, Patents be gone, BSD free

The concepts behind Argot has been under consideration for a patent over the last six years. After some deliberation I have decided to abandon the patent and change the way Argot is released. In the coming weeks the Argot source code will be released under a BSD style license. This completely removes the shackles of patents and licensing which I believe may have been holding Argot back. This is a major change to the way Argot is released and will hopefully pave the way for it to grow and improve.

A major motivation for removing the patent and license is timing. The M2M (Machine to Machine) market is evolving and growing quickly at the moment. The concept of the Internet of Things (IOT) is becoming the next big thing and projects like Contiki are gaining momentum. For Argot to have any chance of being accepted, it needs a simple compatible license. Argot also needs to be tested in the market and possibly evolve to the meet the needs of the market. It can't do that sitting on the shelf. Argot is designed to meet the needs of the embedded and M2M market; small light weight data encoding with data type versioning built-in. No other technology can provide the ability to embed the full meta description of a protocol in as little as 4kb of memory. This is the right time for Argot to be in the market and tested fully.

If you're a developer or technologist of any sort that had been turned off Argot in the past, because of the wrong license or patents, please, look again safe in the knowledge that the code is free from restrictions. In fact, one of the consolations of having an abandoned patent is that you know that its safe from other patents getting in the way in the future; prior art is proven back to 2003. If you like what you see, or think it's climbing the right mountain please get involved or even develop your own implementation.