Thumbtribes in C
Posted: May 2nd, 2008 | Author: john | Filed under: thumbtribes | No Comments »I have now re-written the Thumbtribes daemon completely in C and moved the project over to OpenMokoProjects.
The server will remain in Chicken Scheme.
I have now re-written the Thumbtribes daemon completely in C and moved the project over to OpenMokoProjects.
The server will remain in Chicken Scheme.
Intro:
thumbtribes has now morphed into a D-Bus daemon. More details will appear at thumbtribes.mobi. In short, thumbtribes is a low-bandwith distance calculation daemon. A typical use case would be to obtain the distance of a specific user and trigger a alert on the phone when they are within a certain distance. The daemon has been designed to continually run and attempts to minimize the amount of traffic by using encoding techniques based on ASN.1 Packed Encoding Rules.
Features:
Todo:
I need to work on some documentation for the interface and also do some testing. I have briefly tested on my desktop, Openmoko phone and Nokia tablet. I need to create some binary packages.
The binary built does not have any special dependencies. It is large as it includes the Chicken Scheme runtime etc (make sure you strip the binary). This eliminates the requirement for a separate library and makes it more straight forward to distribute. The benefit of having Chicken as a shared library would come into play if there are other applications using it at the same time. This is unlikely on my phone for example. Looking at memory usage on my phone, thumbtribes appeared to only clockup about 1.6% of memory. If the size of the binary is an issue I may look at separate libraries and/or re-writing the Scheme parts in C.
What next:
I intend to start work on some other D-Bus utilities and clients to make use of this daemon.
Recently I have been climbing the steep learning curve of D-Bus. I will be experimenting with turning thumbtribes into a D-Bus daemon and possibly eliminating any web service. I intend to hack something together for Maemo first then Openmoko. D-Bus uses a binary protocol locally which I will extend to communicate with the outside world in an efficient manor using packedobjects.
I will be attending Over The Air and hope to do a bit of hacking there.
This update contains some design changes. The client is now threaded.
Download instructions here.
I have been working on a “bot” for thumbtribes called “Dave”. Dave has a couple of jobs. He can make sure the connection does not idle. He can also inform you of new posts to the thumbtribes site. He is pretty basic right now but will get some more duties. It would be nice at some point to give him AI!
I have migrated thumbtribes to a new server using MySQL instead of PostgreSQL. There may be some teething issues. Drupal handles things differently between the two. For example, in MySQL, Drupal uses a ‘sequences’ table to obtain the next id for various primary keys. In PostgresSQL it uses functions to obtain these values instead. The API between the server and database also changed. Due to these technical obstacles and time constraints I have not migrated old test accounts. Thanks to those who tested out the old thumbtibes site. I expect to do some more work on the server side of things and hold off client releases. I plan on working on “twitter” style updates to the client.
This version has some improved exception handling. I have been testing over GPRS and notice that if a TCP connection is idle for a certain amount of time the client initiates a TCP RST which terminates the connection. The client should now be able to alert the user of these network problems and you can re-login by entering ‘/l’. I need to investigate the source of the reset but I imagine it is a ‘pppd’ setting.
To install from scratch:
ipkg install http://zedstar.org/ipk/chicken-scheme-interpreter_2.733_armv4t.ipk
ipkg install http://zedstar.org/ipk/thumbtribes-client_0.16_armv4t.ipk
If you are updating just install the thumbtribes-client package.
It was a nice clear sky so ideal conditions for testing my first GPS micro blog post from my Neo. In true “twitter” style I posted a couple of trivial messages directly to the thumbtribes.mobi site. The results are here.
The GPRS connection appears to be a bit temperamental but it has helped highlight some possible areas where I can make the TCP code a bit more robust.
In this version, when the user does:
/b some message
The message will be posted directly to their blog on thumbtribes.mobi and the GPS location of the post will appear as a link to Google maps. Now I have GPRS working I hope to take my Neo out and try my first GPS micro blog soon.
To install:
ipkg install http://zedstar.org/ipk/thumbtribes-client_0.15_armv4t.ipk
I have started work on a micro blogging feature. I am quite excited about the prospect of bookmarking locations when I am out and about with my phone. For example, “Here is a good pub…”. This version of the client can now write directly to the thumbtribes site by simply entering
/b Here is a good pub!
I will add location information/link to google maps etc automatically in the next version.
To install:
ipkg install http://zedstar.org/ipk/thumbtribes-client_0.14_armv4t.ipk