Posts Tagged packedobjects

geotwitta

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

Tags: , ,

Building a Guile extension on an embedded device

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)

Tags: , , ,

Packedobjects for Guile

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.

Tags: ,

Groking Guile’s FFI

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.

Tags: , , ,