This how too describes how to get your bluetooth GPS device to work under linux
This is my second how too and parts of the files needed were installed at different times ie the bluetooth a few months ago so if anyone has any problems / suggestions let me know ![Smile](images/smilies/icon_smile.gif)
Step 1
install the needed bluetooth files:
Code:
sudo apt-get install bluez-pin
sudo apt-get install bluez-utils
Then edit the main bluetooth config file:
Code:
sudo gedit /etc/bluetooth/hcid.conf
delete everything in the file and replace it with:
Code:
#
# HCI daemon configuration file.
#
# HCId options
options {
# Automatically initialize new devices
autoinit yes;
# Security Manager mode
# none - Security manager disabled
# auto - Use local PIN for incoming connections
# user - Always ask user for a PIN
#
security user;
# Pairing mode
# none - Pairing disabled
# multi - Allow pairing with already paired devices
# once - Pair once and deny successive attempts
pairing multi;
# PIN helper
pin_helper /usr/bin/bluepin;
# D-Bus PIN helper
#dbus_pin_helper;
}
# Default settings for HCI devices
device {
# Local device name
# %d - device id
# %h - host name
name "Nino's Laptop";
# Local device class
class 0x3e0100;
# Default packet type
#pkt_type DH1,DM1,HV1;
# Inquiry and Page scan
iscan enable; pscan enable;
# Default link mode
# none - no specific policy
# accept - always accept incoming connections
# master - become master on incoming connections,
# deny role switch on outgoing connections
lm accept;
# Default link policy
# none - no specific policy
# rswitch - allow role switch
# hold - allow hold mode
# sniff - allow sniff mode
# park - allow park mode
lp rswitch,hold,sniff,park;
# Authentication and Encryption (Security Mode 3)
#auth enable;
#encrypt enable;
}
restart the bluetooth services
Code:
sudo /etc/init.d/bluez-utils restart
and now to test the bluetooth:
this should return a list of devices like:
Code:
00:16:4E:D7:AE:5F Nokia N70
00:12:62:AF:C0:6E Nino
00:11:67:80:41:96 BT-GPS
Step 2
With the bluetooth we need to create a serial connection between our GPS device and the computer
to do this we first need some information on the device; the MAC code and the serial port.
do a
and take the MAC address of the GPS unit in my case:
00:16:4E
7:AE:5F Nokia N70
00:12:62:AF:C0:6E Nino
00:11:67:80:41:96 BT-GPS
so i want: 00:11:67:80:41:96
to get the serial port do
Code:
sdptool browse 00:11:67:80:41:96
which will return
Code:
Browsing 00:11:67:80:41:96 ...
Service Name: Bluetooth Serial Port
Service RecHandle: 0x10007
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Serial Port" (0x1101)
Version: 0x0100
the channel we want is 1
now create a file in /etc/bluetooth/ called rfcomm
Code:
sudo gedit /etc/bluetooth/rfcomm.conf
adding an entry:
Code:
rfcomm4 {
bind yes;
device < GPS MAC ADDRESS>;
channel 1;
comment "Serial Port";
}
to start using the GPS type:
if for some reason you get
"Can't create RFCOMM TTY: Address already in use"
do:
Code:
sudo rfcomm release 4
again followed by
that should display:
nino@laptop:~$ rfcomm connect 4
Connected /dev/rfcomm4 to 00:11:67:80:41:96 on channel 1
Press CTRL-C for hangup
any GPS software you are gonna use will make use of the /dev/rfcomm4
Step 3
Now to test the GPS install the GPS utils
Code:
sudo apt-get install gpsd-clients
sudo apt-get install gpsd
the GPSD is the daemon for the GPS reciever so we want to bind the service with the device:
and finally to see if were getting any information from the GPS device run
![](http://nino.me.uk/gallery/albums/userpics/10001/desktop1.png)
if you want a tracking program have a looky at gpsdrive
![](http://nino.me.uk/gallery/albums/userpics/10001/normal_desktop2.png)
Enjoy ![Very Happy](images/smilies/icon_biggrin.gif)
Nino