LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices



Reply
 
Search this Thread
Old 07-04-2010, 08:08 PM   #16
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51

as per this site ( used it to check some more diags) http://www.gentoo.org/doc/en/bluetooth-guide.xml I dont even have the hcid.conf located on my system. also, the correct sysntax of the rfcomm bind command requires the mac of the device ( changed things around and tried it) which makes no diff. I am still able to see the data stream from the device; which is by the way, in a window sill. all lights / commands indicate device is paired and streaming data. however, nothing seems to be able to acces this data ( even with gpsd running).
 
Old 07-05-2010, 01:53 PM   #17
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
I am sorry to admit that I am beginning to run out of ideas here.
I have a horrible suspicion I have assumed something that will turn out not to be the case...

- We have established your device isn't "bricked", because it still works with win.
- We have established that gpsd is running, and attached to the right port (/dev/rfcomm0)
- We have sort-of established that you can see the data stream from your GPS device
Does it look something like this:

Code:
$GPGSV,3,1,09,29,74,185,20,31,57,290,27,30,65,090,,12,30,092,*78
$GPGSV,3,2,09,02,26,052,,14,18,224,,21,04,173,,16,02,276,*7C
$GPGSV,3,3,09,23,01,345,*42
$GPRMC,171138.506,V,,,,,,,050710,,*22
$GPGGA,171139.506,,,,,0,00,,,M,0.0,M,,0000*59
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPRMC,171139.506,V,,,,,,,050710,,*23
$GPGGA,171140.506,,,,,0,00,,,M,0.0,M,,0000*57
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPRMC,171140.506,V,,,,,,,050710,,*2D
$GPGGA,171141.506,,,,,0,00,,,M,0.0,M,,0000*56
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPRMC,171141.506,V,,,,,,,050710,,*2C
$GPGGA,171142.510,,,,,0,00,,,M,0.0,M,,0000*52
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPRMC,171142.510,V,,,,,,,050710,,*28
$GPGGA,171143.506,,,,,0,00,,,M,0.0,M,,0000*54
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,3,1,09,29,74,185,20,31,57,290,28,30,65,090,,12,30,092,*77
$GPGSV,3,2,09,02,26,052,,14,18,224,,21,04,173,,16,02,276,*7C
$GPGSV,3,3,09,23,01,345,*42
$GPRMC,171143.506,V,,,,,,,050710,,*2E
The above is mostly rubbish, as my device doesn't have a fix yet, but you'll get the idea of what an NMEA stream should look like.

I'd like you to confirm that the data stream you have occasionally seen from /dev/rfcomm0 is similar in format.

The following information may help you narrow things down a bit:

If I start xgps:
- With gpsd running, but no connection to my USB receiver (because I have unplugged it) then it shows a NSEW labelled circle, with no satellite positions in "Skyview" (In xgps: View.. Skyview)
After a short delay it then says "gpsd has stopped sending data [OK]"

- Without gpsd running, it shows me the xgps window, but says "gpsd is not running [Cancel]"

- With my gps device connected, and gpsd started with gpsd -bn /path/to/my/GPS-receiver
it works, showing me skyview, with the satellite positions, and signal strengths (red, amber, green).

Right now I think your problem possibly lies with how you have set up bluetooth. But I don't have a similar device to play with, and have minimal experience with bluetooth.

One last thing:
Quote:
So this is what i got so far:
paired with device
getting data stream from device ( using cat /dev/rfcomm0 to check )
started gpsd with -bn switch pointing it to /dev/rfcomm0 ( I actually set up rfcomm to bind to this file) I have no other listing for any rfcomm devices.
If you are running cat /dev/rfcomm0 when you are starting gpsd, it may not work, because cat may have hold of the data stream. Not 100% sure of this, just try not to do too many things at once (even if linux is brilliant at multitasking, it can sometimes turn round and bite you in the a**).

One step at a time.

HTH.
 
1 members found this post helpful.
Old 07-05-2010, 05:00 PM   #18
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
sending from work.

A numbered list of answers//

1. i AM seeing the location codes
Code:
$GPGSV,3,1,09,29,74,185,20,31,57,290,27,30,65,090,,12,30,092,*78
$GPGSV,3,2,09,02,26,052,,14,18,224,,21,04,173,,16,02,276,*7C
$GPGSV,3,3,09,23,01,345,*42
$GPRMC,171138.506,V,,,,,,,050710,,*22
$GPGGA,171139.506,,,,,0,00,,,M,0.0,M,,0000*59
2. I have ran gpsd with and without running cat against /dev/ with no change in the end results.

3. I think I may try ripping out unloading the bluetooth module and starting everything from scratch. Its odd how the gnome-bluetooth util in the panel doesnt "establish" the connection with the device. while it does pair the device.I actually have to run rfcomm from shell to get the connection "ACTIVE". The panel app faults out as well when I try to disconnect ( i think this is due to the permissions holding the connection though) . Anyways, I know the device works. i know rfcomm works. I think gpsd works ( xgps / tangogps / gpsdrive are another story. When i get home I will try rollinmg back to a older version of gpsd . I have heard that I may be looking at a issue between tangogps and the new API ( no i dont know what that is was just told that it was the likely culprit) of gpsd.

will post back what i find out. Also, as i will be building a file server tonight I will try it out on the system prior to update or any other modification.

Thanks again for your help
 
Old 07-06-2010, 01:18 AM   #19
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
Question so far..

ok. I followed the thread here on the ubuntu forums which got me some more info.
I discovered that i had configured rfcomm.conf to bind to the wrong channel. what I found is sdptool browse <<mac of gps reciever>> did not work for me. But the following did get me the correct info
Code:
:~$ sdptool browse --l2cap 00:0D:B5:37:93:94
Browsing 00:0D:B5:37:93:94 ...
Service Name: BT-GPS COM Port
Service RecHandle: 0x10001
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 2
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100

Service Name: BT-GPS COM Port
Service RecHandle: 0x10002
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 3
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
ok so now to see if i have a stream going using looking at a cat of the dev file
Code:
 RMC,045127.000,A,3608.2517,N,08638.1637,W,0.01,98.21,060710,,*2D
$GPGGA,045128.000,3608.2517,N,08638.1638,W,1,07,1.2,167.7,M,-31.7,M,,0000*6A
$GPGSA,A,3,04,12,02,10,30,13,05,,,,,,2.1,1.2,1.7*34
$GPRMC,045128.000,A,3608.2517,N,08638.1638,W,0.02,62.27,060710,,*2D
$GPGGA,045129.000,3608.2517,N,08638.1638,W,1,07,1.2,167.6,M,-31.7,M,,0000*6A
$GPGSA,A,3,04,12,02,10,30,13,05,,,,,,2.1,1.2,1.7*34
$GPRMC,045129.000,A,3608.2517,N,08638.1638,W,0.02,11.93,060710,,*27
$GPGGA,045130.000,3608.2517,N,08638.1638,W,1,07,1.2,167.6,M,-31.7,M,,0000*62
$GPGSA,A,3,04,12,02,10,30,13,05,,,,,,2.1,1.2,1.7*34
$GPGSV,3,1,09,02,69,327,34,10,68,143,37,12,51,281,34,04,44,050,44*79
$GPGSV,3,2,09,05,42,194,29,30,25,311,38,17,18,112,,13,11,067,35*71
$GPGSV,3,3,09,23,04,043,*42
$GPRMC,045130.000,A,3608.2517,N,08638.1638,W,0.02,47.01,060710,,*27
$GPGGA,045131.000,3608.2517,N,08638.1637,W,1,07,1.2,167.5,M,-31.7,M,,0000*6F
$GPGSA,A,3,04,12,02,10,30,13,05,,,,,,2.1,1.2,1.7*34
$GPRMC,045131.000,A,3608.2517,N,08638.1637,W,0.02,92.42,060710,,*26
$GPGGA,045132.000,3608.2517,N,08638.1637,W,1,07,1.2,167.4,M,-31.7,M,,0000*6D
$GPGSA,A,3,04,12,02,10,30,13,05,,,,,,2.1,1.2,1.7*34
$GPRMC,045132.000,A
which seems to show data streaming.

ok, so next i tried to run gpscat which gave me something unexpected.
Code:
 :~$ gpscat
Traceback (most recent call last):
  File "/usr/bin/gpscat", line 66, in <module>
    tty = os.open(arguments[0], os.O_RDWR)
IndexError: list index out of range
Anyone have info on this?

Next I started up gpsd with
Code:
gpsd -b /dev/rfcomm0
I get nothing after running that command.

Ok next I ran xgps with some options
Code:
sudo xgps localhost:2947:/dev/rfcomm0
just to make sure everyting was pointing in the correct location.

I wanted to make sure gpsd had a port open. So,
Code:
tcp        0      0 127.0.0.1:2947          0.0.0.0:*               LISTEN
everything seems right. the only thing that i can figure at this point is
  1. error from gpscat
  2. errors listed from l2cap in log files
  3. even when hitting control c and the dev file is gone...connection still appears to be up.
  4. No clue

Someone please help. I am at the end of my rope with this. I see data. but nothing seems to see gpsd.

Last edited by mrmnemo; 07-06-2010 at 01:20 AM.
 
Old 07-06-2010, 07:52 AM   #20
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
If you can see NMEA data, gpsd is running and is connected to your gps device.

Perhaps the version of tangogps in the 'buntu repositories is too old.
I am running tangogps 0.99.3 on ubuntu 10.04, and it works well, I got it directly from marcus bauer's website.

The latest version is 0.99.4 and you can get it here: http://www.tangogps.org/gps/cat/News

You should not need to run xgps as root, please don't.

The only time you need to be root is to kill gpsd (always check it is not running before you try to start it - because if it is running, a new instance will not be started, and the old one may continue with the incorrect parameters), or to start gpsd.
 
Old 07-18-2010, 02:06 PM   #21
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
just an update. I was never able to get the rfcomm / gpsd / tango-xgps chain to work correctly. Any input?
 
Old 07-18-2010, 02:24 PM   #22
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
My USB-connected GPS receiver has worked perfectly with several linux distros, gpsd, tangogps and xgps.

So I think that the fact that yours is BlueTooth-connected is probably where the problem lies.

As I have said, I do not use any BT devices, so it is difficult for me to advise you. Perhaps you could try a USB connected device? They are cheap now.

Otherwise, maybe ask advice in a BT-orientated forum or GPS-device related forum (or even here on LQ) about bluetooth, and don't title it "issues with tangogps and gpsd" because I think your problem is with BT. My all means provide a link to this thread.

Please let us know how you get on. A solution would be good.
 
1 members found this post helpful.
Old 07-18-2010, 02:55 PM   #23
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
thanks! will do.
 
Old 12-19-2010, 01:47 PM   #24
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
Hi,
Took me awhile to get this sorted out. Any way, my BT dongle and gps now work. Here is how:

Alot of the tutorials kept pointing to hcid.conf; however, this was replaced with /etc/bluetooth/<multi conf files>
Example:
Code:
ls /etc/bluetooth/
audio.conf  input.conf  main.conf  network.conf  rfcomm.conf  serial.conf
that was the main difference from the tutorial located at http://ubuntuforums.org.

Just to rehash everything:

run
Code:
hcitool scan
note the MAC of your bluetooth gps device from the scan. ( something like the below example )
Code:
@munkey-laptop:~$ hcitool scan 00:0D:B5:37:93:94
Scanning ...
	00:0D:B5:37:93:94	BT-GPS-379394
Next, I ran sdbtool to check some of the settings of the device:
Code:
 @munkey-laptop:~$ sdptool records 00:0D:B5:37:93:94
Service Name: BT-GPS COM Port
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
Note: I am not sure why sdbtool browse/record needs to be run. Maybe some devices communicate by means other than Serial. Maybe someone can tall me the reason.


Next, set up the rfcomm.conf file:
Code:
sudo nano /etc/bluetooth/rfcomm.conf
Example of my settings:
Code:
@munkey-laptop:~$ cat /etc/bluetooth/rfcomm.conf 
#
# RFCOMM configuration file.
#

rfcomm0 {
#	# Automatically bind the device at startup
	bind yes;
#
#	# Bluetooth address of the device
	device 00:0D:B5:37:93:94;
#
#	# RFCOMM channel for the connection
	channel	1;
#
#	# Description of the connection
	comment "Serial Port";
}
Next connect everything make sure and kill gpsd.
Code:
ps -C gpsd
and then
Code:
sudo kill <the pid(s)>
This was important for me to do.

Next connect to the device with rfcomm
Code:
sudo rfcomm connect 0
NOTE: 0 denotes the channels i set in my rfcomm.conf file. If you set it to 4 then it would be rfcomm connect 4


Next, start gpsd SAFELY with
Code:
 sudo gpsd -b -n /dev/rfcomm0
NOTE: Once again rfcomm0 could just as easily be rfcomm4. depends on your rfcomm.conf settings.

Next, check to see if it was working.
In my case I installed tangogps. Once it first started it could not locate gpsd ...within one sec it got the gps data stream...WORKS.
Only issue> the connection needs to be torn completely down to kill it.
Code:
 sudo killall gpsd
and
Code:
sudo rfcomm release 0
Hope this helps

Last edited by mrmnemo; 12-19-2010 at 01:50 PM.
 
Old 12-20-2010, 12:34 PM   #25
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Congratulations! And many thanks for posting the follow-up, it looks like you have had quite a struggle.

Just one small point, in your rfcomm.conf listed above you seem to have set the channel to 1, but then you are connecting with sudo rfcomm connect 0

Did you mean this, or have I missed something?

Anyway, have fun with your GPS, and I hope you will be able to contribute some data to Openstreetmap

Best wishes.
 
1 members found this post helpful.
Old 12-20-2010, 12:59 PM   #26
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
Wink

Quote:
Originally Posted by tredegar View Post
Congratulations! And many thanks for posting the follow-up, it looks like you have had quite a struggle.

Just one small point, in your rfcomm.conf listed above you seem to have set the channel to 1, but then you are connecting with sudo rfcomm connect 0

Did you mean this, or have I missed something?
Yeah. It appears that in the /etc/bluetooth/rfcomm.conf you can set multiple "predefined" connections. Where CHANNEL is a setting INSIDE rfcomm0. rfcomm1, rfcomm2, etc. Please see below example:
Code:
cat /etc/bluetooth/rfcomm.conf 
#
# RFCOMM configuration file.
#

#rfcomm0 {
#	# Automatically bind the device at startup
#	bind no;
#
#	# Bluetooth address of the device
#	device 11:22:33:44:55:66;
#
#	# RFCOMM channel for the connection
#	channel	1;
#
#	# Description of the connection
#	comment "Example Bluetooth device";
#}
NOTE: this is a blank example from another box. However, at the botom make sure and uncomment the closing "}",; otherwise, you will get syntax errors. I have seen people asking about that. It will still work, just keeps telling of syntax error.
 
Old 02-08-2012, 04:42 PM   #27
Fitch
LQ Newbie
 
Registered: Feb 2011
Location: Hartlepool
Distribution: Mint
Posts: 14

Rep: Reputation: 1
Something just won't work with me..

The first bit works:

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

sdptool records 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
If I do a:
Code:
cat /dev/rfcomm0
it hangs there....
until I do a ^C

So next, I do a:

Code:
alistair@alistair ~ $ gpscat
Traceback (most recent call last):
  File "/usr/bin/gpscat", line 66, in <module>
    if "rfcomm" in arguments[0]:     # Bluetooth special case
IndexError: list index out of range

alistair@alistair ~ $ sudo xgps localhost:2947:/dev/rfcomm0
Traceback (most recent call last):
  File "/usr/bin/xgps", line 602, in handle_response
    if self.device and self.device != self.daemon.data["device"]:
  File "/usr/lib/pymodules/python2.7/gps/client.py", line 188, in __getitem__
    return self.__dict__[key]
KeyError: 'device'
and it hangs there....
Until I do a ^C
Then it comes out saying:
Code:
CTraceback (most recent call last):
  File "/usr/bin/xgps", line 674, in <module>
    base.main()
  File "/usr/bin/xgps", line 630, in main
    gtk.main()
KeyboardInterrupt
And gpsmon comes up:
gpsmon: connection failure on localhost:2947, error -6 = can't connect to host/port pair.
An ls of the /etc/bluetooth/ directory only shows:
audio.conf input.conf network.conf serial.conf hcid.conf main.conf rfcomm.conf

I also connect using Blueman which happily reports that the Bluetooth GPS is connected to rfcomm0 and is happily sending information. So what am I not doing?

Last edited by Fitch; 02-08-2012 at 08:44 PM.
 
  


Reply

Tags
bluetooth, gps, gpsd, gpsdrive


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
iPhone as GPSD device gandhioftherillo Linux - Software 4 04-23-2010 11:17 PM
Installing gpsdrive without gpsd System-Core Linux - Software 13 12-17-2009 03:36 PM
LXer: Find your way with tangoGPS LXer Syndicated Linux News 0 11-12-2008 06:40 PM
gramin 200w and gpsd question unixshell101 Linux - Laptop and Netbook 3 07-13-2008 02:37 PM
gpsd on a zaurus 6000L skunkburner Linux - Laptop and Netbook 4 07-07-2005 12:31 PM


All times are GMT -5. The time now is 05:48 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration