summaryrefslogtreecommitdiff
path: root/www/bt.html
blob: f7f57fafb09490c9ff15a052c5afa47a23488864 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Author" content="Remco Treffkorn">
   <meta name="Description" content="GPSd is a utility that can listen to a GPS or Loran Receiver and re-publish the positional data in a simpler format.">
   <meta name="Keywords" content="GPS, translator, mxmap, GIS">
   <link rel="stylesheet" href="main.css" type="text/css"/>
   <title>Bluetooth and GPSd</title>
</head>

<body>

<div id="Header">
Bluetooth and <code>gpsd</code>
</div>

<div id="Menu">
    <img src="gpsd-logo-small.png"/><br />
    <a href="index.html">Home</a><br/>
    <a href="index.html#news">News</a><br/>

    <a href="index.html#downloads">Downloads</a><br/>
    <a href="index.html#mailing-lists">Mailing lists</a><br/>
    <a href="index.html#documentation">Documentation</a><br/>
    <a href="xgps-sample.html">Screenshots</a><br/>
    <a href="index.html#recipes">Recipes</a><br/>
    <a href="index.html#others">Other GPSDs</a><br/>

    <a href="hardware.html">Hardware</a><br/>
    <a href="hacking.html">Hacker's Guide</a><br/>
    <a href="compatibility">Application Compatibility</a>
    <a href="references.html">References</a><br/>
    <a href="history.html">History</a><br/>

    <a href='http://www.catb.org/hacker-emblem/'><img
    src='http://www.catb.org/hacker-emblem/glider.png'
    alt='hacker emblem' /></a><br />

    <a href="http://validator.w3.org/check/referer"><img
          src="http://www.w3.org/Icons/valid-xhtml10"
          alt="Valid XHTML 1.0!" height="31" width="88" /></a>
</div>

<div id="Content">

<p>Bluetooth connections work with gpsd by leveraging rfcomm.  Rfcomm
provides a serial port interface to a BT device and has been designed
to allow for automated connect/disconnect operations over bluetooth.
The steps below will allow you to use your BT GPS device automatically
whenever it is powered on and gpsd is running.</p>

<p>Note that you must be logged in as root for most of these steps.
<ol>
<li><p>First, the Bluez protcol stack must be installed.  All the
documentation can be found on <a
href='http://bluez.sourceforge.net/'>http://bluez.sourceforge.net/</a>.</p></li>
<li><p>Install bluetooth for your device with the "rfcomm" module to
allow for serial port emulation.</p></li>

<li><p>Next, load the modules:
<pre>
	# modprobe hci_xxx (xxx depend on your type of device)
	# modprobe bluez
	# modprobe l2cap
	# modprobe rfcomm
</pre>
</p></li>

<li><p>If the modules have loaded successfully, type "hciconfig" and you 
should see your BT interface listed under the "hci0" name.</p></li>

<li><p>Turn on your BT GPS device and scan for remote BT devices:</li>
<pre>
	# hciconfig hci0 up
	# hcitool scan
</pre>

<li><p>Write down the address of your BT GPS receiver (xx:xx:xx:xx:xx:xx)</p>

<li><p>Set up rfcomm.  Edit /etc/bluetooth/rfcomm.conf to reflect your BT
GPS address and to enable binding.</p></li>

<pre>
	#
	# RFCOMM configuration file.
	#
	# $Id: rfcomm.conf,v 1.1 2002/10/07 05:58:18 maxk Exp $
	#
	
	rfcomm0 {
	        # Automatically bind the device at startup
	        bind yes;
	
	        # Bluetooth address of the device
	        device xx:xx:xx:xx:xx:xx;
	
	        # RFCOMM channel for the connection
	        channel 1;
	
	        # Description of the connection
	        comment "Your GPS Device Here";
	}
</pre>

<li><p>Bind rfcomm0 (unless you are planning to reboot, in which case
it will be automatically bound, but there is really no reason to
reboot).</p></li>

<pre>
	# rfcomm bind rfcomm0
</pre>

<li><p>Edit /etc/init.d/gpsd so that it automatically starts up
listening to /dev/rfcomm0</p>

<pre>
	...
	#GPS_DEV="/dev/ttyS3"
	GPS_DEV="/dev/rfcomm0"
	...
</pre>

<li><p>Restart gpsd to apply the change above</p>
<pre>
	# killall -HUP gpsd
</pre>

<li><p>Connect to gpsd to test</p>
<pre>
	# telnet localhost 2947
	# r
</pre>

<p>You should see NMEA sentences stream by.  Close telnet.</p>
<pre>
	# ^c
	# e
</pre>

</ol>

<p>At this point, your system should be configured to use gpsd with
your BT GPS device!</p>

<p>Known Issues:</p>
<ul>
<li><p>On system startup, gpsd starts before rfcomm0 is bound by rfcomm
and fails (at least on some systems) - a workaround for this is to add
a symlink to the gpsd init.d script to a later runlevel.</p></li>
<pre>
# cd /etc/rcS.d/
# ln -s ../init.d/gpsd S89gpsd
</pre>
</ul>

<p>Contributors:</p>
<ul>
<li><p>Jean-Michel Bouffard</p></li>
<li><p>Joshua Layne</p></li>
</ul>

</div>
<hr/>
<script language="JavaScript" src="datestamp.js" type='text/javascript'></script>
</body>
</html>