Tag Bluetooth

Bluetooth GPS on the mini2440 with GPSd

For a long time i've had a SiRF 3 bluetooth GPS which i've just connected to the mini2440 using a ludicrously cheap USB bluetooth adapter from DealExtreme. Including shipping it cost £1.38 delivered!! Here's what you get for your money:

image1

image2

The chip is a Conwise CW6626. Anyway, what matters most is that if you have bluetooth configured it works out of the box!

Connecting to the GPS is easy. First check the interface:

hciconfig -a

If it says down bring it up:

hciconfig hci0 up

After executing the above I got the following:

root@mini2440:~# hciconfig -a
hci0: Type: USB
BD Address: 00:15:83:15:A3:10 ACL MTU: 672:3 SCO MTU: 128:2
UP RUNNING
RX bytes:348 acl:0 sco:0 events:11 errors:0
TX bytes:38 acl:0 sco:0 commands:11 errors:0
Features: 0xff 0x3e 0x85 0x30 0x18 0x18 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: ''
Class: 0x000208
Service Classes: Unspecified
Device Class: Phone, Cordless
HCI Ver: 2.0 (0x3) HCI Rev: 0xc5c LMP Ver: 2.0 (0x3) LMP Subver: 0xc5c
Manufacturer: Cambridge Silicon Radio (10)

Now turn your GPS on and do a scan:

root@mini2440:~# hcitool scan
Scanning ...
00:0D:B5:32:2C:02 BT-GPS-322C02

Now fill in /etc/bluetooth/rfcomm.conf with the details. Here's mine:

#
# RFCOMM configuration file.
#
rfcomm0 {
# Automatically bind the device at startup
bind yes;

# Bluetooth address of the device
device 00:0D:B5:32:2C:02;

# RFCOMM channel for the connection
channel 1;

# Description of the connection
comment "BT-GPS-322C02";
}

Next bind the device:

rfcomm bind rfcomm0

And check the device output using:

cat /dev/rfcomm0

Next i bitbaked gpsd, by simply typing:

bitbake gpsd

In my OE installation (see the various posts about setting this up).

Once this builds you can install the appropriate ipks. From memory I think i installed the following:

gpsd_2.39-r0.5_armv4t.ipk

gpsd-static_2.39-r0.5_armv4t.ipk

gpsd-gpsctl_2.39-r0.5_armv4t.ipk

gps-utils_2.39-r0.5_armv4t.ipk

libgps18_2.39-r0.5_armv4t.ipk

This pulled in a whole load of other packages. Next you can start gpsd by typing:

gpsd /dev/rfcomm0

And monitor the output using:

gpsmon

If all has gone well you should get a text output of the parsed NMEA data:

image3

Anyway..that's just the tip of the iceburg. If you want to learn more have a look at the gpsd website and the bluetooth page i have based this post on.