UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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).
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:
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**).
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.
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
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
error from gpscat
errors listed from l2cap in log files
even when hitting control c and the dev file is gone...connection still appears to be up.
No clue
Someone please help. I am at the end of my rope with this. I see data. but nothing seems to see gpsd.
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.
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.
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.
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.