Posted: August 19th, 2011 | Author: john | Filed under: nanonote, packedobjects, The Clashing Rocks | Tags: guile, nanonote, packedobjects, scheme | No Comments »
This project is about using embedded Linux devices to detect, record and react to seismic events. The idea is to use accelerometers to detect shaking and then communicate this event to all other devices connected to the same broadcast group. We are developing the technology using OpenWrt which allows us to use a range of hardware including routers and pocket computing devices. We really like the idea of exploring emerging low-powered, low-bandwidth mesh networks in developing countries. In this video you can see some early work using a network of Ben NanoNote computers fitted with WPAN hardware. Three devices are connected to a Spread daemon running on a co-ordinating device. Because our current hardware lacks accelerometers we run a program on one device to send fake accelerometer data onto the network. Each device should then pick up this data across our wireless network. We are currently able to get some basic support for IP networking using a hack by Werner Almesberger who also developed the WPAN hardware. In the video you can see the devices display a bar graph indicating it received data. Only one bar is registered as only one device is transmitting. This bar graph could act as a finger print for deciding the scale of seismic activity in a larger network. We intend to add some more intelligence to this part by building a some kind of knowledge system. Currently the project is at a very early stage with some basic infrastructure developed in C. The aim is to extend this infrastructure by embedding GNU Guile. This will allow us to dynamically control how we communicate, store and process the structured data shared amongst devices. Part of this system will involve trying to minimise the quantity of structured data exchanged on the network by serialising to bit-level using Packedobjects.
Further details of the project can be found at The Clashing Rocks wiki.
Posted: April 3rd, 2010 | Author: john | Filed under: packedobjects | Tags: guile, packedobjects, scheme | No Comments »
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.
**update**
This white paper has now be superseded by the paper “Everything counts in small amounts“.
Posted: May 2nd, 2009 | Author: john | Filed under: packedobjects, thumbtribes | Tags: guile, packedobjects, twitter | 2 Comments »
geotwitta lets you see how far you are from other twitter users running the program. It will post to your twitter account letting you know the distance in kilometers from those users. It is based on a bunch of technologies I wanted to try out. As a result it is somewhat over-engineered for what it does. For those that are interested it uses Guile to script a binary network protocol that happens to be encoded efficiently over UDP packets.
It is a command line program. An example of usage is:
geotwitta -u foo -p bar --lat=55.55 --long=-0.25
This would authenticate against the Twitter account ‘foo’ with password ‘bar’ and ping in those coordinates. These account details are only exchanged securely with Twitter and not sent over the network protocol. The protocol also does not provide coordinates back of other users. It simply shows a relative distance. The full source of the client is available. If there is an interest I will also tidy up the server code and release it.
To get started you need two packages: The program itself and the Guile module which does the network protocol work. The following tarballs are availble for those who want to build from source.
http://zedstar.org/tarballs/packedobjects-0.1.tar.gz
http://zedstar.org/tarballs/geotwitta-0.1.tar.gz
http://zedstar.org/tarballs/geotwitta-0.2.tar.gz
Untar and do the usual ./configure… routine. The configure script will let you know which dependencies are required to compile. If you don’t feel like building from source I have also built some Debian packages. I have tested these on Ubuntu (Intrepid Ibex).
http://zedstar.org/deb/packedobjects_0.1-1_i386.deb
http://zedstar.org/deb/geotwitta_0.1-1_i386.deb
http://zedstar.org/deb/geotwitta_0.2-1_i386.deb
If you manage to get the software running I will see you on Twitter!
All the usual disclaimers about the software apply.
**update**
Version 0.2 of geotwitta added: ignores UDP packet loss on pings
Posted: January 25th, 2009 | Author: john | Filed under: General, packedobjects | Tags: beagleboard, guile, openembedded, packedobjects | No Comments »
Thanks to OpenEmbedded building extensions for Guile that run on embedded devices such as the BeagleBoard is fairly painless. As I have previously mentioned, Guile is already supported by OpenEmbedded. If you have an extension which is made up of some C code and some Scheme code you first should automate building it with autoconf. This might install a shared library and install some Scheme files into Guile specific locations. The next step is to write a bitbake recipe which will work with this autoconf based project. Typically this recipe will download a tarball or checkout some code from version control and then begin its magic. The end product hopefully is a binary package which can be easily installed onto the device. As an example I built packedobjects as a Guile extension for my BeagleBoard. The bitbake recipe is availabe here:
http://packedobjects.cvs.sourceforge.net/viewvc/packedobjects/packedobjects_project/openembedded/
This works by getting the latest code from CVS. It builds the code and is told which files need to be part of the package. So if you have OpenEmbedded setup you just need to issue the command:
bitbake packedobjects
This will build and package the lastest code as an ipk.
We should test the built ipk on the device to see if it works:
root@beagleboard:~# opkg install http://zedstar.org/ipk/libpackedobjects0_0.1-r0.1_armv7a.ipk
Downloading http://zedstar.org/ipk/libpackedobjects0_0.1-r0.1_armv7a.ipk
Installing libpackedobjects0 (0.1-r0.1) to root...
Configuring libpackedobjects0
root@beagleboard:~# guile
guile> (use-modules (packedobjects))
guile> (exit)
Posted: January 2nd, 2009 | Author: john | Filed under: packedobjects | Tags: guile, packedobjects | No Comments »
I have created a sourceforge project for the new Guile version of packedobjects:
http://packedobjects.sourceforge.net/
This is an early version without documentation. The API has changed from the Chicken version so I will document this soon. Eventually I will push back the improvements to the Chicken version.
So far it builds as a Guile module. I also need to look at how to embed this version into a C application.
Posted: November 9th, 2008 | Author: john | Filed under: General, packedobjects | Tags: chicken, guile, packedobjects, scheme | No Comments »
I have lately been very busy with work, life and the universe and subsequently have done little hacking. I have recently been examining Guile. Guile has been part of OpenEmbedded for a while so should be easy to get running on numerous embedded devices. Chicken was very recently added to OpenEmbedded, however, lacks support for building eggs in this environment. One thing I really love about Chicken is its very easy to use foreign function interface (FFI). After spending the odd hour over various weekends I have finally begun to grok Guile’s FFI. I plan to build packedobjects for Guile and possibility extend its features.
I really like the idea of extension languages ever since I did some work with Tcl a number of years ago. A great example application was Eggdrop the IRC bot. Lots of kids at the time would program their eggdrop bots using the simple Tcl interface. I think a lot can be said about this approach in terms of learning/teaching programming. I hope to explore this further with my education hat on.