OpenMoko GPS tracking

Finally, I have waited long enough to have binary driver for GPS available.

After installing it I wrote a small script which enables you to show GPS data on screen:

  • install gllin driver
  • ipkg install vte
  • install /home/root/gps.sh script below:
    #!/bin/sh
    
    

    if [ ! -z "$START_TERM" ] ; then

    gllin=/home/root/gllin/gllin

    echo "*** starting gllin"
    $gllin &
    sleep 3

    file="/media/card/`date +%Y-%m-%d`.$$"
    echo "*** creating log $file"

    cat /tmp/nmeaNP | tee $file

    killall gllin
    kill `ps ax | grep cat | grep nmea | awk '{ print $1 }'`

    DISPLAY=:0 /etc/init.d/xserver-nodm start

    else

    /etc/init.d/gsmd stop
    echo 0 > /sys/bus/platform/devices/gta01-pm-gsm.0/power_on
    START_TERM=1 DISPLAY=:0 vte -c $0

    fi


  • create /usr/share/applications/gps.desktop icon so you can start GPS tracking from GUI:

    [Desktop Entry]
    Encoding=UTF-8
    Name=GPS
    Comment=GPS trace output
    Exec=/home/root/gps.sh
    Icon=openmoko-terminal
    Terminal=false
    Type=Application
    Categories=GTK;Application;Utilities
    MimeType=text/x-vcard;
    SingleInstance=true
    StartupNotify=true

This combination will shutdown gsm part (to preserve power), create new trace file on /media/card/date.pid and open terminal with output so you can see what is going on (openmoko-terminal2 doesn't want to accept commands, so you need to install vte for this to work. vte on the other hand doesn't accept any arguments, so we need hack with START_TERM environment variable. OOH, mrxvt crashes X server when you kill it so it wan't an option.

openmoko-gps.png

Happy GPS hacking...