Mer/Documentation/N810 GPS

(Many formatting fixes)
Line 10: Line 10:
1. Install the following packages from the Maemo Updates repository (you can install them on Maemo, then copy the packages from the apt cache):
1. Install the following packages from the Maemo Updates repository (you can install them on Maemo, then copy the packages from the apt cache):
-
libsupld1
+
libsupld1
-
osso-gpsd
+
osso-gpsd
-
libgpsmgr
+
libgpsmgr
-
libgpsbt (?)
+
libgpsbt (?)
-
gpsdriver
+
gpsdriver
2. Edit /etc/init.d/libgpsbt and change all instances of "user:users" to "YOURUSERNAME:users" There should be 2 instances you need to change.
2. Edit /etc/init.d/libgpsbt and change all instances of "user:users" to "YOURUSERNAME:users" There should be 2 instances you need to change.
-
3. Run: chown -R YOURUSERNAME:users /var/lib/gps
+
3. Run:
 +
chown -R YOURUSERNAME:users /var/lib/gps
4. Make the following files:
4. Make the following files:
-
/etc/default/gps5300driver.conf
+
/etc/default/gps5300driver.conf:
-
=================CUT====================
+
# /etc/default/gps5300driver.conf
 +
 +
# The user who can control the driver
 +
GPS5300_USER=root
 +
 +
# Whether the driver will self-initialize, may or may not work (more on the may not side)
 +
GPS5300_SELFINIT=true
-
# /etc/default/gps5300driver.conf
 
-
# The user who can control the driver
+
/etc/init.d/gps5300driver:
-
GPS5300_USER=root
+
#!/bin/bash
 +
 +
GPS5300_DRIVER='/usr/sbin/gps5300driver'
 +
GPS5300_PIDFILE='/var/run/gps5300driver.pid'
 +
GPS5300_PRELOAD='/usr/lib/libgps5300faker.so'
 +
CONF=/etc/default/gps5300driver.conf
 +
 +
if [ -f $CONF ]; then
 +
          . $CONF
 +
fi
 +
 +
case $1 in
 +
start)
 +
echo "Starting GPS5300 driver"
 +
if ! [ -e /sys/devices/platform/gpio-switch/gps_reset/state ]; then
 +
echo "gps_reset state gpio switch missing"
 +
# return 1
 +
fi
 +
 +
[ -z "${GPS5300_SELFINIT}" ] && GPS5300_SELFINIT=true
 +
${GPS5300_SELFINIT} || unset GPS5300_SELFINIT
 +
export GPS5300_SELFINIT
 +
 +
[ -z "${GPS5300_USER}" ] && GPS5300_USER=root
 +
export GPS5300_USER
 +
 +
export LD_PRELOAD=${GPS5300_PRELOAD}
 +
 +
start-stop-daemon --start \
 +
--quiet \
 +
--background \
 +
--pidfile "${GPS5300_PIDFILE}" \
 +
--make-pidfile \
 +
--exec "${GPS5300_DRIVER}"
 +
# --env "LD_PRELOAD=${GPS5300_PRELOAD}" \
 +
# --exec "${GPS5300_DRIVER}"
 +
# return 0
 +
;;
 +
 +
stop)
 +
echo "Stopping GPS5300 driver"
 +
start-stop-daemon --stop \
 +
--quiet \
 +
--pidfile "${GPS5300_PIDFILE}"
 +
rm ${GPS5300_PIDFILE}
 +
# return 0
 +
;;
 +
 +
restart|force-reload)
 +
$0 stop
 +
$0 start
 +
;;
 +
 +
*)
 +
echo "Usage: $0: {start|stop|restart|force-reload}"
 +
exit 1
 +
;;
 +
esac
-
# Whether the driver will self-initialize, may or may not work (more on the may not side)
+
5. Run
-
GPS5300_SELFINIT=true
+
cp /usr/sbin/gpsdriver /usr/sbin/gps5300driver
-
=================CUT====================
+
6. Put libgps5300faker.so in /usr/lib (Not posted anywhere yet):
 +
cp /path/to/libgps5300faker.so /usr/lib
-
/etc/init.d/gps5300driver
+
7. Reboot:
-
=================CUT====================
+
reboot
-
#!/bin/bash
+
8. Get ready to use the GPS:
 +
/etc/init.d/libgpsbt restart
 +
/etc/init.d/gpsdriver restart
 +
/etc/init.d/gps5300driver restart
-
GPS5300_DRIVER='/usr/sbin/gps5300driver'
+
9. Start GPSD:
-
GPS5300_PIDFILE='/var/run/gps5300driver.pid'
+
gpsd -n -N -D2 /dev/pgps
-
GPS5300_PRELOAD='/usr/lib/libgps5300faker.so'
+
-
CONF=/etc/default/gps5300driver.conf
+
-
 
+
-
if [ -f $CONF ]; then
+
-
        . $CONF
+
-
fi
+
-
 
+
-
case $1 in
+
-
start)
+
-
echo "Starting GPS5300 driver"
+
-
if ! [ -e /sys/devices/platform/gpio-switch/gps_reset/state ]; then
+
-
echo "gps_reset state gpio switch missing"
+
-
# return 1
+
-
fi
+
-
+
-
[ -z "${GPS5300_SELFINIT}" ] && GPS5300_SELFINIT=true
+
-
${GPS5300_SELFINIT} || unset GPS5300_SELFINIT
+
-
export GPS5300_SELFINIT
+
-
+
-
[ -z "${GPS5300_USER}" ] && GPS5300_USER=root
+
-
export GPS5300_USER
+
-
+
-
export LD_PRELOAD=${GPS5300_PRELOAD}
+
-
+
-
start-stop-daemon --start \
+
-
--quiet \
+
-
--background \
+
-
--pidfile "${GPS5300_PIDFILE}" \
+
-
--make-pidfile \
+
-
--exec "${GPS5300_DRIVER}"
+
-
# --env "LD_PRELOAD=${GPS5300_PRELOAD}" \
+
-
# --exec "${GPS5300_DRIVER}"
+
-
# return 0
+
-
;;
+
-
 
+
-
stop)
+
-
echo "Stopping GPS5300 driver"
+
-
start-stop-daemon --stop \
+
-
--quiet \
+
-
--pidfile "${GPS5300_PIDFILE}"
+
-
rm ${GPS5300_PIDFILE}
+
-
# return 0
+
-
;;
+
-
 
+
-
restart|force-reload)
+
-
$0 stop
+
-
$0 start
+
-
;;
+
-
 
+
-
*)
+
-
echo "Usage: $0: {start|stop|restart|force-reload}"
+
-
exit 1
+
-
;;
+
-
esac
+
-
 
+
-
=================CUT====================
+
-
 
+
-
5. Run "cp /usr/sbin/gpsdriver /usr/sbin/gps5300driver"
+
-
 
+
-
6. Put libgps5300faker.so in /usr/lib (Not posted anywhere yet)
+
-
 
+
-
7. Reboot
+
-
 
+
-
8. Run:
+
-
/etc/init.d/libgpsbt restart
+
-
/etc/init.d/gpsdriver restart
+
-
/etc/init.d/gps5300driver restart
+
-
 
+
-
9. Run: "gpsd -n -N -D2 /dev/pgps"
+
When you start getting messages like:
When you start getting messages like:
-
gpsd: <= GPS: $GPGGA,183757.000,4504.94573,N,09300.43367,W,1,04,2.7,288.8,M,-31.3,M,,*60
+
gpsd: <= GPS: $GPGGA,183757.000,4504.94573,N,09300.43367,W,1,04,2.7,288.8,M,-31.3,M,,*60
-
gpsd: <= GPS: $GPGLL,4504.94573,N,09300.43367,W,183757.000,A,A*42
+
gpsd: <= GPS: $GPGLL,4504.94573,N,09300.43367,W,183757.000,A,A*42
-
gpsd: can't use GGA/GGL time until after ZDA or RMC has supplied a year.
+
gpsd: can't use GGA/GGL time until after ZDA or RMC has supplied a year.
-
gpsd: <= GPS: $GPGSA,A,3,31,11,30,32,,,,,,,,,5.9,2.7,5.3*3D
+
gpsd: <= GPS: $GPGSA,A,3,31,11,30,32,,,,,,,,,5.9,2.7,5.3*3D
-
gpsd: <= GPS: $GPGST,183757.000,14.3,13.2,37.3,19.1,16.0,32.4,73.2*54
+
gpsd: <= GPS: $GPGST,183757.000,14.3,13.2,37.3,19.1,16.0,32.4,73.2*54
-
You've got a lock and are ready to use your GPS.
+
You have a lock and are ready to use your GPS.

Revision as of 18:09, 22 May 2009

These directions are confirmed to work on Mer 0.12.

All commands should be run as root.

All instances of "YOURUSERNAME" should be changed to whatever your user is named. Commands involving "YOURUSERNAME" [i]probably[/i] don't have to be run if your user is named "user", though this is unconfirmed.

The time to first fix (TTFF) is quite long (~30 min), and GPSD quits after the last client disconnects. Keep this in mind.

The formatting is completely messed up, so if you care to look at directions in any usable way, click the edit link.

1. Install the following packages from the Maemo Updates repository (you can install them on Maemo, then copy the packages from the apt cache):

libsupld1
osso-gpsd
libgpsmgr
libgpsbt (?)
gpsdriver

2. Edit /etc/init.d/libgpsbt and change all instances of "user:users" to "YOURUSERNAME:users" There should be 2 instances you need to change.

3. Run:

chown -R YOURUSERNAME:users /var/lib/gps

4. Make the following files:

/etc/default/gps5300driver.conf:

# /etc/default/gps5300driver.conf

# The user who can control the driver
GPS5300_USER=root

# Whether the driver will self-initialize, may or may not work (more on the may not side)
GPS5300_SELFINIT=true


/etc/init.d/gps5300driver:

#!/bin/bash

GPS5300_DRIVER='/usr/sbin/gps5300driver'
GPS5300_PIDFILE='/var/run/gps5300driver.pid'
GPS5300_PRELOAD='/usr/lib/libgps5300faker.so'
CONF=/etc/default/gps5300driver.conf

if [ -f $CONF ]; then
         . $CONF
fi

case $1 in
	start)
		echo "Starting GPS5300 driver"
		if ! [ -e /sys/devices/platform/gpio-switch/gps_reset/state ]; then
			echo "gps_reset state gpio switch missing"
#			return 1
		fi
			
		[ -z "${GPS5300_SELFINIT}" ] && GPS5300_SELFINIT=true
		${GPS5300_SELFINIT} || unset GPS5300_SELFINIT
		export GPS5300_SELFINIT
		
		[ -z "${GPS5300_USER}" ] && GPS5300_USER=root
		export GPS5300_USER
		
		export LD_PRELOAD=${GPS5300_PRELOAD}		
	
		start-stop-daemon --start \
			--quiet \
			--background \
			--pidfile "${GPS5300_PIDFILE}" \
			--make-pidfile \
			--exec "${GPS5300_DRIVER}"
#			--env "LD_PRELOAD=${GPS5300_PRELOAD}" \
#			--exec "${GPS5300_DRIVER}"
#		return 0
	;;

	stop)
		echo "Stopping GPS5300 driver"
		start-stop-daemon --stop \
			--quiet \
			--pidfile "${GPS5300_PIDFILE}"
		rm ${GPS5300_PIDFILE}
#		return 0
	;;

	restart|force-reload)
		$0 stop
		$0 start
	;;

	*)
		echo "Usage: $0: {start|stop|restart|force-reload}"
		exit 1
	;;
esac

5. Run

cp /usr/sbin/gpsdriver /usr/sbin/gps5300driver

6. Put libgps5300faker.so in /usr/lib (Not posted anywhere yet):

cp /path/to/libgps5300faker.so /usr/lib

7. Reboot:

reboot

8. Get ready to use the GPS:

/etc/init.d/libgpsbt restart
/etc/init.d/gpsdriver restart
/etc/init.d/gps5300driver restart

9. Start GPSD:

gpsd -n -N -D2 /dev/pgps

When you start getting messages like:

gpsd: <= GPS: $GPGGA,183757.000,4504.94573,N,09300.43367,W,1,04,2.7,288.8,M,-31.3,M,,*60
gpsd: <= GPS: $GPGLL,4504.94573,N,09300.43367,W,183757.000,A,A*42
gpsd: can't use GGA/GGL time until after ZDA or RMC has supplied a year.
gpsd: <= GPS: $GPGSA,A,3,31,11,30,32,,,,,,,,,5.9,2.7,5.3*3D
gpsd: <= GPS: $GPGST,183757.000,14.3,13.2,37.3,19.1,16.0,32.4,73.2*54

You have a lock and are ready to use your GPS.