Navigatrix.net - A Voyager's Companion
http://navigatrix.net/

Blue Tooth GPS
http://navigatrix.net/viewtopic.php?f=4&t=481
Page 1 of 1

Author:  GoneTroppo [ 16 Aug 2013, 21:15 ]
Post subject:  Blue Tooth GPS

I have a Toughbook CF 19 with inbuilt BT. The BT manager connects ok to mouse and GPS and says GPS available on serial port /dev/rfcomm0 But OpenCPN and XGPS do not receive any data fron the GPS, have tried reconfig gpsd to look at rfcomm but still no joy. Any thoughts on how to find where the breakdown is.
Regards, Steve

Author:  Moe [ 16 Aug 2013, 22:30 ]
Post subject:  Re: Blue Tooth GPS

When you tried reconfiguring gpsd did you use sudo dpkg-reconfigure gpsd? You could be bold and daring by editing /etc/default/gpsd. Three lines after
Quote:
# Please do not edit this file directly - use `dpkg-reconfigure gpsd' to
# change the options.
change line #6 to
Code:
DEVICES="/dev/rfcomm0"
...but I'm at a loss why the udev rules aren't picking it up. They claim this will not prevent future recognition of USB gps devices.

There is a script, /usr/local/bin/comports, that runs on the launch of a few applications to keep down the phenomenon of port hopping, incrementing the location (name) of the device from removal/reinsertion or the order of insertion so applications like Airmail don't get lost or need resetting just because you plugged in your gizmos in a different order.

Now that OpenCPN is gpsd compliant I don't know if it is necessary to call it up with the launch of OpenCPN...it's all magical but toss in bluetooth and it becomes voodoo.

But, it shouldn't effect the gpsd...

The gpsd folk recommend editing /etc/bluetooth/rfcomm.conf.

Code:
sudo medit /etc/bluetooth/rfcomm.conf
Replacing xx:xx:xx.... with the data your get from sudo hciconfig hci0 up and sudo hcitool scan to look like
Code:
#
   # 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";
   }
Then execute sudo rfcomm bind rfcomm0 or reboot if you've reconfigured the gpsd.

Give that a whirl.

Author:  GoneTroppo [ 17 Aug 2013, 00:37 ]
Post subject:  Re: Blue Tooth GPS

Hi Moe, Had a look at /etc/default/gpsd and it showed line 6 with rfcomm0 there. Xgps shows rfcomm0 as the device it is using. Executed /usr/local/bin/comports to see if it helped. Looked at /etc/bluetooth/rfcomm.conf and all lines begin with #.
Entered sudo hciconfig hci0 up and then sudo hcitool scan, it came back with scanning but saw no results. So I guess that is not right.

Author:  Moe [ 17 Aug 2013, 01:27 ]
Post subject:  Re: Blue Tooth GPS

Coincidentlaly, I bought a bluetooth transceiver when I saw you in Panama so I could understand what happens in that area, never having had one before.

Just back from the store, placed the dongle in my shirt pocket to free my hands to untie the dinghy; bending over <plop>...down to the bottom it went. I threaten to buy another but as yet haven't. Bluetooth is blackmagic in my book.

Can you pick up the xx:xx:xx:... ID for the device through the Bluetooth Manager? or any of the bluetooth related magic tools?

Author:  Moe [ 17 Aug 2013, 01:56 ]
Post subject:  Re: Blue Tooth GPS

GoneTroppo wrote:
<snip>Xgps shows rfcomm0 as the device it is using. <snip>
Another thought is on a cold-cold start; where the gps has not been run for some time; it will take up to 29 minutes to update the satellite ephemeris so it can return a fix. Typically a cold start won't take that long, but 29 is the extreme.

...just running xgps, what happens if you go work on another pump?

Author:  GoneTroppo [ 17 Aug 2013, 02:34 ]
Post subject:  Re: Blue Tooth GPS

Just love donating stuff to Neptune. This BT gps worked all the way from Portugal to Oz in NX on old(dead) notebook. BT manager is simple which makes it easy to use, but not good if looking for nitty gritty.
I cannot find any details on rfcomm0, it is as if it does not really exist, closest is
nx@nx:~$ rfcomm
rfcomm0: 00:23:06:D7:8D:19 -> 00:1C:88:11:0C:02 channel 1 connected [reuse-dlc tty-attached]
nx@nx:~$
But I really do not know what I am doing, just pokin and proddin. Will go and tease the wife, that should give me a restart. :?

Author:  Moe [ 17 Aug 2013, 02:57 ]
Post subject:  Re: Blue Tooth GPS

I'll pick up something bluetooth so I can at least play along. Today, 5PM rolled around before I even considered going to the closest shop. But maybe someone else will chime in before I get on the bicycle.

Author:  GoneTroppo [ 17 Aug 2013, 03:44 ]
Post subject:  Re: Blue Tooth GPS

Used nx@nx:~$ hcitool con
Connections:
< ACL 00:1D:D8:98:33:C7 handle 47 state 1 lm MASTER
< ACL 00:1C:88:11:0C:02 handle 42 state 1 lm SLAVE AUTH ENCRYPT
nx@nx:~$
The slave connection is the gps, edited rfcomm.conf and then
nx@nx:~$ hcitool scan
Scanning ...
nx@nx:~$ rfcomm
rfcomm0: 00:1C:88:11:0C:02 channel 1 clean
rfcomm1: 00:23:06:D7:8D:19 -> 00:1C:88:11:0C:02 channel 1 connected [reuse-dlc tty-attached]
nx@nx:~$
So have moved a bit, but still no joy. Anyway lots of fun playing around, will try and read some more about BT on web tomorrow. :D

Author:  Moe [ 17 Aug 2013, 04:34 ]
Post subject:  Re: Blue Tooth GPS

Yeah, gut impression is that it's something simple being overlooked. I'm just operating in the dark at the moment.

It does, however, look like your gps (00:23:06:D7:8D:19, I think) is on /dev/rfcomm1....which is fine, if it just stays there and doesn't revert to /dev/rfcomm0. Then gpsd could pick it up there.

Author:  GoneTroppo [ 17 Aug 2013, 22:50 ]
Post subject:  Re: Blue Tooth GPS

00:23:06:D7:8D:19, seems to be the address of the BT unit.
Had some progress and then crashed system a couple of times :shock: Saved all terminal entries to a file but the last crash killed the file. :( Followed part of this tutorial http://ubuntuforums.org/showthread.php?t=200142 Actually got down to the rfcomm connect and got response denied type response so put sudo in front and got connected response, a few seconds after ctl-c system crashes. Think I need to read some more after a break.

Author:  Moe [ 19 Aug 2013, 07:37 ]
Post subject:  Re: Blue Tooth GPS

I tend to be a GUI guy. Visual clues mean there's less to remember.

Too cheap to buy a Bluetooth GPS, I picked up a Bluetooth dongle and slapped it in to find my neighbour's laptop and wireless speakers.
Attachment:
bluetooth paring.png
bluetooth paring.png [ 47.15 KiB | Viewed 24717 times ]
If you don't see my neighbour's stuff, do you see your own?

What happens when you try to 'pair' it?

Author:  GoneTroppo [ 19 Aug 2013, 22:42 ]
Post subject:  Re: Blue Tooth GPS

Yep, I see my mouse and gps and can add and pair, after entering code, to both, and then connect the mouse as an input and the gps as a serial. I get the response that the gps is available on rfcomm0, so all should be OK but is a no go. The mouse works fine and even auto connects after reboots. :D

Author:  Moe [ 20 Aug 2013, 00:12 ]
Post subject:  Re: Blue Tooth GPS

You had stated when you launch xgps that /dev/rfcomm0 shows up in the little window....

Launch it again...when /dev/rfcomm0 shows up, leave it running and work on another pump. Come back in a half hour and look.

Author:  GoneTroppo [ 20 Aug 2013, 03:24 ]
Post subject:  Re: Blue Tooth GPS

Thanks Moe.
Tested the gps again with windows and all OK. Then rebooted with nx and checked /dev/rfcomm0 was in xgps and left it for 45 minutes, no joy. As I have two nx usb sticks thought I would do the same with the second stick as I have not done any playing with that one. After reconfig gpsd & reboot, checked for /dev/rfcomm0 in xgps, it is there along with the usb port it last used. After 50 minutes still no joy.
This is not urgent Moe so donĀ“t lose any sleep over it. :)

Author:  GoneTroppo [ 20 Aug 2013, 22:48 ]
Post subject:  Re: Blue Tooth GPS

Read a bit more re response from rfcomm rfcomm0: 00:23:06:D7:8D:19 -> 00:1C:88:11:0C:02 channel 1 connected [reuse-dlc tty-attached]
Decided to play a bit more, so in the BT manager removed the gps and then from terminal did hcitool scan then re-edited rfcomm.conf, had a look with hciconfig and then tried sudo rfcomm connect hci0 again. Got the connected reponse and after ctl-c crashed the system again. On rebooting checked BT manager and found the mouse & gps were both connected, normally I had to connect gps to serial port. Checked xgps and it was working with rfcomm0, :D :D .
Now when I rfcomm I get the response
rfcomm0: 00:1C:88:11:0C:02 channel 1 connected [tty-attached]
Not sure what changed the only difference was removing the device in BT manager before playing. Will now try the same on the other usb stick.

Author:  GoneTroppo [ 21 Aug 2013, 00:38 ]
Post subject:  Re: Blue Tooth GPS

Hi Moe, using the spare nx usb stick I connected the gps with BT Manager and then in terminal
nx@nx:~$ rfcomm
rfcomm0: 00:23:06:D7:8D:19 -> 00:1C:88:11:0C:02 channel 1 connected [reuse-dlc tty-attached]
Then removed the gps device in BT manager. Then in terminal
nx@nx:~$ sudo medit /etc/bluetooth/rfcomm.conf (as Moe said above)

# RFCOMM configuration file.
#
# # Automatically bind the device at startup
bind yes;
#
# # Bluetooth address of the device
device 00:1C:88:11:0C:02;
#
# # RFCOMM channel for the connection
channel 1;
#
# # Description of the connection
# comment "Example Bluetooth device";
}

Then in terminal
nx@nx:~$ hcitool scan
Scanning ...
00:1C:88:11:0C:02 iBT-GPS
nx@nx:~$ rfcomm
nx@nx:~$
At this point I rebooted and the gps was auto connected to rfcomm0 in BT manager
nx@nx:~$ rfcomm
rfcomm0: 00:1C:88:11:0C:02 channel 1 connected [tty-attached]
Xgps was happy and all is right with the world :D
Thanks Moe.

Author:  Moe [ 21 Aug 2013, 00:59 ]
Post subject:  Re: Blue Tooth GPS

Whew! The idea of letting it run was to rule out outdated ephemeris from you sitting on the hard...obviously not the issue.

Well done. Glad it's sorted out.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/