2010
08.18

Recently I have been working on Packedobjects which included redesigning the API and replacing a lot of C code in Scheme. I will try and formalize the whole encoding process which I have called Integer Encoding Rules. I also began work on a manual which includes some examples. My aim is to support the tool on OpenWrt which also involves maintaining the GNU Guile build.

I built and tested the software on my Ben Nanonote. The ipk is available: http://zedstar.org/ipk/packedobjects_0.4_xburst.ipk

After improving the documentation I intend to use the tool in a networking course at work. I think it is important for students to gain some experience of designing and structuring binary network protocols.  We will be getting a bunch of Nanonotes to compliment the Openmoko Freerunners we have. This will provide some nice hands on experience packing some data and communicating it across different kinds of hardware.

Long term, I am interested in designing some funky SlowFi protocols on copyleft hardware.

2010
05.02

I have been hacking at the OpenWrt Makefile and now have command line history working within the REPL.

opkg install http://zedstar.org/guile/libgmp_4.3.1-2_xburst.ipk
opkg install http://zedstar.org/guile/libltdl_1.5.26-1_xburst.ipk
opkg install http://zedstar.org/guile/guile_1.8.7_xburst.ipk

Once installed setup a .guile file:

root@BenNanoNote:~# cat /root/.guile
(use-modules (ice-9 readline))
(activate-readline)

When you run guile now you should be able to use the up and down cursor keys to go through your command history etc.

2010
05.02

To experiment some more with OpenWrt I dusted out a Freerunner and built a minimal image containing GNU Guile. The image is built with glibc and an IP 192.168.254.101 to match my Nanonote settings.

Flash the following:

http://zedstar.org/freerunner/openwrt-s3c24xx-2.6-uImage

http://zedstar.org/freerunner/openwrt-s3c24xx-root.jffs2-128k

Boot the device then:
john@thinkpad:~$ telnet 192.168.254.101
Trying 192.168.254.101…
Connected to 192.168.254.101.
Escape character is ‘^]’.

=== IMPORTANT ============================
Use ‘passwd’ to set your login password
this will disable telnet and enable SSH
——————————————

BusyBox v1.16.1 (2010-05-02 14:45:14 BST) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

_______ ________ __
| |.—–.—–.—–.| | | |.—-.| |_
| – || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
KAMIKAZE (bleeding edge, r21293) ——————
* 10 oz Vodka Shake well with ice and strain
* 10 oz Triple sec mixture into 10 shot glasses.
* 10 oz lime juice Salute!
—————————————————
root@OpenWrt:/# uname -a
Linux OpenWrt 2.6.30.10 #1 PREEMPT Sun May 2 14:59:31 BST 2010 armv4tl GNU/Linux
root@OpenWrt:/# guile
guile> (string-tokenize “hello world”)
(”hello” “world”)
guile>

2010
04.03

I personally view Scheme as a good extension language. Something that can be embedded into C code to ease the pain of doing everything in C. I am interested in exploiting this concept on embedded systems where there is a lot of fooling about to make a binary. I still intend to produce binaries and reuse the large amount of existing C code out there. However, I want to script the network communication and in particular the structure of the network packets. I have periodically been working on a tool that attempts to support this. This summer I intend to get rid of the old C code in this project and rewrite it entirely in Scheme apart from the low-level encoder/decoder which will remain in C. In this white paper I attempt to describe the work.

2010
02.25

Received a Ben NanoNote today. It is a really natty little device with a lot of potential.

My standard test on how hackable a device is involves getting Guile running. Anyway, it was pretty easy to accomplish this despite not using openWrt before.


root@BenNanoNote:~#
root@BenNanoNote:~# guile
guile> (map (lambda (x) (+ x 1)) '(1 2 3 4 5))
(2 3 4 5 6)
guile>

To install get the 3 xburst packages from here.

Happy Scheming!

2009
12.05

Having Guile running on an embedded device is very powerful. You can add scripting capabilities to a C program and avoid some of the cross compilation -> deploy cycles by simply editing the script to change some functionality. As an example I have taken the code from the excellent introductory article Scripting with Guile. I packaged the code so that if you install the tarball or the ipk it will install both the binary and script to a suitable place.

Tarball: http://zedstar.org/tarballs/square-0.1.tar.gz

ipk: http://zedstar.org/ipk/square_0.1-r0_armv4t.ipk

After installing Guile do:

root@om-gta02 ~/ipks $ opkg install square_0.1-r0_armv4t.ipk
Installing square (0.1-r0) to root...
Configuring square
root@om-gta02 ~/ipks $ square
result of square is 49
result of square2 is 81

2009
12.04

I recently got hold of a bunch of Openmoko Freerunners. I needed a distribution which installs to Flash (NAND) so I chose SHR.

I am very impressed how things have progressed especially in terms of being a phone!

Anyway, this gave me a chance to try out some Guile packages I built. If you have a recent version of SHR unstable the following should work:

http://zedstar.org/guile/

Happy Scheming!

2009
11.24

Code:

http://zedstar.org/tarballs/gpstest-0.1.tar.gz

From the README:

A simple GLib based program which periodically reads coordinates from gpsd.

The logs directory contains a sample gps log which can be fed to gpsfake:

gpsfake 1334-N-20071129-GTA01-A3.log

Make sure gpsd is not running before attempting to run gpsfake.

The data was taken from a Neo 1973 in central London. It will take a moment
to start showing coordinates.
2009
11.24

Currently the eclipse-cdt package is missing from Ubuntu 9.10. To install cdt support do the following:

Fire up eclipse:

  1. Help->Install New Software
  2. Click Add
  3. In location add: http://download.eclipse.org/tools/cdt/releases/galileo

You should be able to select this now from the drop down box titled “Work with:”

Follow it through and it will install what you need. My previous C/C++ view was ghosted so I added it again.

2009
09.06

I finally got around to fixing btlogger. It broke after an Ubuntu upgrade which contained BlueZ changes. Anyway, I have moved the code over to Gitorious and made a new tarball and Debian package.

Binary: http://zedstar.org/deb/btlogger_0.3.3-1_i386.deb

Tarball: http://zedstar.org/tarballs/btlogger-0.3.3.tar.gz

Repo: git clone git://gitorious.org/btlogger/btlogger.git

Take a look at the README for further information.