LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-10-2009, 03:03 PM   #1
System-Core
LQ Newbie
 
Registered: Dec 2004
Location: UK
Posts: 14

Rep: Reputation: 0
Installing gpsdrive without gpsd


Could I ask a general question about 'GPSDrive' Could someone please tell me if Gpsdrive can be installed without gpsd installed; if so, what should I do.

I want to install gpsd-2.38 as it gives me a '-b' switch that allows me to use my gps device as read only. All was working fine until I installed gpsdrive and now the version of gpsd that comes with gpsdrive doesn't have a '-b' switch. So my gps device locks up.

I'm struggling to find information on this issue.

Thanks in advance.
 
Old 12-10-2009, 04:45 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
'GPSDrive' will not work without gpsd correctly installed.

gpsd is the daemon that facilitates communication between a gps device and linux gps applications.
In my experience, it works very well.

However, I have noticed that some more recent linux distros ('buntu 9.10 for example) will automatically fire up gpsd without the -b parameter without asking beforehand. This can "break" some gps devices (like mine, a BU-353), and you need a windows computer to reset it to the factory defaults using setupSiRFDemo3.87.zip

See here: http://theadventuresofsuperdoc.blogs...-eeebuntu.html for more about how to unlock your "broken" gps device.

This is a fault with the implementation of udev which is "making assumptions" about how it calls and launches gpsd. No doubt this will be sorted out in the future.

For the moment, I think you need to disable your distro's "auto-anything" to do with GPS.

If you told us what your distro is we'd probably be able to help you with detailed details
 
1 members found this post helpful.
Old 12-12-2009, 05:47 AM   #3
System-Core
LQ Newbie
 
Registered: Dec 2004
Location: UK
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post

This is a fault with the implementation of udev which is "making assumptions" about how it calls and launches gpsd. No doubt this will be sorted out in the future.

For the moment, I think you need to disable your distro's "auto-anything" to do with GPS.

If you told us what your distro is we'd probably be able to help you with detailed details
Thanks tredegar, I'm running an old dell cpt with Mandriva 2008.1 kernel 2.6.24.7-3mnb.

Totally agree with what you say. I'm using a BU-303 that constantly needed resetting on a windows machine. And then I learned to use sirfmon/gpsmon for this purpose. After resetting the BU-303 to output NMEA, I would start the laptop with everything plugged in, then I'd start gpsd and then kismet. I noticed that if I needed to reboot the laptop while out and about, then the GPS device would not work. To cut a long story short. I soon discovered that removing the internal battery from the GPS mouse stopped it from keeping any configuration data given to it from the Linux kernel.(udev) Boot up of the GPS mouse did slow a bit, but it worked every time with the battery removed. A quick voltage test showed the battery to be U/S.

Anyway, gpsd seems to want to write it's own configuration details to my GPS mouse. which was easily overcome by using the -b switch when initialising gpsd like so... (# gpsd /dev/ttyUSB0 -s 2947 -b) gpsd and kismet worked great together, but then I wanted more...

Then I thought I'd go down the MySQL/gpsdrive route for checking out local network topology. My reason for this was the data received under kismet was a bit unwieldy to manage.

As soon as I installed gpsdrive, my whole installed world came crumbling down around me, and I had to start from scratch; all because the gpsd installed with gpsdrive is pretty useless for my GPS device.

I'd like to understand more about disabling the 'auto-anything' to do with GPS. So any pointers would be appreciated.

Thanks for your help.

Kind Regards.

Last edited by System-Core; 12-12-2009 at 07:42 AM.
 
Old 12-12-2009, 11:49 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
As soon as I installed gpsdrive, my whole installed world came crumbling down around me, and I had to start from scratch; all because the gpsd installed with gpsdrive is pretty useless for my GPS device.

I'd like to understand more about disabling the 'auto-anything' to do with GPS. So any pointers would be appreciated.
gpsd is just a daemon to interface between the GPS device and gps-aware applications, but, as you have found, it always needs to be started with the -b option for devices like ours.

I think what gpsdrive is doing, is not installing "a useless version of gpsd", but calling it wrong, without the -b option.
You could try removing the gpsd that gpsdrive installs, and installing your distro's version (although these are likely to be the same).

On my ubuntu version, I was able to do:
Code:
sudo dpkg-reconfigure gpsd
and then answer NO to "Start gpsd automatically?"

[You will not have this debian command on mandrva, but there may be a similar utility.]

Then I then start gpsd myself with this line in /etc/rc.local
Code:
gpsd -b /dev/ttyUSB0
Otherwise I suggest you take a look at your implementation of udev rules.

They will be what is starting gpsd without the -b option. On my distro, udev rules are now in /lib/udev/rules.d/ so you could
Code:
grep gps /lib/udev/rules.d/*
to see what files refer to gps devices and what they are doing to them and then disable or correct the bad behaviour. I found it easiest just to disable auto-starting, and start it myself. I haven't had a "locked up" device since.

BTW TangoGPS is excellent!

If you want to convert saved tangogps tracks to .gpx there's a utility convert2gpx.pl on the tangogps site.

And, slightly off-topic, I suppose you already know about OSM and video tutorials for editing OSM. Linux runs JOSM, the OSM map editor without any trouble (you need java installed).
And, please, free your postcode
 
1 members found this post helpful.
Old 12-12-2009, 01:30 PM   #5
System-Core
LQ Newbie
 
Registered: Dec 2004
Location: UK
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
gpsd
Otherwise I suggest you take a look at your implementation of udev rules.

They will be what is starting gpsd without the -b option. On my distro, udev rules are now in /lib/udev/rules.d/ so you could
Code:
grep gps /lib/udev/rules.d/*
to see what files refer to gps devices and what they are doing to them and then disable or correct the bad behaviour. I found it easiest just to disable auto-starting, and start it myself. I haven't had a "locked up" device since.
Cheers tredegar, I've spent most of today learning more about udev and creating a rule. I'll post back with how it worked out.

Regards.
 
Old 12-14-2009, 04:34 PM   #6
System-Core
LQ Newbie
 
Registered: Dec 2004
Location: UK
Posts: 14

Original Poster
Rep: Reputation: 0
Does anyone know if there is a way of compiling GPSDrive so it doesn't install GPSD. I'm playing with the udev rules at the moment and to be honest I'm struggling with them. I'll hack away at them until I understand them if this is truly the way to go, but I was wondering if it would be easier to go down the path of editing the installation of GPSDrive to use the version of GPSD I need. The version of GPSD I need is GPSD-2.38 which to my knowledge is the most recent version.

Any help would be great.

Thanks.
 
Old 12-14-2009, 05:30 PM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
In my experience, there is nothing wrong with gpsd

There are a number of faults with GPSDrive, which I have tried different versions of. It seems to be broken, for now. I don't think this is the fault of gpsd. Perhaps you should contact the develops of GPSDrive.

Please read my previous posts.
 
Old 12-15-2009, 01:01 PM   #8
System-Core
LQ Newbie
 
Registered: Dec 2004
Location: UK
Posts: 14

Original Poster
Rep: Reputation: 0
Cheers tredegar. It had crossed my mind to contact the developers - as the problem would never have arisen if GPSDrive had given me the ability to install GPSD myself. GPSD-2.38 works great with Kismet-2009-06-r1 as far as I can tell.

I'm going to have to struggle with udev rules and try and make my usb gps mouse read only. Tredegar, do you have any tips on how I should proceed.

Thanks a lot for your help so far.
 
Old 12-16-2009, 04:04 AM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
the problem would never have arisen if GPSDrive had given me the ability to install GPSD myself. GPSD-2.38 works great with Kismet-2009-06-r1 as far as I can tell.
I think you misunderstand the problem. When you install gpsdrive your distro will automatically install gpsd and the udev rules to start gpsd as it is needed by gpsdrive. The version of gpsd installed will be the "correct" one for your distro.

The problem lies with udev which is trying to be too clever: When it detects what it thinks is a gps device, it starts gpsd, but without the -b option, which breaks your dongle.

Quote:
do you have any tips on how I should proceed?
As usual, there are several ways. Try this :
Code:
cd /lib/udev/rules.d
grep gps *
For me, 40-gpsd.rules is the file that handles gps devices.

Take a look at it.

It calls /lib/udev/gpsd.hotplug.wrapper and/or lib/udev/gpsd.hotplug when a gps device is plugged in.
These are the files that then call gpsd without the -b option. This is bad.

Note in the above, you might need to be looking in /etc/udev/rules.d/ not /lib/udev/rules.d/ so look at both.

You can either modify the gpsd.hotplug.wrapper and gpsd.hotplug scripts so they call gpsd with the -b option or,
possibly simpler,
just remove the 40-gpsd.rules file(s) entirely (eg move it/them to your home directory). That way, nothing special happens when you plug in your gps device, (except it is recognised as a serial device, and linked to /dev/ttyUSB0 ) and you can then start gpsd with the -b option yourself like this:
Code:
sudo gpsd -b /dev/ttyUSB0
Once you have disabled udev's handling of gps devices, you can put that command (without the sudo) in rc.local, as I said in post #4.

Another option:

If you have the file /etc/default/gpsd then make a backup copy in your home directory and then make it look like this:

Code:
START_DAEMON="false"
DAEMON_OPTS="-F  /var/run/gpsd.sock  -b"
DEVICES="/dev/ttyUSB0"
USBAUTO="true"
Reboot and see what happens.
 
Old 12-16-2009, 08:26 AM   #10
System-Core
LQ Newbie
 
Registered: Dec 2004
Location: UK
Posts: 14

Original Poster
Rep: Reputation: 0
Talking

This is what I get for spending too many years messing with Microsoft products.

This simple little concept has had me running in circles for ages; the proverbial penny has just dropped thanks to your last post tredegar.

I was under the illusion that GPSDrive has a copy of GPSD built into itself. In reality, the installation process isn't taking GPSD from the GPSDrive installation tarball, but instead it is adding my distro's recommended version of GPSD via rpm.

What you say makes complete sense now, and now thinking back, I can see how simple the problem actually is. When I was analysing the problem step by step, I soon found that downloading and installing the GPSD-2.38 from berlios worked great and gave me the '-b' switch; but installing GPSD via rpm from my Mandriva software manager installed a version of GPSD that did not have the -b option. So if GPSDrive has been installing this same package, then no wonder none of the GPSDrive packages seemed to help give me back the -b switch.

One thing I am curious about. Why when I already had GPSD-2.38 installed and working, did the installation of GPSDrive install another copy of GPSD? Is this a failure in Linux to notify the user that GPSD-2.38 is going to be overwritten or not used anymore; or maybe there's two copies of GPSD installed and for some reason the kernel gives priority to the version that was installed via rpm/urpmi and not the tar installation. Beats me.



Thank you ever so much for your patience tredegar.

Much appreciated.
 
Old 12-16-2009, 01:39 PM   #11
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
installing GPSD via rpm from my Mandriva software manager installed a version of GPSD that did not have the -b option.

Really
? I am horrified! I thought all current versions of gpsd offered the -b option. It is important for people with "broken" devices like ours - and there are a lot of us with the SiRFStar III chipsets. I suspect the version of gpsd isn't as important as how it is called (Eg by a udev rule without the -b option, which breaks things).

Quote:
One thing I am curious about. Why when I already had GPSD-2.38 installed and working, did the installation of GPSDrive install another copy of GPSD?
I am not sure. The cleverer package managers (and I'll admit I'm talking Debian's apt-get here ) will do their best to make sure the latest versions of everything are being used, but also that no conflicts arise.

RPM was one of the reasons I moved away from RPM-based distros (Red Hat, Fedora, and derivatives like Mandrake / Mandriva), to Debian-based distros and their derivatives. Debian's apt-get is awesome (but I don't want to start a flame war here). You don't say which version of gpsd GPSDrive apparently "installed", so I cannot offer further advice on this.

Quote:
Is this a failure in Linux to notify the user that GPSD-2.38 is going to be overwritten or not used anymore; or maybe there's two copies of GPSD installed and for some reason the kernel gives priority to the version that was installed via rpm/urpmi and not the tar installation. Beats me.
I don't think it's a "failure of linux", more a "feature" of your distro's package manager. Which I never liked or thought worked properly, so I'll shut up now.

Quote:
Thank you ever so much for your patience tredegar.
Thank you for the "thanks", and more importantly, the feedback. Too many people don't bother now, and just move on to their next question. Then I never know if the advice offered solved the problem, or they just got bored and moved on. That's irritating in the extreme.

So, please just let us know how you get on, and hopefully, your satisfactory solution for the distro of your choice.

Last edited by tredegar; 12-16-2009 at 01:41 PM.
 
Old 12-16-2009, 02:40 PM   #12
System-Core
LQ Newbie
 
Registered: Dec 2004
Location: UK
Posts: 14

Original Poster
Rep: Reputation: 0
You're going to love this.

I don't have /lib/udev/gpsd.hotplug.wrapper nor do I have lib/udev/gpsd.hotplug

I haven't got a rule that makes any mention to gps (I did use grep gps * at the command line with the working directory of /etc/udev/rules.d). Plenty of rules in /etc/udev/rules.d/ none containing any reference to gps. I also had a look in /lib/udev/rules.d with the same result.

And I don't have a file called gpsd in /etc/default/

I started to panic at this point.

As I was searching my whole machine for any reference to *gpsd* I noticed that there was:

1. /usr/bin/gpsd
2. /usr/local/sbin/gpsd

both are executables.

I noticed that the second instance (2) was similar to the way the new Kismet installation lays its files out.

Then the penny really did drop for me, as I realised GPSD is obviously installed twice. When I was running ~#gpsd /dev/ttyUSB0 -S 2947 -b and getting a negative response because the option switches no longer work like it did under GPSD-2.38, because it was calling the GPSD installed by GPSDrive. So the answer was to simply rename /usr/bin/gpsd executable or remove it from the path variable.

Low and behold I have my -b option back.

A quick look at my path variable shows:
/usr/bin:/bin:/usr/local/bin:usr/X11R6/bin/:/usr/games:/usr/lib/gt4/bin:/home/user_name/bin:/usr/lib/qt4/bin

One thing puzzles me now, if /usr/local/sbin/gpsd isn't listed in the PATH Variable, how was I able to call it from the command line in konsole?????

Again, thanks tredegar I wouldn't have figured this one without your help.
 
Old 12-16-2009, 05:07 PM   #13
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I started to panic at this point.
Don't ever panic. The answer is 42. I expect you to have a backup of any important files on your linux system anyway
Quote:
As I was searching my whole machine for any reference to *gpsd* I noticed that there was:...
Try locate gpsd | grep bin to filter the output to something more manageable.
Quote:
One thing puzzles me now, if /usr/local/sbin/gpsd isn't listed in the
PATH Variable, how was I able to call it from the command line in konsole?????
At the command line, try:
which gpsd
Which will tell you where the executable supposedly is, and what is run when you submit the command.

That may be a symlink to somewhere else, so check the output of the which gpsd command in a terminal with
Code:
ls -l $(which gpsd)
Is it linked to somewhere else? Post the result here anyway.

Please also post the output of echo $PATH

My big problem is that I am trying to help you with a distro I am unfamiliar with. You are Red Hat / Fedora based and I am Debian based. Many configuration defaults are seriously different.

But you are making progress, and learning fast. Good.
 
Old 12-17-2009, 02:36 PM   #14
System-Core
LQ Newbie
 
Registered: Dec 2004
Location: UK
Posts: 14

Original Poster
Rep: Reputation: 0
Just following up on why I started this thread on whether GPSDrive installs it's own version of GPSD. I've just pulled the help output from each installation and they're all different. This shows that GPSDrive installed it's own rendition of GPSD.

GPSD VERSION 2.38 (DOWNLOADED FROM BERLIOS.DE)

Quote:
usage: gpsd [-b] [-n] [-N] [-D n] [-F sockfile] [-P pidfile] [-S port] [-h] device...
Options include:
-b = bluetooth-safe: open data sources read-only
-n = don't wait for client connects to poll GPS
-N = don't go into background
-F sockfile = specify control socket location
-P pidfile = set file to record process ID
-D integer (default 0) = set debug level
-S integer (default 2947) = set port for daemon
-h = help message
-V = emit version and exit.
A device may be a local serial device for GPS input, or a URL of the form:
[{dgpsip|ntrip}://][user: passwd@]host[: port][/stream]
in which case it specifies an input source for DGPS or ntrip data.

The following driver types are compiled into this gpsd instance:
Generic NMEA
Ashtech
Delorme TripMate
Delorme EarthMate (pre-2003, Zodiac chipset)
Furuno Electric GH-79L4
Garmin Serial
MKT-3301
San Jose Navigation FV18
EverMore binary
Garmin USB binary
Garmin Serial binary
iTalk binary
Navcom binary
SiRF binary
Trimble TSIP
uBlox UBX binary
Zodiac binary
RTCM104V2
RTCM104V3
GPSD VERSION 2.34 (INSTALLED FROM RPM MANAGER IN MANDRIVA CONTROL CENTER)

Quote:
usage: gpsd [-n] [-N] [-D n] [-F sockfile] [-P pidfile] [-S port] [-h] device...
Options include:
-n = don't wait for client connects to poll GPS
-N = don't go into background
-F sockfile = specify control socket location
-P pidfile = set file to record process ID
-D integer (default 0) = set debug level
-S integer (default 2947) = set port for daemon
-h = help message
-V = emit version and exit.
A device may be a local serial device for GPS input, or a URL of the form:
[{dgpsip|ntrip}://][user: passwd@]host[: port][/stream]
in which case it specifies an input source for DGPS or ntrip data.
GPSD VERSION ? (INSTALLED WITH GPSDRIVE-2.09)

Quote:
usage: gpsd [options]
options include:
-D level [ set debug level. If >= 2, remain in foreground ]
-L longitude [ set longitude ]
-l latitude [ set latitude ]
-S port [ set gpsd listening port ]
-T type [ set DeLorme models. e = Earthmate, t = Tripmate ]
-h [ help message ]
-p path [ set gps device pathname ]
-s baud_rate [ set baud rate on gps device ]
-c [ use dgps service for corrections ]
-d host [ set dgps server hostname]
-r port [ set dgps server port ]
-n [ disable setting default values for longitute and latitute ]
-F filename [ read input from file ]
-f seconds [ delay per input file line in seconds (default=0.2)]
-K [ keep gps device open all the time (linux USB workaround) ]
These findings, (although not conclusive) lead me to believe that GPSDrive comes with its own version of GPSD that's indeed included in the GPSDrive code; and the following excerpt from http://www.gpsdrive.de/documentation/changelog.shtml seems to point to it...

Quote:
Changed included "gpsd" to Remco Treffkorn's gpsd. This version is written in C instead of C++, so I can maintain it.
I hope anyone who has a similar problem finds their way here and realises the fix is as simple as renaming the /usr/bin/gpsd executable that GPSDrive installed; then installing at least version 2.38 of GPSD from gpsd.Berlios.de.

This problem drove me crazy and was embarrassingly easy to fix....But then again, aren't they all.
 
  


Reply


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
Holux GPS, gpsd, and GpsDrive skmassey Linux - Hardware 3 11-06-2006 02:38 PM
gpsd, gpsdrive, delorme tripmate amp_man Linux - Software 4 09-11-2006 09:19 PM
Gpsdrive SteveON Linux - Software 2 11-23-2005 08:42 AM
gpsd on a zaurus 6000L skunkburner Linux - Laptop and Netbook 4 07-07-2005 11:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:36 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
Open Source Consulting | Domain Registration