Reply
Thread Tools
Posts: 153 | Thanked: 62 times | Joined on Apr 2008
#1
I'm attaching my python code to access the GPS. It is a thin wrapper around the Maemo 4.x liblocation API described here:
http://maemo.org/development/documen....html#Location

I am running an n810 with the latest OS 2008 firmware and was not able to make the python-gpsbt module work as advertised. I decided to wrap the official location API using ctypes instead. The example usage script should "just work" to turn on your GPS and start printing location data once it locks.

This code "works for me", but should be considered alpha since I am the only one who has used it. Eventually I'll try releasing this someplace better. The example is placed in the public domain and the wrapper is licensed under LGPL v3.

The files should be renamed to *.py after downloading.
Attached Files
File Type: txt gpsexample.txt (2.0 KB, 402 views)
File Type: txt liblocation.txt (7.8 KB, 366 views)
 

The Following 4 Users Say Thank You to rbrewer123 For This Useful Post:
Posts: 5 | Thanked: 0 times | Joined on Apr 2008
#2
Thank you so much for your python wrapper. It's very useful for me.
I've detected a really weird error:
When I load your liblocation from console applications or graphic applications everything works well. But if I try to load it from some "hildon desktop home plugin" (aka widget) I get the error:
File "/usr/lib/hildon-desktop/gps_N800.py", line 1, in <module>
import liblocation
ImportError: dynamic module does not define init function (initliblocation)

I don't have any Idea about how to fix it. It doesn't have any sense¡
 
Posts: 5 | Thanked: 0 times | Joined on Apr 2008
#3
I reply myself:
Adding
Code:
def __init__():
    pass
It works.
I should read better the error messages. Sometimes are useful.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT -4. The time now is 06:53 PM.