Posts: 95 | Thanked: 16 times | Joined on Feb 2008
#1
I was wondering if there is a way to get the gps speed lat and lon using python of the built-in gps of a n810.
__________________
My it: n810 with latest os 2008
 
Posts: 53 | Thanked: 24 times | Joined on Jan 2008
#2
*g* actually i did all this stuff yesterday ;-)
I don't remember what I installed, but you need libgpsbt.
Here http://pymaemo.garage.maemo.org/docu...les/index.html is a little summary.

I tried it on a N810 with the built-in gps and this gps-chip reported neither whether it has a fix nor does it inform me about the number of satellites in view, so I simply did a fix check like
Code:
import gpsbt, time
context = gpsbt.start()
time.sleep(2.0) # Wait for GPS to come up
gps = gpsbt.gps()
while gps.get_position() == (0,0):
    time.sleep(5.0) # We don't have a fix so we wait for one
print gps.get_position() # should be != (0,0)
Unfortunately I can't tell when I lost the fix...

/Edit: Code formatted

Last edited by Tantris; 2008-03-28 at 21:52.
 

The Following User Says Thank You to Tantris For This Useful Post:
Posts: 95 | Thanked: 16 times | Joined on Feb 2008
#3
@Tantris
Thanks for the info.
__________________
My it: n810 with latest os 2008
 
Posts: 111 | Thanked: 31 times | Joined on May 2007
#4
Hi there !

I used the pymaemo tutorial for a small application hosted on garage:

https://garage.maemo.org/projects/sayhoo/

I do not understand how to detect the fix has been lost too.

Any hint would be appreciated :-)
 
Posts: 53 | Thanked: 24 times | Joined on Jan 2008
#5
For the moment I fear the only thing we can do is to check whether the gps reports a fix (I assume that only the n810 built-in gps doesn't report the fix but a bluetooth gps should report it); so you could do something like waiting for position to be != (0,0) then check if you have a fix at that time. If yes the gps device supports it and it can be used later if no... well :|

Sad that we are unable to see the number of satellites in view, too...

Maybe someone could look inside the maemo mapper code, as maemo mapper gives all this information (and reports whether it has a fix or not).
 
Posts: 53 | Thanked: 24 times | Joined on Jan 2008
#6
Ok, the gpsbt python module is not-so-very-well documented...
calling gpsbt.gps().get_fix() also fills in the data about satellites and used satellites.
You have to call get_fix() every time you want an update or the satellite-data will stay the same... so we might do a check for a fix like
Code:
import time, gpsbt

def has_a_fix(gps):
    gps.get_fix()
    return gps.satellites_used > 0

con = gpsbt.start()
time.sleep(2.0) # wait for gps to come up
gps = gpsbt.gps()

print "Waiting for the sun... err... a fix"
while not has_a_fix(gps):
    print "Wai-ting..."
    time.sleep(5)

# do something
gpsbt.stop(con)
Obviously I was listening to The Doors...

Last edited by Tantris; 2008-03-30 at 14:20.
 
Posts: 35 | Thanked: 5 times | Joined on Sep 2007
#7
I tried gpsbt with n810 but it does not seem to work. Once I tested gpsbt+n810+external gps receiver it works. Am I missing something? Where did you get the gpsbt library? I got it in november as a part of some package. Maybe my version of gpsbt does not work with n810.
 
Posts: 53 | Thanked: 24 times | Joined on Jan 2008
#8
what was your error? Was it unable to get a fix? I simply installed the libgpsbt stuff in red pill mode via the application manager...
And sometimes I am unable to get a fix, too - but most of the time it works ...
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 02:57.