Active Topics

 


Reply
Thread Tools
Posts: 27 | Thanked: 74 times | Joined on Nov 2009
#21
I tried the example python file after adding python-location on my n900.

When i run it i get:

Code:
lat = 52.200000, long = 5.300000
quitting
every time i run it, which is not the correct location.

Anyone know what could be wrong?
 
Posts: 2 | Thanked: 2 times | Joined on Mar 2010
#22
I also had this problem, it seems that the sample code does not check if the GPS fix is real.

I have changed the line before print lat long to this:
if (device.fix[1] & location.GPS_DEVICE_LATLONG_SET) and not (device.status & location.GPS_DEVICE_STATUS_NO_FIX):

I haven't tested much after the change, but this seems to work better.

Search for GPS_DEVICE_STATUS_NO_FIX in http://wiki.maemo.org/PyMaemo/Using_Location_API
 

The Following User Says Thank You to happy_n900_user For This Useful Post:
Posts: 2 | Thanked: 2 times | Joined on Mar 2010
#23
I tried the change on the bus home, and made one more addition to that line:
if (device.fix[1] & location.GPS_DEVICE_LATLONG_SET) and (device.fix[1] & location.GPS_DEVICE_TIME_SET) and not (device.status & location.GPS_DEVICE_STATUS_NO_FIX):

N.B: I don't know if these changes have negative effects on battery drain or something else. Try these changes at your own risk.
 

The Following User Says Thank You to happy_n900_user For This Useful Post:
Posts: 27 | Thanked: 74 times | Joined on Nov 2009
#24
Works like a charm! Thanks!

It also seems to shutdown the GPS chipset after it's done.

The only issue is when it can't get a fix, you'll need to force quit.
 
Posts: 2 | Thanked: 0 times | Joined on Jun 2010
#25
Not sure if anyone cares... but i got cell_info with python like this:

Code:
import dbus

bus = dbus.SystemBus()
proxy = bus.get_object("com.nokia.phone.net","/com/nokia/phone/net",False)

cell_info = proxy.get_registration_status(dbus_interface="Phone.Net")

print cell_info
 
Reply

Tags
cell id, location, n900, python


 
Forum Jump


All times are GMT. The time now is 09:13.