OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> Gpsdrive On X/qt-debian, with a CF GPS device
suid
post Apr 2 2005, 12:01 PM
Post #1





Group: Members
Posts: 48
Joined: 12-April 04
From: Lancaster, UK
Member No.: 1,379



I've got Gpsdrive running under X/Qt-debian quite nicely. I first tried without Debian by using gpsdrive from the Familiar feed together with X/Qt, which has all the packages required by the latest version of Gpsdrive (2.09) in its "testing" feed. However, I gave up after experiencing too many library incompatibility problems.
I wanted to try Debian anyway!

So now with Debian, I could just run "apt-get install gpsdrive" and Hey presto! There were a few additional things I had to do, however, which I did over a couple of months, so hopefully these are the most important notes I can remember on setting up :

*** NOTE. If you are just starting to look at GPS apps, I'd seriously take a look at Qpegps first. It's an excellent app that's written for Qtopia, so it's much better suited to the Zaurus and a lot easier to set up. It's just that Gpsdrive has additional functionality and I liked the challenge of getting it running. ***

# MAKEDEV ttyS3 ## to create the device within the Debian environment.

At various stages I needed to do a chmod 666 on /dev/ttyS3 (after installing gpsd, I think) and /dev/audio.

You don't need cardctl, setserial or anything like that if you have "cru" from the pocketworkstation Debian distribution (part of the postinstall script, I think). This will let you run such commands as cardctl from Qtopia whilst still in Debian.

Also, you don't need to install gpsd. The latest version of Gpsdrive will talk directly to your serial device.

I created a user "zaurus" with the same UID and GID as in Qtopia. This is to stop Gpsdrive complaining if you try and start it as root.

I created a script that can be run from an icon in the taskbar :

----
#!/bin/bash

# Enable the CF device. If you don't have cru, you'll need to
# run cardctl from Qtopia.
# Equivalent to "/usr/local/bin/cru cardctl resume"
/bin/echo "dev/null cardctl resume" >/dev/rootcmd
/bin/sleep 1

# -x is to create separate windows for Menu and Status.
# -1 is for 1 button mouse. May be better off without this.
# Took me ages to get the right numbers for height and width for C750 in portrait
# mode. These numbers seem to relate to map size rather than screen size.
# Any numbers above these and Gpsdrive will ignore -r and -s.
# -r is width
# -s is height
# -S don't show splash screen
# -e use Flite for speech output (more on this later)

su - zaurus -c "export DISPLAY=0:0;gpsdrive -x -1 -r 478 -s 599 -S -e"

----

Installed MySQL for the waypoints database. Wrote a script to import the list of all UK speed traps into MySQL. There are too many for Gpsdrive/MySQL to handle - Gpsdrive crashes! Strangely enough, using a text file for waypoints seems to be faster and more stable than using a database.

Installed flite for speech output.

All was working nicely, except there was no speech output. A quick mail to the very responsive Gpsdrive mailing list and soon there was a fix in the CVS version of gpsdrive.

Installed all the apps/libs necessary for a build environment and compiled the CVS version for Debian/ARM.

Hope this information is useful to someone. If anyone is interested in the latest CVS binary of gpsdrive for Debian/ARM, I can post it here.

Cheers

Ian
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
suid
post Aug 20 2005, 08:35 AM
Post #2





Group: Members
Posts: 48
Joined: 12-April 04
From: Lancaster, UK
Member No.: 1,379



dry.gif Looks like Meanie's distro doesn't include all the postinstall stuff that comes with Klaus Weidner's Pocket Workstation. Can you just check whether or not you have the following files under your Qtopia environment ?

/etc/debroot.conf # PERMS -rw-rw-rw-
/etc/rc.d/init.d/zdebian # PERMS -rwxr-xr-x

If not then you need to create them. I'm working from memory here, but I think that this should be all that you need. Proceed at your own risk. Don't blame me if this bricks your Zaurus etc, etc :-

debroot.conf

CODE
### /etc/debroot.conf
#
# Configuration for the Debian chroot environment startup process
#

# IMPORTANT: boolean settings (DEB_FOO=1) are true if not empty, so
# comment out the entry (put a '#' at the start of the line) if you
# want to deactivate it.

# The chroot directory for the Debian installation. Modify as required.
DEBROOT=/mnt/card/debroot

# The PATH to be used for programs running inside the chroot. Take your
# pick - the first one lets local programs override system defaults,
# the second one prevents that.
#
DEB_PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/games
#DEB_PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:$HOME/bin:/usr/X11R6/bin:/usr/games

# Disable this if you have a fixed QPE that permits VT switching
#DEB_QPE_WARNING=1

# Mount proc inside the chroot=
#DEB_DO_MOUNTS=1

# The following files are copied from the native
# system into the chroot environment on bootup.
# Use a path relative to '/', but omit the leading
# slash.
#
# The files are modified to contain '#' comments,
# so don't do this for files that don't support
# '#' as a comment character
#
#DEB_COPY_INTO_CHROOT="etc/resolv.conf"

# The following files are copied in the opposite
# direction - from the chroot into the native
# environment on bootup.
#
#DEB_COPY_INTO_NATIVE="etc/hosts"

# A list of services to launch on bootup inside
# the chroot. Make sure to avoid conflicts with the native
# system - don't try to run two network servers on the
# same port.
#
#DEB_RUN_SERVICES=""
#DEB_RUN_SERVICES="mysql"
#DEB_RUN_SERVICES="inetd ssh lpd"
#DEB_RUN_SERVICES="ssh"

# Launch the VNC server in the backround on startup?
#DEB_RUN_VNCSERVER=1

# Lauch framebuffer VNC client?
#DEB_RUN_FBVNC=1

#
#DEB_ZAPM_PROXY=1

# If you already have a 'zapmd' startup script (one is
# included in the native X11 environment for the zaurus),
# disable this entry.
#DEB_RUN_ZAPMD=1

# Start the rootcmd server? It forwards shell commands sent
# by 'cru' from the chroot environment to the native system.
# This way, you can run 'cru cardctl eject' and avoid the need
# to put PCMCIA tools and configuration into the chroot.
#
DEB_ROOTCMD=1


I've commented out everything except what you need to get the rootcmd server started.

zdebian

CODE
#!/bin/bash

## sh [linked to ash] doesn't exec cleanly, so set to bash
SHELLCMD=/bin/bash

DEBCONF=/etc/debroot.conf
[ ! -f $DEBCONF ] && {
       echo "Can't find $DEBCONF, aborting..."
       exit 1
}

. $DEBCONF

[ "$DEBROOT" ] || exit 1
if [ ! -d "$DEBROOT" ]; then
       echo "Waiting for $DEBROOT to be fscked..."
       while ps ax | grep -v grep | grep e2fsck >/dev/null
       do
               sleep 1
       done
       sleep 1
       if [ ! -d "$DEBROOT" ]; then
               echo "Waiting for $DEBROOT to be mounted..."
               sleep 10
       fi
fi
cd $DEBROOT || exit 1

ROOTCMD_FIFO=$DEBROOT/dev/rootcmd
ZAPMD=/dev/zapmd

rootcmd_server_start () {
       rm -f $ROOTCMD_FIFO
       mkfifo -m 600 $ROOTCMD_FIFO

       (
               while true
               do
                       exec <$ROOTCMD_FIFO
                       read TTY CMD
                       $SHELLCMD -c "$CMD" </dev/null >$DEBROOT/$TTY 2>&1
                       sleep 1
               done
       ) &
       echo $! >/var/run/rootcmd.pid
}

rootcmd_server_stop () {
       kill $(cat /var/run/rootcmd.pid)
       rm -f /var/run/rootcmd.pid
}

zapm_proxy_start () {
       rm -f $DEBROOT$ZAPMD
       mkfifo $DEBROOT$ZAPMD

       (
               while true
               do
                       [ -e $DEBROOT$ZAPMD ] || exit 0
                       exec < $DEBROOT$ZAPMD
                       read C
                       [ -e $ZAPMD ] && echo "$C" > $ZAPMD
                       sleep 1
               done
       ) &
       echo $! >/var/run/zapm_proxy.pid
}

zapm_proxy_stop () {
       kill $(cat /var/run/zapm_proxy.pid)
       rm -f /var/run/zapm_proxy.pid
       rm -f $DEBROOT$ZAPMD
}

CR="env -i PATH=$DEB_PATH TERM=vt102 HOME=$HOME chroot $DEBROOT"

commented_copy_into_chroot () {
       [ -f "/$1" ] && (
               echo "### Do not edit this file - it was copied"
               echo "### from the native system's /$1 by $0"
               echo "### Edit $DEBCONF to deactivate this."
               echo
               cat "/$1"
               echo
               echo "### Do not edit this file - it was copied"
               echo "### from the native system's /$1 by $0"
               echo "### Edit $DEBCONF to deactivate this."
       ) > "$1"
}

commented_copy_into_native () {
       [ -f "$1" ] && (
               echo "### Do not edit this file - it was copied"
               echo "### from $DEBROOT/$1 by $0"
               echo "### Edit $DEBCONF to deactivate this."
               echo
               cat "$1"
               echo
               echo "### Do not edit this file - it was copied"
               echo "### from $DEBROOT/$1 by $0"
               echo "### Edit $DEBCONF to deactivate this."
       ) > "/$1"
}

case "$1" in
start)
       if [ "$DEB_DO_MOUNTS" ]; then
               [ ! -f proc/version ] && mount none proc -t proc
               ## FIXME: following breaks if debroot on cf card
               # [ -L /mnt/cf ] && ln -sf $DEBROOT/mnt/cf /mnt/cf
       fi

       [ "$DEB_COPY_INTO_CHROOT" ] && for F in $DEB_COPY_INTO_CHROOT
       do
               commented_copy_into_chroot $F
       done

       [ "$DEB_COPY_INTO_NATIVE" ] && for F in $DEB_COPY_INTO_NATIVE
       do
               commented_copy_into_native $F
       done

       [ "$DEB_ROOTCMD" ] && rootcmd_server_start
       [ "$DEB_ZAPM_PROXY" ] && zapm_proxy_start

       [ "$DEB_RUN_SERVICES" ] && for S in $DEB_RUN_SERVICES
       do
               $CR /etc/init.d/$S start
       done
       [ "$DEB_RUN_VNCSERVER" ] && /usr/local/bin/Vncserver
       [ "$DEB_RUN_FBVNC" ] && /usr/local/bin/Fbvnc

      ;;
stop)
       if [ "$DEB_DO_MOUNTS" ]; then
               umount proc
       fi

       [ "$DEB_ROOTCMD" ] && rootcmd_server_stop
       [ "$DEB_ZAPM_PROXY" ] && zapm_proxy_stop

       [ "$DEB_RUN_SERVICES" ] && for S in $DEB_RUN_SERVICES
       do
               $CR /etc/init.d/$S stop
       done
       [ "$DEB_RUN_VNCSERVER" ] && echo "Not stopping Xvnc, do that manually if you need to."
      ;;
restart)
       $0 stop
       $0 start
      ;;
esac
#echo "zdebian finished."
exit 0


Run /etc/rc.d/init.d/zdebian from the command line, then start up Debian and try "cru cardctl status" again. If this works, you can create the links so that zdebian (and rootcmd) will start up automatically when you boot the Z.

Create the necessary links to start up zdebian during boot :-

# ln -s /etc/rc.d/init.d/zdebian /etc/rc.d/rc5.d/S50zdebian

(or, rather that creating S50zdebian, you could just run "/etc/rc.d/init.d/zdebian start" when you start up Debian)

# ln -s /etc/rc.d/init.d/zdebian /etc/rc.d/rc0.d/K50zdebian
# ln -s /etc/rc.d/init.d/zdebian /etc/rc.d/rc1.d/K50zdebian


If everything is working okay, then my original script at the start of this thread should now work.

Good Luck!

Ian
Go to the top of the page
 
+Quote Post

Posts in this topic
suid   Gpsdrive On X/qt-debian   Apr 2 2005, 12:01 PM
ensign   Hi Ian, I am interested in your version of gpsdri...   Jul 2 2005, 01:01 PM
ensign   Hi Ian, Thanks for the file. just installed it. I...   Jul 4 2005, 01:49 AM
suid   Looks like I need to create a complete package wit...   Jul 4 2005, 04:04 AM
suid   Just had a look around and have discovered that th...   Jul 5 2005, 09:51 AM
ensign   Ian, That was it. Have got sound working now. Firs...   Jul 5 2005, 11:46 AM
samxiao   where's the feed for Gpsdrive and lib-art?   Jul 27 2005, 12:19 PM
suid   QUOTEwhere's the feed for Gpsdrive and lib-art...   Jul 28 2005, 04:08 AM
samxiao   but isn't the normal feed for x86 ? because i...   Jul 28 2005, 04:13 AM
suid   Yep, sounds about right to me. Ian   Jul 28 2005, 04:54 AM
koen   It's actually the whole truth, an Xscale has...   Jul 28 2005, 07:18 AM
samxiao   i just wonder why the gpsdrive in debian feed does...   Jul 28 2005, 06:37 AM
suid   QUOTEi just wonder why the gpsdrive in debian feed...   Jul 28 2005, 07:20 AM
samxiao   suid: i used your script but i cannot launch GPSd...   Jul 28 2005, 08:03 AM
suid   This question would be better directed at Meanie b...   Jul 28 2005, 08:57 AM
samxiao   how do i check if flite is working or not? okay i...   Aug 7 2005, 07:33 AM
samxiao   oh.. i found out the problem i run it as "za...   Aug 7 2005, 02:47 PM
suid   QUOTEhow do i solve this problem by giving "z...   Aug 8 2005, 03:48 AM
samxiao   QUOTE(suid @ Aug 8 2005, 06:48 AM)QUOTEhow do...   Aug 8 2005, 07:37 PM
samxiao   suid: do you encounter a problem when using Gpsdr...   Aug 17 2005, 07:42 AM
samxiao   i never able to get my Debian communicate with my ...   Aug 17 2005, 12:26 PM
samxiao   okay now i think where the problem is the LED of ...   Aug 17 2005, 03:45 PM
suid   QUOTEThe problem is how do i turn on the GPS CF al...   Aug 18 2005, 01:19 AM
samxiao   QUOTE(suid @ Aug 18 2005, 04:19 AM)QUOTEThe p...   Aug 18 2005, 06:03 AM
suid   Dou you have a running rootcmd server? If not, the...   Aug 18 2005, 02:47 PM
samxiao   QUOTE(suid @ Aug 18 2005, 05:47 PM)Dou you ha...   Aug 19 2005, 09:53 AM
suid   Looks like Meanie's distro doesn't include...   Aug 20 2005, 08:35 AM
samxiao   thanks suid it works great   Aug 20 2005, 02:56 PM
suid   Full Debian package now compiled and can be downlo...   Mar 15 2006, 03:17 PM
Merlin_fr   Hi, I'm trying to install gpsdrive on my C300...   Jun 26 2006, 07:30 AM
suid   QUOTEnon-network local connections being added to ...   Jun 28 2006, 05:06 AM
Meanie   you probably want to try this instead http://www.t...   Jun 28 2006, 09:35 AM
portalgod   QUOTE(Meanie @ Jun 28 2006, 10:35 AM)you prob...   May 7 2007, 07:08 AM
Meanie   QUOTE(portalgod @ May 8 2007, 01:08 AM)QUOTE(...   May 7 2007, 07:15 AM
portalgod   QUOTE(Meanie @ May 7 2007, 08:15 AM)QUOTE(por...   May 7 2007, 09:39 AM
portalgod   QUOTE(portalgod @ May 7 2007, 10:39 AM)QUOTE(...   May 11 2007, 11:15 AM


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 10th July 2014 - 05:02 AM