Archive for June, 2007

Building thumbtribes from source

For those feeling energetic…

Download and install XChat.

Download and install Chicken.

Install the packedobjects extension (egg) by running

sudo chicken-setup packedobjects

Download and unpack the thumbtribes source.

On Linux run

csc -s thumbtribes.scm xchat_init.c

On Mac OS X

csc -s thumbtribes.scm xchat_init.c -L "-bundle -flat_namespace -undefined suppress"

The result of the build will be a shared object file which can be loaded into XChat.

Some background to the thumbtribes project

The project was created due to my frustrations with paying for the amount of data sent over my phone’s GPRS connection. I like the freedom to a buy phone without being tied into any contract. The downside of this approach is the metered cost of using the Internet. Using my packedobjects tool I was able to create an efficient protocol that would add location awareness to a messaging application without adversely affecting the cost of using the application. This approach seems to go against the current trend of building applications which use web interfaces and protocols to send bloated data over expensive networks. Of course such approaches are likely to look slick and be highly usable, but will they be affordable?

Introduction to thumbtribes

A formal description of thumbtribes is as follows:

Mobile application developers need to design their applications with the constraints of the network in mind. In comparison to inexpensive home broadband networks, mobile networks often exhibit high levels of latency and have limited bandwidth. Another significant difference between these networks is the cost of transporting data. Mobile network operators often apply usage tariffs, especially if the customer is on a prepaid service. In such situations, mobile Internet use can prove costly. To help reduce costs, application developers should try to minimise the amount of data their applications communicate. In this paper we present, thumbtribes, an open source project which attempts to add location-awareness to Internet Relay Chat (IRC) in a network efficient manner.

Moore, J. “THUMBTRIBES: LOW BANDWIDTH, LOCATION-AWARE
COMMUNICATION”, Proceedings of WINSYS 2007, International Conference on Wireless Information Networks and Systems, July 2007

The project is currently being developed and tested on an OpenMoko phone.

gpsd on a Nokia 770

After doing a quick search I came across a maemo-gpsd package. The package failed to install on my Nokia so I just built gpsd from source within my scratchbox environment. All I require is the actual gpsd binary so I was able to copy this together with shared library libgps.so to /usr/bin and /usr/lib respectively. I then created the symbolic links libgps.so.16 and libgps.so to point to the shared library libgps.so.16.0.0. This is enough to get a working gpsd.

To simplify connecting to my TomTom BT GPS receiver I use the following maemo BT plugin. After connecting to the GPS receiver the device

/dev/rfcomm0 or /dev/rfcomm[x]

will be created depending on other BT devices already connected. For example, if I connect to my phone first /dev/rfcomm0 would be created. Then when I connect to my GPS /dev/rfcomm1 is created.

Assuming GPS is the only BT device you can start the daemon with:

gpsd /dev/rfcomm0

thumbtribes on a Nokia 770

The following assumes you have the XChat package installed and are able to build source using scratchbox. The version of XChat I have installed is 2.6.4-2. I believe there are different versions available depending on what sites you have added to your application catalogue. I remember having problems with a different version.

You can install the Chicken library and the packedobjects shared object file as described here.

Get the thumbtribes source and build in scratchbox with the following command:

csc -s thumbtribes.scm xchat_init.c

You can then copy over the file thumbtribes.so to a suitable place on your Nokia. This will be the file you /load into XChat.

To add GPS capability you can do the following.

Getting started with thumbtribes

Before you can use thumbtribes you need to create an account.

Connect to the IRC server thumbtribes.mobi and create a username.

/msg userserv register username password

Register the current nick you are using

/msg nickserv register

Load the thumbtribes plugin

/load /path/to/plugin/thumbtribes.so

Login to thumbtribes using either manually specified coordinates or coordinates supplied by gpsd

/thumbtribes --user=username --pass=password --lat=latitude --long=longitude
/thumbtribes --user=username --pass=password --gpsd=gpsd-server

The thumbtribes program should now start and continually ping in your location. The response you get back from the ping will depend on your preferences set on the website. Currently you can just restrict the response according to distance by logging into the thumbtribes.mobi website. You can also alter the time you wait in between pings. Changes made to preferences will occur in real time apart from the ping time. The client needs to restart to obtain the new ping time.

To terminate thumbtribes

/terminate

Introduction to packedobjects

A formal description of packedobjects is as follows:

packedobjects is a data encoding tool based on the telecommunications standard Packed Encoding Rules (PER). An abstract syntax language is used to define a protocol specification. packedobjects uses the Scheme programming language to represent the protocol specification within a symbolic expression (s-expression).

Moore, J. “PACKEDOBJECTS”, Proceedings of WINSYS 2006, International Conference on Wireless Information Networks and Systems, August 2006, pp. 310-314

Less formally, packedobjects is a “bit stuffing” tool driven by a high level syntax. Rather than use ASN.1, packedobjects uses s-expressions as the high level syntax to represent a protocol description. The advantage of s-expressions is they are native to languages such as Scheme. At the time the project was conceived there were no open source solutions supporting unaligned PER. packeobjects was designed for projects that would benefit from a tool that was positioned in between hand encoding and formal telecommunications standards.

The software is available as an extension to Chicken Scheme.

My Zaurus

An old page about my Sharp Zaurus. There still may be some useful information.

Chicken Scheme on a Nokia 770

Here is a brief tutorial I wrote explaining how to get the Chicken interpreter running on a Nokia 770.