OpenWrt Forum Archive

Topic: Package added: gpsd

The content of this topic has been archived on 6 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

A new package, gpsd, is available for testing. You can find it in my testing repository.

Please report success / failure / comments / problems in this thread. Thanks for your help !

Woot! Thanks Nico - this is just what I needed.

Package works fine on my wrt54gs v1.1 (WR-RC3).

I use gpsd on my laptop with gpsdrive but I have to ask, why would you need it on a router? I'm sure there is a reason but the only thing I can think of is if you have a WRT installed in a bus or something. Just curious.

Yep, any sort of vehicle tracking, for which the WRT (12V) is perfect. You then use GSM/CDMA for back haul.

Void Main wrote:

I use gpsd on my laptop with gpsdrive but I have to ask, why would you need it on a router? I'm sure there is a reason but the only thing I can think of is if you have a WRT installed in a bus or something. Just curious.

Here is what I need it for.
I live in tornadio country  (OKC).  I do storm spoting.  I'm a amature radio guy (HAM) like must of the storm spoters.  The most ask question on the radio is "Wher are you".  Often answered badly like... "I'm one block south of the gas station neer the water tower in Cregs."

Now. Take a WRT54G add in serial ports.  One for the GPS and ther other for an 2 meter amature.  Use some software know as APRS (Amature Possion Reporting System) and you can plot your possion and everyone else.   EXAMPLE:  map.findu.com/kd5amb-9

More project insue.

I have been trying to compile the gpsd-2.30 version my self but I've run into troubles.  I'd like to know what changes if any had to be made to the inverment or code to get it working.

Mark G.  KD5ABM

Interesting. I would think a laptop might work better for something like that though. I run gpsd on my laptop with gpsdrive to see and record my progress on a map. At the same time I might be running kismet. You could also plug your radio in and do whatever you do there. I just thought it odd that you would use a WRT54G for that. I guess the advantage is that you could just mount it in your car and leave it there and it's small and out of the way.

0xc0de wrote:

[
I have been trying to compile the gpsd-2.30 version my self but I've run into troubles.  I'd like to know what changes if any had to be made to the inverment or code to get it working.

Mark G.  KD5ABM

The whole point of packages is to save you the trouble: just ipkg & you're done.

Gpsd can be found here: http://openwrt.org/downloads/people/nic … mipsel.ipk

I'll give that.  I like doing it myself but...

Do you plan to include/maintain gpsd as a part of the OpenWRT  package list?   Is your repository more like a DAG repository?

Meanwhile, I intalled the lattest  WR R3 (not my own compile) and then installed gpsd and when it runs I just get a (KILLED) back.  Whats up with that?

thanks.

Nico wrote:

A new package, gpsd, is available for testing. You can find it in my testing repository.

Please report success / failure / comments / problems in this thread. Thanks for your help !

GPSD, in your repository, has a problem.  (Double striping maybe?)

I tried it with the "standard"  WH R3 but it just says KILLED.   I then download your version of WR R3 (http://openwrt.org/downloads/people/nic … uashfs.bin).  Configure it and installed gpsd from the repository again.

Same results.  KILLED.

Would you like some beta testers? :-)

mark KD5AMB

frogzoo wrote:

The whole point of packages is to save you the trouble: just ipkg & you're done.

I have no problem with this.  I like haveing other people do my work for me.  Now I need aprsd.

  http://ve2.ele.etsmtl.ca/aprs/PortsAng.html

This allows wireless access to the radio modem via TCP/IP.   smile

0xc0de

0xc0de wrote:
Nico wrote:

A new package, gpsd, is available for testing. You can find it in my testing repository.

Please report success / failure / comments / problems in this thread. Thanks for your help !

GPSD, in your repository, has a problem.  (Double striping maybe?)

I tried it with the "standard"  WH R3 but it just says KILLED.   I then download your version of WR R3 (http://openwrt.org/downloads/people/nic … uashfs.bin).  Configure it and installed gpsd from the repository again.

Same results.  KILLED.

Would you like some beta testers? :-)

mark KD5AMB

What about package dependencies?

root@OpenWrt:/etc# ipkg info gpsd
Package: gpsd
Version: 2.30-1
Depends: libpthread, uclibc++
Status: install user installed
Section: net
Architecture: mipsel
maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
MD5Sum: 70e26ae0d059ab9b6fd63540379eef28
Size: 65865
Filename: gpsd_2.30-1_mipsel.ipk
Source: buildroot internal
Description: An interface daemon for GPS receivers.

Successfully terminated.

root@OpenWrt:/etc# ipkg info libpthread
Package: libpthread
Version: 0.9.27-1
Status: install ok installed
Section: libs
Architecture: mipsel
maintainer: Nico <nthill@free.fr>
MD5Sum: 5e04769f3572902e80dbbe77df34e1ff
Size: 18659
Filename: libpthread_0.9.27-1_mipsel.ipk
Source: buildroot internal
Description: POSIX threads library

Successfully terminated.
root@OpenWrt:/etc# ipkg info uclibc++
Package: uclibc++
Version: 0.1.11-1
Status: install ok installed
Section: libs
Architecture: mipsel
maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
MD5Sum: 19d8b0ce32b12d4a61fc72a86469421a
Size: 55430
Filename: uclibc++_0.1.11-1_mipsel.ipk
Source: buildroot internal
Description: A standard c++ library for embedded systems

Successfully terminated.

(Last edited by frogzoo on 1 Nov 2005, 01:52)

Nico wrote:

A new package, gpsd, is available for testing. You can find it in my testing repository.

Please report success / failure / comments / problems in this thread. Thanks for your help !

I've got my copy of gpsd to compile.  But I get the same thing your version does.  When I issue a gpsd or even a "gpsd /dev/tts/1" I just get

  KILLED

and the prompt back.   Other ipkg installs work just fine.  has anyone got this to work or is it just me?

thanks

root@ap4:~# ipkg install http://openwrt.org/downloads/people/nico/testing/mipsel/packages/gpsd_2.30-1_mipsel.ipk
Downloading http://openwrt.org/downloads/people/nico/testing/mipsel/packages/gpsd_2.30-1_mipsel.ipk
Installing gpsd (2.30-1) to root...
Configuring gpsd
Successfully terminated.

root@ap4:~# gpsd -h
usage: gpsd [-d dgpsip-server] [-D n] [-F sockfile] [-P pidfile] [-S port] [-h] device...
  Options include:
  -d host[:port]                = set DGPS server
  -F sockfile                   = specift 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

0xc0de, are you running a stock WhiteRussian RC3 now ? If are still running the image you grabbed from my testing directory, you are certainly not...

Nico,
Works on a WRT54GS v2.0.  Thank you very much.

Nico wrote:
root@ap4:~# ipkg install http://openwrt.org/downloads/people/nico/testing/mipsel/packages/gpsd_2.30-1_mipsel.ipk
Downloading http://openwrt.org/downloads/people/nico/testing/mipsel/packages/gpsd_2.30-1_mipsel.ipk
Installing gpsd (2.30-1) to root...
Configuring gpsd
Successfully terminated.

Well, I tried it on my Linsys 54GS (no v #) - This works..  smile

What it isn't working on is a Linksys 54G V.2. :rolleyes

Why would this be?

By the by, anyone managed to get ntpclient to work with gpsd?

my /etc/ntp.conf

server 127.127.28.0 

server 127.127.28.1

just gives me a generic "connection refused" when starting ntpclient

Also there's a problem somewhere. Gpsd craps out for me after 20mins or so. Will upgrade to latest and retest.

(Last edited by frogzoo on 10 Nov 2005, 14:38)

frogzoo wrote:

By the by, anyone managed to get ntpclient to work with gpsd?

my /etc/ntp.conf

server 127.127.28.0 

server 127.127.28.1

just gives me a generic "connection refused" when starting ntpclient

Also there's a problem somewhere. Gpsd craps out for me after 20mins or so. Will upgrade to latest and retest.

I'd like to see suggestions on making gpsd work to set the local time, too.  Should it be ntpclient or ntpd that works with gpsd? 

On your gpsd stopping after twenty minutes ... My gps unit is a fairly cheap  Holux unit.  It falls out of NMEA mode into SiRF from time to time.  You might be having the same problem.  Fix it by starting gpsd, then sending N=0 to the gps.  Mine needs this after each power cycle.

> I've got my copy of gpsd to compile.  But I get the same thing your version > does.  When I issue a gpsd or even a "gpsd /dev/tts/1" I just get
> KILLED

This is a memory related problem. On 16MB machines gpds will not start. I solved the problem on my 16 MB Asus Wlhdd (includes a harddisk) by adding swap space.

After starting up, gpsd uses not much ram, only about 600 Byte.

I'm in a little hurry but decided to post this before forgeting it again..
My royaltek bluetooth gps dongle also doesn't work with that gpsd version (probably due to those sirf issues, haven't really looked at it yet). So I packaged gpsd 2.09 and since that version doesn't yet have ntpd support, I solved the date setting problem by adding this in init.d/S99done after insmodding bluetooth.

hciconfig hci0 && (hciconfig hci0 up;
rfcomm bind 0 00:00:DE:CA:FB:AD 1 &&
gpsd -np /dev/bluetooth/rfcomm/0

# to-do: poll for the lock instead of testing for "correct" year

# EDIT: strike that, see below

) >>/tmp/bootup.log

(Last edited by waddler on 12 Dec 2005, 07:59)

Ok, that's what you get for rewriting something without testing it properly, this works better..

i=0; while (i=$(($i+1)) && [ "$i" -lt 5 ]); do
        sleep 5
        date=$(echo 'd' | nc localhost 2947)
        year=$(echo $date | sed 's/.*D=\([0-9]*\)-.*/\1/')
        [ "$year" -gt 2004 ] && break
done; echo "slept $i times while waiting gps lock.."

echo "Setting date $date"
date -s $(echo $date | sed 's/GPSD,D=\([0-9]*\)\(.*\):.*/\2\1/' | sed 's/[^0-9]//g')

Hope that helps someone.

waddler wrote:

[script for setting date from gpsd output]
Hope that helps someone.

Wonderful!!!  Thank you so much.

Looks like Nico's gpsd pkg is gone.  Is there another on the net?

(Last edited by mrdvt92 on 23 May 2006, 03:32)

new netcat installed on 8.09 and new script:

        #setup time via gps
        i=0;
        while (i=$(($i+1)) && [ "$i" -lt 5 ]);
        do
        sleep 5
           (echo d ; sleep 1; echo d; sleep 1; echo d) | (nc localhost 2947) > /tmp/gps_time &
           TEST=$!
           sleep 4
        kill -s SIGINT $TEST
        killall nc
        date=$`cat /tmp/gps_time | tail -n 1`
        year=$(echo $date | sed 's/.*D=\([0-9]*\)-.*/\1/')
        [ "$year" -gt 2004 ] && break
        done;
        echo "slept $i times while waiting gps lock.."
       
        echo "Setting date $date"
        date -s $(echo $date | sed 's/GPSD,D=\([0-9]*\)\(.*\):.*/\2\1/' | sed 's/[^0-9]//g')

The discussion might have continued from here.