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]# 
# bluetoothctl scan on
Discovery started
[CHG] Controller 90:4C:E5:DC:C1:9A Discovering: yes
[NEW] Device 00:30:04:0B:24:1E 00-30-04-0B-24-1E
[CHG] Device 44:E4:EE:BB:9D:EA RSSI: -92
[CHG] Device 00:30:04:0B:24:1E LegacyPairing: no
[CHG] Device 00:30:04:0B:24:1E Name: LEADTEK 9580
[CHG] Device 00:30:04:0B:24:1E Alias: LEADTEK 9580
[CHG] Device 00:30:04:0B:24:1E LegacyPairing: yes

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
 
linux/bluetooth-gps.txt · Last modified: 11/04/2023 01:04 by andrew