Friday, September 4, 2009

Setup GPS on Zubuntu

First, to setup the bluetooth connection I need to install bluez,

apt-get install bluez
Next, gpsd,
apt-get install gpsd
And last tangoGPS, to present a moving map using the OpenStreetMap project (or other sources...)
apt-get install tangogps

Next setup the bluetooth connection. I'll be using rfcomm, the configuration file can be found under /etc/bluetooth/rfcomm.conf. I'm using this one. To find the bluetooth address of the device I use (after I turn on the gps, obviously),
hcitool scan
The hcid.conf is missing in Zubuntu for some reason, so I create it (under /etc/bluetooth/hcid.conf). I'm using this hcid.conf.
The pin code is saved under /etc/bluetooth/pin, and can be generated by
echo "0000" > /etc/bluetooth/pin
or any other pin code.
I also need to create the /bin/bluepincat.sh script for hcid, which contains,
#!/bin/sh
echo -n "PIN:"
cat /etc/bluetooth/pin
To bind rfcomm0 with the gps I do
rfcomm bind /dev/rfcomm0

The configuration for gpsd is under /etc/default/gpsd, there START_DAEMON should be set to "true" and DEVICES should point to "/dev/rfcomm0". To start the gpsd daemon,
/etc/init.d/gpsd start

Now I can start using tangoGPS and connect to my bluetooth GPS device.

No comments:

Post a Comment