Posted: December 5th, 2009 | Author: john | Filed under: Handhelds | Tags: guile, openmoko, scheme | No Comments »
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
Posted: December 4th, 2009 | Author: john | Filed under: Handhelds | Tags: guile, openmoko, scheme | No Comments »
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!
Posted: November 24th, 2009 | Author: john | Filed under: Handhelds | Tags: c, glib, gps | No Comments »
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.
** edit ** This example needs updating to work on newer GPSD versions
Posted: November 24th, 2009 | Author: john | Filed under: General | Tags: c, cdt, eclipse | No Comments »
Currently the eclipse-cdt package is missing from Ubuntu 9.10. To install cdt support do the following:
Fire up eclipse:
- Help->Install New Software
- Click Add
- 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.
Posted: September 6th, 2009 | Author: john | Filed under: twitter | Tags: Bluetooth, btlogger, twitter | No Comments »
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.
Posted: June 26th, 2009 | Author: john | Filed under: twitter | Tags: bobot, guile, irc, twitter | No Comments »
I have made a Guile module which is capable of being used by the IRC bot bobot++. The code is available here:
http://zedstar.org/tarballs/sneektweet-0.1.tar.gz
The readme:
sneektweet 0.1:
Wraps some C/GLib code which posts to Twitter.
setup:
Edit configure.ac to set twitter account details.
from REPL:
john@thinkpad:~/workspace/sneektweet$ guile
guile> (use-modules (twitter sneektweet))
guile> (tweet "foobar")
guile> ** Message: posted update to Twitter
todo:
Add reading updates and posting back to IRC channel.
bobot example code:
(use-modules (twitter sneektweet))
(define (sneektweet channel message)
(if (> (string-length message) 140)
(bot:say channel "Your message needs to be under 140 characters in length!")
(tweet message)))
(bot:addcommand "tweet" sneektweet #t 2 0)
Posted: June 19th, 2009 | Author: john | Filed under: Uncategorized | Tags: acceleromters, thinkpad, twitter, ubuntu | No Comments »
When accelerometers meet Twitter.
This programs calculates the covariance of data sampled from a Thinkpad’s accelerometers. If the covariance is over a certain threshold it posts the result to Twitter. Or more simply put, shake your laptop and make it tweet!
It is a command line program which requires a Twitter username and password to be supplied e.g.
shakeyshakey -u foo -p bar
Built and tested on Ubuntu (Jaunty Jackalope).
http://zedstar.org/tarballs/shakeyshakey_0.1.orig.tar.gz
http://zedstar.org/deb/shakeyshakey_0.1-1_i386.deb
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: March 25th, 2009 | Author: john | Filed under: thumbtribes | Tags: btlogger | No Comments »
I packaged up the tarball into a debian package:
http://zedstar.org/deb/btlogger_0.3.2-1_i386.deb
After installing run btlogger –help
Posted: March 6th, 2009 | Author: john | Filed under: thumbtribes | Tags: Bluetooth, btlogger, twitter | 5 Comments »
I decided to hack my Bluetooth logger so that it could post any new devices it saw to my Twitter account. This should be interesting once I get it setup on my desk at work! After moving to Intrepid Ibex I realised the changes in BlueZ versions borked my software. It took me a while to figure out what needed to be fixed. Anyway, these changes and Twitter hack are available as a tarball here:
zedstar.org/tarballs/btlogger-0.3.2.tar.gz
The tarball should install an sqlite db file in /var/lib/misc but you can move it else where if you don’t want to run as root. If you supply a username and password on the command line it will try and post the scan results to Twitter like:
http://twitter.com/jptmoore
To see the command line options run btlogger –help