Bluetooth GPS

Find out your Bluetooth GPS device MAC:-

[root@q1]# hcitool scan
Scanning ...
        00:30:04:0B:24:1E       LEADTEK 9580
        00:01:E3:B8:AA:3C       S68H
[root@q1]# 

Use this MAC address below:-

[root@q1 sysconfig]# more gpsd 
OPTIONS="-n"
#DEVICE="/dev/ttyUSB0"
DEVICE="/dev/rfcomm0"
[root@q1 sysconfig]#
[root@q1 ~]# cat bluetooth-gps.sh 
#!/bin/bash
#Start bluetooth GPS and start gpsd

BLUETOOTHMAC=00:30:04:0B:24:1E

rfcomm bind /dev/rfcomm0 ${BLUETOOTHMAC}

hcitool cc  ${BLUETOOTHMAC}


/etc/init.d/gpsd restart

gpsmon 
[root@q1 ~]# 

to edit:-

hcitool inq

Output:

Inquiring ...
11:22:33:44:55:66       clock offset: 0x0e82    class: 0x011f00
        
dptool search --bdaddr 11:22:33:44:55:66 SP

Output:

Searching for SP on 11:22:33:44:55:66 ...
Service Name: Dev B
Service RecHandle: 0x10000
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
  
  
Edit your rfcomm.conf it should look something like this:

#
# RFCOMM configuration file.
#

rfcomm0 {
        bind yes;
        device 11:22:33:44:55:66;
        channel 1;
        comment "NOKIA LD-3W";
}

rfcomm connect rfcomm0 11:22:33:44:55:66 1

This command will create your tty device node located at /dev/rfcomm0

telnet localhost 2947

rb/bluetooth-gps.txt · Last modified: 27/04/2016 00:17 by andrew