LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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-02-2010, 02:01 AM   #1
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Rep: Reputation: 51
issues with tangogps and gpsd


hi,
I have the following:
1.g-sat BT-359w bluetooth reciever.
2.bluetooth usb plug ( the mini ones )
3. Ubuntu 10.04 ( updated )
4. gpsd: 2.92 (revision svn)
5. Version 2.10pre4

I have a few issues that are very frustrating. My issue started or became noticed with tangogps. I am getting a "no gpsd" error. I searched based on this error and found tutorials that showed how to address the issue. However, none of the files that need to be edited exist in the gpsd directory.

I noted that on win 7 that i had to change the baud rate to 38400. I tried running setserial to get info on the baud rate of the ub bluetooth dongle but couldnt get the right serial name. going off of what other forum post have said to do ( /dev/ttyUSB0 as an example) i dont even have a ttyUSB0 in /dev. I am lost.

I can post any info that might help aide in fixing this. I could really use some help from someone that has had to deal with this issue.

Last edited by mrmnemo; 07-02-2010 at 02:05 AM. Reason: added info
 
Old 07-02-2010, 03:14 AM   #2
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
just some added info:
Code:
:~# ls /etc/bluetooth/ 
audio.conf
input.conf
main.conf
network.conf
rfcomm.conf
serial.conf

~:# cat /etc/bluetooth/rfcomm.conf
#
# RFCOMM configuration file.
#

rfcomm0 {
	bind yes;
	device 00:0D:B5:37:93:94
}

:~$ hciconfig 
hci0:	Type: USB
	BD Address: 00:02:72:AB:B6:41 ACL MTU: 1021:7 SCO MTU: 64:1
	UP RUNNING PSCAN ISCAN 
	RX bytes:1542 acl:7 sco:0 events:60 errors:0
	TX bytes:1706 acl:5 sco:0 commands:43 errors:0

~$ hcitool devDevices:
	hci0	00:02:72:AB:B6:41

:~$ hcitool scanScanning ...
	00:0D:B5:37:93:94	BT-GPS-379394

 hcitool inqInquiring ...
	00:0D:B5:37:93:94	clock offset: 0x3fb1	class: 0x001f00

:~$l2ping 00:0D:B5:37:93:94
Ping: 00:0D:B5:37:93:94 from 00:02:72:AB:B6:41 (data size 44) ...
4 bytes from 00:0D:B5:37:93:94 id 0 time 65.58ms
4 bytes from 00:0D:B5:37:93:94 id 1 time 21.05ms
4 bytes from 00:0D:B5:37:93:94 id 2 time 16.29ms
^C3 sent, 3 received, 0% loss

:~$ rfcomm connect 0
syntax error line 21
Connected /dev/rfcomm0 to 00:0D:B5:37:93:94 on channel 1
Press CTRL-C for hangup
so i know the device is paired. is my problem with gpsd?
 
Old 07-02-2010, 06:48 AM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,036

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
I noted that on win 7 that i had to change the baud rate to 38400.
gpsd is smart enough to set the correct baud rate automatically.

If your gps receiver is connected with bluetooth you should see it at /dev/rfcomm0 not /dev/ttyUSB0 (which is for a USB connection)

Also, some bluetooth (and other) GPS receivers lock up if gpsd is not started with the -b option. Please see man gpsd

So you could try killing the current gpsd and then restarting it (as root) like this:

gpsd -b /dev/rfcomm0

xgps is a good little app for showing you how well your gps receiver is working. In the 'buntus, it is part of the gpsd-clients package
 
1 members found this post helpful.
Old 07-02-2010, 12:55 PM   #4
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
thanks
will post back how things go.
 
Old 07-02-2010, 02:23 PM   #5
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
i tried this

ok so i ran
Code:
service gpsd stop
then i tried to restart with
Code:
~$ gpsd -b
gpsd: can't run with neither control socket nor devices
and got the above response. as you can see from my OP, i am able to communicate with the device. So, I guess its not locked up. Could someone refer me to some commands to run that could help me run some diagnostices against gpsd and gpsdrive?

running isnt helping either.
Code:
~:# xgps
Basically, xgps seems to just stall/hang(?). Thanks for the pointer though.

Last edited by mrmnemo; 07-02-2010 at 02:26 PM.
 
Old 07-02-2010, 02:37 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,036

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
service gpsd stop
I don't think you can stop it, I had to kill mine. But maybe that will work for you. If it doesn't, you'll get a message telling you that gpsd is already running when you try to restart it.
Quote:
then i tried to restart with

~$ gpsd -b

... gpsd: can't run with neither control socket nor devices
No. You have to tell gpsd where to look for your gps device. The error message is telling you that.

If you re-read my post above, you'll see that I think your bluetooth-connected gps device is likely to be at /dev/rfcomm0 but you should check that (perhaps it's /dev/rfcomm1 ? I do not know what other stuff you have connected with bluetooth, and you are not telling me )
 
1 members found this post helpful.
Old 07-03-2010, 02:14 PM   #7
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
thanks again. will try it when i get and home and post my results. just a random question: is rfcomm the same as COM in windows; rather, is it a serial port?
 
Old 07-03-2010, 02:56 PM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,036

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
is rfcomm the same as COM in windows; rather, is it a serial port?
I don't use win any more, so I don't really know. But ...

In linux, "everything is a file", and this includes serial ports, so /dev/rfcomm0 is a file, and appears in your filesystem, but it is also a communication port that is connected to something-bluetooth.

If you write to that "file" then the data is sent not to a real file, but the device that is associated with that filename. If you read from that "file" you are reading data from the device that is attached to it, not a "real" file on your HDD.

Most (probably all) things in /dev/ are devices (that's why the directory is called /dev(ices) )
There's even /dev/mem which is your RAM.

So, yes /dev/rfcomm0 is "a serial port" by another name.

I think you have a USB bluetooth ("BT") dongle plugged in.

USB sees this as a USB device. The kernel sees this as a BT device plugged into a USB socket. So it communicates BT protocols with the BT device, over the USB protocol. The kernel handles all of this for you, so you don't have to worry about it.

You just see something called /dev/rfcomm0 pop up. If the only BT device you have associated is your GPS device, then /dev/rfcomm0 is your GPS device, and that's what gpsd needs to know.

My GPS receiver is a USB device (not BT via USB). I just plug it in. The kernel sees it, and creates an entry for it at /dev/ttyUSB0. Then I need to tell gpsd that my GPS unit is at /dev/ttyUSB0 :
Code:
sudo gpsd -b /dev/ttyUSB0
If I had previously plugged in another USB GPS dongle, the new one would be put at /dev/ttyUSB1. This can lead to confusion, so udev was developed. This means that you can plug something into USB (or pretty much any other connection) and it will reliably appear at the location of your choice, Eg /dev/my-cheap-GPSDevice

But udev is another story, and I don't think we should go there yet.

Just get gpsd to see your GPS device. All you need to do is in the posts above.

Then tangogps will work (and it's BRILLIANT, so worth this effort )

HTH, but if you get stuck, come back.
 
1 members found this post helpful.
Old 07-03-2010, 09:10 PM   #9
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
ok. so i ran this:
Code:
rfcomm connect 0
which got me connected to the device ( should i say talking? because even before i could actually mount the gps unit to read its windows and mac howto files B4 running any of the above or following commands)

I then ran the amended
Code:
gpsd -b /dev/rfcomm0
the double checked with
Code:
service gpsd status running
all lights on the unit seem to be working( rapid flashing from usb hub and bluetooth device)
running ls works as well
Code:
ls /media/BT-359/
Acrobat_Reader_SETUP.EXE                BT-359-User Manual-Spanish Ver 1.1.pdf
BT-359-User Manual-English Ver 1.1.pdf  BT-359-User Manual-TC Ver 1.1.pdf
BT-359-User Manual-French Ver 1.1.pdf   Mac GPS Utiltiy
BT-359-User Manual-German Ver 1.1.pdf   MS Pocket PC GPS Utility
BT-359-User Manual-Italian Ver 1.1.pdf  Readme First Quick-Start Guide.pdf
BT-359-User Manual-SC Ver 1.1.pdf       Windows_Mobile_5_addendum.pdf
running xgps does nothing as far as i can tell. no output that i can see. xgpsd only tells me that gpsd is not running. Am I missing something here?

this is also odd. when i click on the bluetooth icon in the panel and choose "browse device" nothing shows up; however, the gps unit is listed as mounted in /media/BT-359. Any ideas?

Last edited by mrmnemo; 07-03-2010 at 09:14 PM. Reason: information to add
 
Old 07-03-2010, 09:54 PM   #10
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
Question uhh hmmmm

ok, so here is some more info.

rather than trying to kill via the service script, I ran
Code:
:~$ ps -C gpsd
  PID TTY          TIME CMD
 9704 ?        00:00:00 gpsd
which allowed me to kill the process for sure ( for some reason neither /etc/init.d/gpsd stop or the service script would kill it in ubuntu 10.04.??

anyway. Since I already knew my bluetooth devices address ( mac), I jumped straight to setting up rfcomm with
Code:
rfcomm bind /dev/rfcomm0
I used rfcomm0 due the rfcomm.conf readme in /etc/bluetooth which pointed in that direction. The device was then streaming data at that point ( i am guessing this is not the same as a mount to browse files which is on a as needed bases).

to see what i had comming from the device I ran
Code:
cat /dev/rfcomm0
which showed the stream was working.

next, I started up gpsd in debug mode with
Code:
gpsd -Nn -D 3 /dev/rfcomm0
which seemed to work ( i can post the results if needed), using ctrl-c to exit debug.

I then started up gpsd and ran xgps. xgps came back informing me that gpsd was not running. I am lost at this point. I can tell the device is streaming coords via bluetooth ( both gpsd and rfcomm show this). However, no application seems to be able to pull from this data.
 
Old 07-04-2010, 05:02 AM   #11
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,036

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
rather than trying to kill via the service script, I ran
Code:
:~$ ps -C gpsd
PID TTY TIME CMD
9704 ? 00:00:00 gpsd
That's fine. service gpsd stop | start doesn't work for me either, I have to kill the PID.

Quote:
next, I started up gpsd in debug mode with
Code:
gpsd -Nn -D 3 /dev/rfcomm0
which seemed to work ( i can post the results if needed), using ctrl-c to exit debug.
If you saw data being listed, then it is working.
But starting gpsd like that does not "daemonise" it, so when you did a CRTL-C you killed it.
If you don't let it daemonise it will be killed if you CTRL-C or close the terminal.

First check if gpsd is running, kill (probably as root) it if it is, as it might be connected to the wrong device.
Make sure it is not running.

Now start gpsd as root, and let it daemonise:
Code:
sudo gpsd -bn /dev/rfcomm0
Make sure it is running by checking for its PID

Now, if you cat /dev/rfcomm0 you should, after a short delay, see GPS data. CTRL-C to stop the cat.

You will not see any output from cat /dev/rfcomm0 if you did not start gpsd with the -n flag

Then start xgps
xgps may take a several seconds to show any satellites, be patient.

If xgps is working, so will tangogps

As you have had this working ( as evidenced by your output from cat /dev/rfcomm0 ), you must have managed to get it working at least once. So you can do it again.

The -b switch for gpsd is IMPORTANT. I bricked my BU-353 by running gpsd just once without the -b switch. See this post for how to get it reset so it works again. Scroll down to " - You didn't listen and ran gpsd without the -b option?". You'll need windows

One last thing: Remember that satellite signals do not enter buildings very well. Your GPS device should be on a windowsill so it can see clear sky. It may take several minutes (up to 10) to settle and get its "first fix". Until that happens (usually signalled by a LED on your GPS device) there may not be any data coming in.

Good luck.
 
1 members found this post helpful.
Old 07-04-2010, 11:29 AM   #12
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
ok this is just odd.
I killed gpsd, started it back up ( before and after checking rfcomm with cat to see if it was streaming) using
Code:
gpsd -bn /dev/rfcomm0
I started up xgps and still am getting reports that gpsd is not running. actually, xgps will report gpsd down even when i am looking at the output from ps -C gpsd that shows its running with an iD.

being that i see stream data when checking contents of rfcomm I will assume that the bluetooth device is not bricked at this point. I am starting to suspect something else is going on. Maybe an issue between gpsd and the applications that are trying to talk to it? I have seen some threads pointing in that direction.
 
Old 07-04-2010, 01:37 PM   #13
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,036

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
The home page for gpsd is here: http://gpsd.berlios.de/
There is a lot of information there.

Note that the protocol for communicating with gpsd has changed this year. Not sure that this matters, because I am running gpsd 2.92 (same as yours) and it is working with xgps (and tangogps, and they are from the same repositories as yours).

But I used to be able to telnet localhost 2947 and talk directly to gpsd and my gps receiver with the old version.
I cannot do this with V2.92. Such is progress. Might have helped with this debugging.

Some more things for you to think about [numbered]:

1] I was just messing with my gps receiver, trying to do some diagnostics for you.
In unplugging it and plugging it in again, although gpsd was running, xgps reported no gps data.
Turned out that my receiver was now on /dev/ttyUSB1 but gpsd was listening on /dev/ttyUSB0.
A kill and restart of gpsd with the right device at /dev/ttyUSB1 got everything working again.

So one thing for you to check very carefully is that you are indeed giving it the correct /dev/rfcomm-whatever.

2] Earlier, you posted this:
Code:
ls /media/BT-359/
Acrobat_Reader_SETUP.EXE                BT-359-User Manual-Spanish Ver 1.1.pdf
BT-359-User Manual-English Ver 1.1.pdf  BT-359-User Manual-TC Ver 1.1.pdf
BT-359-User Manual-French Ver 1.1.pdf   Mac GPS Utiltiy
BT-359-User Manual-German Ver 1.1.pdf   MS Pocket PC GPS Utility
BT-359-User Manual-Italian Ver 1.1.pdf  Readme First Quick-Start Guide.pdf
BT-359-User Manual-SC Ver 1.1.pdf       Windows_Mobile_5_addendum.pdf
Which implies that your gps receiver is also saying it is a "disk" with user manuals on it.

That's OK (many USB phone dongles act the same way, except they have windows drivers on the "disk") but sometimes you have to eject the disk before the rest of the device can be recognised and start working properly.

So, open your file-manager and eject BT-359, or R-click it and eject it if it is visible on your desktop.

Then get your bluetooth to associate with the gps device. I don't use bluetooth, so I am not sure how to do this, but I expect you know by now.

3] Kill gpsd if it is running.

Quote:
Not a quote, but an note:

It is annoying when udev and the kernel try to start gpsd for you, and then do it with the wrong options. So I did
Code:
sudo dpkg-reconfigure gpsd
and answered No to the next two questions.

Now it is never auto-started (and I don't want you accidentally to brick your device, which, like mine is a SiRF StarIII chipset. It's a PITA to get it reset)
Start gpsd as before:

sudo gpsd -bn /dev/rfcommwhatever
(Not sure you were starting it as root before, and make very sure you are using the right device name/number)

Try xgps again.

4] Please confirm that when your gps device has been turned on (for up to 10mins), and can see the sky, that it has a "fix" - the green light on it should be flashing, not out or steady (If I have found the correct .pdf for your device, it had been awkward, do you have a link to its documentation?)
I don't think you have bricked it, but this needs to be confirmed.

The reward for your perseverence will be "It works!!"

HTH
 
Old 07-04-2010, 05:46 PM   #14
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
ok. thanks again ! I will test when i get home. As to documentation, I can post the spec sheet to a location of your choice. As to the brick issue, its not. As posted earlier; it was feeding location info to the laptop via win7 AFTER running first shot in linux. I REALLY realy am trying to be done with windows for my personal stuff; that said, "It works!!" is the best compliment and reward. I hope to be able to tell you that soon.

Side question: The bluetooth panle applet is similar to netmanager correct? If so, couldnt I set it up to run a script on a IF UP / IF DOWN kinda thing similar to iptables loading using netmanager? Seems it would be easier than going to shell evertime i wanted to fire up gps. Will removing auto load from gpsd bork other bluetooth devices ( ipod touch for example)? I will look into this as well; however, any info to reading would be helpful. I am guessing the applet is bluez?

Thanks again for all the help.
 
Old 07-04-2010, 07:34 PM   #15
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
still getting the same results. I cant seem to get anthing to that gpsd is running.
Also; I was incorrect about the files showing up. I had forgot that i had left the cd that came wth the device in the dvd bay ) d(doh!).


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.
xgps is still not seeing gpsd
 
  


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 03:08 PM.

Main Menu
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