We plan to get Mike Demmer (et al)'s NetAPI running on the tablets. To make a long story short, netapi depends on twisted, which depends on zopeinterface, which depends on python…
There are two parts to this story.
The first one (the short one) is about how to get Twisted working on the tablets. The second is about a long process of cross-compiling and debian-packaging, which you won't need to do if you are just using Twisted, but you might need to do if you are using netapi.
Twisted is an event-driven networking engine written in Python, supporting numerous protocols. It contains a web server, numerous chat clients, chat servers, mail servers, and more. It's got a number of useful APIs for networked services, and a few example applications to get you started.
NetAPI is an implementation of a network layer based on the publish/subscribe model, designed to better embody the types of communication entailed in applications like rss/podcast/news services, mail, etc, noting in particular that current notions of connection management do not match well with their models of data delivery. This may be particularly useful for delay tolerant applications.
For more details, see:
pc> ./flasher --enable-rd-mode
nokia$ sudo gainroot
nokia# apt-get update
nokia# apt-get install python-all python-dev python2.5-dev
nokia# apt-get install python-zopeinterface
nokia# apt-get install python-twisted-bin python-twisted-core
nokia# twistd -y chatserver.py
pc> telnet 192.168.2.15 1025
The Debian Repository HOWTO: http://www.debian.org/doc/manuals/repository-howto/repository-howto
$ cd /var/www/virtualhosts/phone.cs.berkeley.edu/apt/dists/[whatever directory you chose] $ dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
Some things we noticed during our trials and tribulations
We're not sure - it may be possible to add new repositories to the empty source file. But, just in case, instead we use the Application Manager to add new package repositories. Since apt won't run when the Application Manager is open, we then have to close the manager before going to an xterm window.
To update the package list:
apt-get update
You may get some warnings if the src repositories don't exist.
To search for packages:
apt-cache search [package name]
So scratchbox uses python2.3 for a lot of the emulation. This become problematic for cross-compiling applications where the configuration assumes that you want to use whichever python gets invoked when you just type “python”. (Do python -V to check which version is being run, which may not be the same that shows up if you run which python, see “scratchbox path quirks”). When we decided to upgrade the python that runs in scratchbox, we were subsequently flooded with lines saying “sem_post: Function not implemented”. To get rid of this, follow the instructions on this link: http://maemogeek.blogspot.com/2007/11/installing-qemu-arm-eabi-patch-into.html
Scratchbox has a “feature” in which any applications that show up in /scratchbox/tools/bin are run, no matter where /scratchbox/tools/bin actually shows up on the path. Basically, once it finds the application, it checks to see if it is also in /scratchbox/tools/bin, and runs that if it is there, instead of whatever showed up. In particular, this happened when I was trying to upgrade python. “which” was clearly returning python2.5, whereas “python -V” always said “2.3”. The only way I could get around this was to (outside of scratchbox) delete /scratchbox/tools/bin/python, and replace it with the python2.5 binary. This, unfortunately triggered the sem_post warnings, which you can get rid of later.
We built and re-built a number of packages in a couple of different ways. For some packages which we compiled from scratch, we followed these instructions and it was pretty straightforward: http://maemo.org/development/documentation/how-tos/4-x/creating_a_debian_package.html.
For some other packages though, we decided to start with bora packages and repackage them. For this, we basically did an apt-get source on the package and then dpkg-buildpackage -rfakeroot. This command generally complains about dependencies so you have to repeat the process for all the dependent packages until there are none.