LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-24-2009, 07:53 PM   #1
Slokunshialgo
Member
 
Registered: Jan 2006
Distribution: Ubuntu 9.04, Fedora 10
Posts: 76

Rep: Reputation: 17
Bluetooth GPS


Well, this one is a two part problem: Connecting, and using. I have a bluetooth GPS device for use with my palm pilot, that I was hoping I would be able to put to use with my laptop. Specifically, it's a Garmin Mobile 10, if that is of any help here.

The first problem is being able to link the two devices up over Bluetooth. When I try connecting to it using Gnome's Bluetooth Applet, the laptop sends out the usual four-digit number that needs to be returned as a security precaution. Problem is, it chooses a random four digits, and the GPS is designed to return only 1234. Since I don't want to try up to a statistical 8999 attempts, here's the first question: Is there any way of forcing the number 1234 to be sent, rather than a random number?

I know I could go, grab the source code, modify this little part of it, compile, launch, connect, have it added to the known list, then go back to using the normal version, but this is a bit more than I'd like the do.

The second part is actually using it, and since I need the first solved, I've yet to be able to even try this. I've used a serial GPS connected via serial-USB adapter, and have it work in GPSDrive, pretty sure by pointing the interface to /dev/ttyUSB0. Not 100% sure on this, seeing as I grabbed it from dmesg at the time. Now, if I was somehow able to get the GPS connected to the laptop, what interface/device should I enter, since it would be through BT? Can it even be done?

Any help on either of these problems is much appreciated.
 
Old 01-24-2009, 08:41 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Well I can't say that I have any idea how you would configure any of this through a GUI, let alone GNOME's interface. But you can certainly use a Bluetooth GPS receiver. You need to setup RFCOMM, which essentially gives you a virtual serial port over BT. Once this is done, the GPS device would work just like the wired one you used previously.

To set the default PIN on your machine, you would edit the file "/etc/bluetooth/hcid.conf". Look for a line that says "passkey:" and change whatever is there to "1234".

Then you would find the device's BT MAC (assuming you don't already know it). For this you just run "hcitool scan" when the device is in discoverable mode.

To setup a permanent RFCOMM connection you need to edit the file "/etc/bluetooth/rfcomm.conf". You would edit it something like this (the only thing you would really need to add would be the BT MAC):

Code:
#
# RFCOMM configuration file.
#

rfcomm0 {
	# Automatically bind the device at startup
	bind no;

	# Bluetooth address of the device
	device aa:bb:cc:dd:ee:ff;

	# RFCOMM channel for the connection
	channel	1;

        # Description of the connection
        comment "Bluetooth GPS Receiver";
}
At this point you need to restart BlueZ. You didn't say which distribution you were using so I couldn't say specifically how to restart the service in your case; so you could simply reboot.

After that you should just need to enable the RFCOMM link with a command like:

Code:
sudo rfcomm bind /dev/rfcomm0 aa:bb:cc:dd:ee:ff
This will bind the BT GPS to the device /dev/rfcomm0, which you can then give to your GPS software as if it was a USB or serial GPS receiver. The software shouldn't need to know anything more than that, as it will appear as a normal serial port.

Note:

This all assumes you are using BlueZ 3.x, which is still the standard. If your distribution has switched over to the newer and less supported BlueZ 4.x, then disregard basically everything I just said. Then hope somebody has used a GPS under BlueZ 4.x and can walk you through it, because it is much harder to work with than the 3.x series.
 
1 members found this post helpful.
Old 02-07-2012, 03:34 PM   #3
Fitch
LQ Newbie
 
Registered: Feb 2011
Location: Edinburgh
Distribution: Ubuntu 18.04
Posts: 27

Rep: Reputation: 1
Hi there!

I've done the above, and actually got somewhere!

I also did:

$ hcitool scan
Scanning ...
00:0B:0D:6E:15:38 BT-GPS


$ sdptool browse 00:0B:0D:6E:15:38
Browsing 00:0B:0D:6E:15:38 ...
Service Name: SPP slave
Service Description: Bluetooth SPP V1.01
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


gpsd /dev/rfcomm0
alistair@alistair ~ $ ls -l /dev/rfcom*
crw-rw---- 1 root dialout 216, 0 2012-02-07 21:19 /dev/rfcomm0

$ sudo telnet localhost 2947
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"class":"VERSION","release":"2.95","rev":"2010-12-03T21:16:23","proto_major":3,"proto_minor":3}
^]

telnet>

And that's it. No data stream.

If I do:
$ cat /dev/rfcomm0

It just hangs there until I do a Control C.

When running xgps, all I get is the "{"class":"VERSION","release":"2. blah blah" you see 9 or 10 lines above this line. in the Responses box.
So it sees the GPS alright, but doesn't get any GPS data from it. I've been trying to get this thing working for three months now, and I know I'm close....

Last edited by Fitch; 02-07-2012 at 03:46 PM. Reason: Extra info
 
  


Reply

Tags
bluetooth, gps, gpsdrive



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bluetooth not working on FC6 with Targus USB bluetooth adapter mikevicious Linux - Software 1 12-11-2009 09:03 AM
can't get gpsd to work with bluetooth gps mageus Linux - Software 0 03-20-2007 11:18 PM
Bluetooth GPS on Linux TB0ne Linux - Hardware 1 09-24-2006 03:05 PM
Is one GPS better than another? MasterC Linux - Laptop and Netbook 3 05-29-2006 09:17 PM
How to set up bluetooth gps as ttyX alek66 Linux - General 0 04-10-2006 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration