Re: GPS - how to get lat lon and time from a bash script file ?

2009-02-24 Thread kimaidou
Hi all

I come back after some tests. I would like to stick on bash script for
several reasons (don't want to load another instance of python just to
record some sound, etc.). So among your answer, I tried to use one of this
line

echo p | nc -w1 0 gpsd | tr -d '\r\n' | cut -d'=' -f2

But I got nothing in return. Could you please be more specific :
* do I need to start gpsd first
* will this work on every distribution, or do I need to change gpsd by
fso-gpsd or anything else ?
* how do I know I have a fix before using this line ?

Thanks in advance
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GPS - how to get lat lon and time from a bash script file ?

2009-02-24 Thread Timo Juhani Lindfors
kimaidou kimai...@gmail.com writes:
 * do I need to start gpsd first

Sure, netcat talks to gspd.

 * will this work on every distribution, or do I need to change gpsd by
 fso-gpsd or anything else ?

It works with anything that speaks the gpsd protocol.

 * how do I know I have a fix before using this line ?

It will return ? when you don't have a fix I think.


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GPS - how to get lat lon and time from a bash script file ?

2009-02-24 Thread Ed Kapitein
Hi kimaidou,

on om 2008.12 do:

-1 in settings turn on gps hardware
-2 start gpsd (/etc/init.d/gpsd start)
-3 read the gps data (gpspipe -r)

To check if you have a fix, you might want to clean out the lines that
have no lat/long info like this:

gpspipe -r | grep GPGGA | grep -v ',,'

And to get it in a human readable format you can use
gpspipe -r | dd count=20 |  gpsbabel -i nmea -f - -o gpx -F -

Please read the man pages of gpsd, gpspipe, dd and gpsbabel, they are
good starting points for learning
bash scripting.

For me echo p | nc -w1 0 gpsd  is *not* working.

Kind regards,
Ed



kimaidou wrote:
 Hi all

 I come back after some tests. I would like to stick on bash script for
 several reasons (don't want to load another instance of python just to
 record some sound, etc.). So among your answer, I tried to use one of
 this line

 echo p | nc -w1 0 gpsd | tr -d '\r\n' | cut -d'=' -f2

 But I got nothing in return. Could you please be more specific :
 * do I need to start gpsd first
 * will this work on every distribution, or do I need to change gpsd by
 fso-gpsd or anything else ?
 * how do I know I have a fix before using this line ?

 Thanks in advance
 

 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community
   


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GPS - how to get lat lon and time from a bash script file ?

2009-02-23 Thread Ed Kapitein
Hi Kimaidou,

I put some script on http://wiki.openmoko.org/wiki/User_talk:Kapiteined
and start and stop gps in those scripts.
And also clean the gps logs from data without a valid lat/long (thus
without having a fix).

Please feel free to browse trough the scripts and use whatever you like
about it.

Kind regards,
Ed

On Sun, 2009-02-22 at 14:00 +0100, kimaidou wrote:
 Hi,
 
 I am developping voicenote (1), and I would like to implement a new
 function : localize each audio note with the gps latitude, longitude
 and time. Since I would like the soft to be plateform independant, I
 ask you to tell me how can I :
 * start gps if it is not
 * know when I got a fix
 * put the latitude, longitude and time into variables (and why not the
 precision too : hdop)
 * shutdown gps if it was not up when the script loads (if you think it
 should do so)
 
 Thanks for any help.
 
 NB: I am just begining scripting; I know nothing about dbus (only copy
 paste some working lines), etc. Please be patient :D
 
 (1) http://wiki.openmoko.org/wiki/Voicenote
 
 Kimaidou
 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GPS - how to get lat lon and time from a bash script file ?

2009-02-23 Thread kimaidou
Thanks very much to all for  your kind and quick answers. I will try do use
them when I have time

kimaidou

2009/2/23 Ed Kapitein e...@kapitein.org

 Hi Kimaidou,

 I put some script on http://wiki.openmoko.org/wiki/User_talk:Kapiteined
 and start and stop gps in those scripts.
 And also clean the gps logs from data without a valid lat/long (thus
 without having a fix).

 Please feel free to browse trough the scripts and use whatever you like
 about it.

 Kind regards,
 Ed

 On Sun, 2009-02-22 at 14:00 +0100, kimaidou wrote:
  Hi,
 
  I am developping voicenote (1), and I would like to implement a new
  function : localize each audio note with the gps latitude, longitude
  and time. Since I would like the soft to be plateform independant, I
  ask you to tell me how can I :
  * start gps if it is not
  * know when I got a fix
  * put the latitude, longitude and time into variables (and why not the
  precision too : hdop)
  * shutdown gps if it was not up when the script loads (if you think it
  should do so)
 
  Thanks for any help.
 
  NB: I am just begining scripting; I know nothing about dbus (only copy
  paste some working lines), etc. Please be patient :D
 
  (1) http://wiki.openmoko.org/wiki/Voicenote
 
  Kimaidou
  ___
  Openmoko community mailing list
  community@lists.openmoko.org
  http://lists.openmoko.org/mailman/listinfo/community


 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


GPS - how to get lat lon and time from a bash script file ?

2009-02-22 Thread kimaidou
Hi,

I am developping voicenote (1), and I would like to implement a new function
: localize each audio note with the gps latitude, longitude and time. Since
I would like the soft to be plateform independant, I ask you to tell me how
can I :
* start gps if it is not
* know when I got a fix
* put the latitude, longitude and time into variables (and why not the
precision too : hdop)
* shutdown gps if it was not up when the script loads (if you think it
should do so)

Thanks for any help.

NB: I am just begining scripting; I know nothing about dbus (only copy paste
some working lines), etc. Please be patient :D

(1) http://wiki.openmoko.org/wiki/Voicenote

Kimaidou
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GPS - how to get lat lon and time from a bash script file ?

2009-02-22 Thread Timo Juhani Lindfors
kimaidou kimai...@gmail.com writes:
 * know when I got a fix
 * put the latitude, longitude and time into variables (and why not the
 precision too : hdop)

$ cat bin/gps-get-position
#!/bin/sh
echo p | nc -w1 0 gpsd | tr -d '\r\n' | cut -d'=' -f2



___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GPS - how to get lat lon and time from a bash script file ?

2009-02-22 Thread Michele Renda
 NB: I am just begining scripting; I know nothing about dbus (only copy 
 paste some working lines), etc. Please be patient :D

This is not bash, but python, and it need lib_pyfso_gobject import. The 
good part is that it use fso-frameworkd

But I think it can help:

from lib_pyfso_gobject import *
import gtk

usage = OUsaged()
gps= OGpsd()

usage.request_resource('GPS')

def on_gps_fix(status):
 print Fix status:  + str(status)

def on_gps_position(fields, tstamp, lat, lon, alt):
 print '-' * 10
 print 'Lat: ' + str(lat)
 print 'Log: ' + str(lon)
 print 'Alt: ' + str(alt)

gps.connect('fix-status-changed',on_gps_fix)
gps.connect('position-changed',on_gps_position)

gtk.main()

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community