Phase 1 GPS driver

From Openmoko

Jump to: navigation, search

This article describes problems and solutions that were extremely important in the past but seems obsolete now. This content is kept mainly to reflect the history of the project.

In the very early shipment to 50 Phase 1 developers, a binary-only program for talking to the the GPS was accidentally included in /home/root/DM2/gps, (and presumably, the same binary would function on a P0 device). It was compiled to OABI format which now is obsolete as OM2007.2 builds are in EABI format, but developers suggested tricks to run it with chroot. These approaches seem now obsolete and the old binary seems even no longer easily available.

Binary Daemon GLLIN

For those few with the binary driver in the meantime, Pavel Machek provides the following script for recording an NMEA stream from the binary program.

#!/bin/sh
echo 1 > /sys/class/leds/gta01\:vibrator/brightness
killall gllin cat
sleep 1
echo 0 > /sys/class/leds/gta01\:vibrator/brightness
mknod /tmp/nmeaNP p
cat /tmp/nmeaNP >> /tmp/gps.nmea &
/home/root/DM2/gps/gllin -low 5
/home/root/DM2/gps/gllin -periodic 3

The binary program was compiled to OABI format which now is obsolete as OM2007.2 builds are in EABI format. You can still run the binary with chroot. Bartek Zdanowski wrote an aticle how to run GPS receiver. Alternatively ld-linux can be used to do the trick:

The ld-linux trick

You need the following files:

bin/gllin
bin/gllin.sh
lib/ld-linux.so.2
lib/libc.so.6
lib/libgcc_s.so.1
lib/libm.so.6
lib/libnss_dns.so.2
lib/libnss_files.so.2
lib/libpthread.so.0
lib/libresolv.so.2
lib/librt.so.1
lib/libstdc++.so.6
lib/libutil.so.1

The file bin/gllin.sh contains:

#!/bin/sh
`pwd`/lib/ld-linux.so.2 --library-path `pwd`/lib `pwd`/bin/gllin -low 5
test -p /tmp/nmeaNP || ( rm -f /tmp/nmeaNP && mknod /tmp/nmeaNP p )
`pwd`/lib/ld-linux.so.2 --library-path `pwd`/lib `pwd`/bin/gllin -periodic 3

Be sure to start at least a `cat /tmp/nmeaNP` somewhere.

Another approach (chroot) is described in Gllin - here is also a link to an archive with all needed shared libraries in the right format.

Strange effects

The message

Stack size 8864 bytes (9 KB)

means, nobody is reading on the pipe /tmp/nmeaNP, you probably forgot to start the `cat ...`.

The message

gllin: early exit(3) in halInit()/681

is issued by the low-level hardware test but gllin works fine afterwards.

Do not use the option

+daemon

because gllin then writes all data to file in /tmp which is a bad idea because /tmp is in kept in RAM so it's lost on reset. Also since the RAM is limited the logfile will eat up your memory.

Personal tools