maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   N9: Getting GPS coordinates by shell command (https://talk.maemo.org/showthread.php?t=95813)

hj-adams 2015-08-03 14:20

N9: Getting GPS coordinates by shell command
 
hi,

first, the links in http://talk.maemo.org/showthread.php?t=63571 seems to be dead. Is there a way to get the actual GPS coordinates displayed in the terminal? I want to use it within a perl script without GUI by using the qx-command, like: @coords = qx(function_to_get_GPS-coordinates);

thanx

Dirk

www.rzr.online.fr 2015-08-03 15:27

Re: N9: Getting GPS coordinates by shell command
 
qdbus com.nokia.positioningd.context /org/maemo/contextkit/Location/SatPositioningState org.maemo.contextkit.Property.Get

peterleinchen 2015-08-03 18:06

Re: N9: Getting GPS coordinates by shell command
 
Quote:

Originally Posted by www.rzr.online.fr (Post 1478612)
qdbus com.nokia.positioningd.context /org/maemo/contextkit/Location/SatPositioningState org.maemo.contextkit.Property.Get

Thx.
But what does that output tell us?
I cannot match it with current geo location.

hj-adams 2015-08-04 03:55

Re: N9: Getting GPS coordinates by shell command
 
Hi,

the output is:
off
41151794457

I tried
qdbus com.nokia.positioningd.context /org/maemo/contextkit/Location/Coordinates org.maemo.contextkit.Property.Get
output:
41146545434

Where are the coordinates :confused:

hj-adams 2015-08-06 07:12

Re: N9: Getting GPS coordinates by shell command
 
no idea anyone?

robthebold 2015-08-06 13:03

Re: N9: Getting GPS coordinates by shell command
 
Quote:

Originally Posted by hj-adams (Post 1478781)
no idea anyone?

I can't find any documentation either that indicates if or how that 11 digit decimal integer is encoded from a position. One certainly couldn't encode a very precise 3d position in that value. So there's got to be something more to it than that one value . . .

At least "off" becomes "on" when GPS is active, e.g. after starting Drive or other positioning application.

Halftux 2015-08-07 20:42

Re: N9: Getting GPS coordinates by shell command
 
I have written a small console app (gps access through qtmobility) it is running fine with N900 but with N950 and openkernel I get an access error from dbus.

Googled after that error someone could solve it with interception.
So I don't know who ever feels like try to run it, I will attach a deb.

When it is working report how you handle aegis then I can change the output to your needs.

edit: download moved 2 post further...

wolke 2015-08-07 20:47

Re: N9: Getting GPS coordinates by shell command
 
'MainClass.Run is executing' and nothing else happens

Halftux 2015-08-07 21:16

Re: N9: Getting GPS coordinates by shell command
 
1 Attachment(s)
Quote:

Originally Posted by wolke (Post 1478945)
'MainClass.Run is executing' and nothing else happens

Oh these are good and bad news. Thanks for trying.

good: you get no error it should work
bad: I uploaded a wrong version I am very sorry

next one attached

hj-adams 2015-08-08 12:52

Re: N9: Getting GPS coordinates by shell command
 
hi,

output is:

MainClass.Run is executing
Position updated: QGeoPositionInfo(QDateTime("Sa. Aug 8 12:55:49 2015") , QGeoCoordinate(49.2471, 6.87559, 240), HorizontalAccuracy=587, VerticalAccuracy=57)
Position updated: QGeoPositionInfo(QDateTime("Sa. Aug 8 13:00:28 2015") , QGeoCoordinate(49.2444, 6.85804, 290), HorizontalAccuracy=224, VerticalAccuracy=120)
Position updated: QGeoPositionInfo(QDateTime("Sa. Aug 8 13:00:49 2015") , QGeoCoordinate(49.2454, 6.86897, 235), HorizontalAccuracy=324, VerticalAccuracy=70)

but it's not written to stdout, it's written to stderr.
second thing: it seems to be an endless loop, writing on sterr after every position update. is it possible to run only one loop? and writing to stdout?

thanx Dirk

Halftux 2015-08-08 13:23

Re: N9: Getting GPS coordinates by shell command
 
Quote:

Originally Posted by hj-adams (Post 1478995)

but it's not written to stdout, it's written to stderr.
second thing: it seems to be an endless loop, writing on sterr after every position update. is it possible to run only one loop? and writing to stdout?

thanx Dirk

Yes at the moment it is endless loop outputs updated data.
I can give out lastknown position (gps only) to stdout.
This should be possible, I will start writing this evening now I try to fix my speedometer from my car.

I am wondering why I get an access error with this app on a openmode kernel PR1.3 N950.:(

Halftux 2015-08-08 16:34

Re: N9: Getting GPS coordinates by shell command
 
1 Attachment(s)
I hope this is now what you are looking for.

wolke 2015-08-08 16:54

Re: N9: Getting GPS coordinates by shell command
 
you need to add an aegis manifest with specific dbus permissions.
also, source code?

hj-adams 2015-08-08 17:05

Re: N9: Getting GPS coordinates by shell command
 
It does exactly what I want :-)

output:
Latitude: 49.4753; Longitude: 6.66971

Halftux 2015-08-08 18:00

Re: N9: Getting GPS coordinates by shell command
 
Quote:

Originally Posted by wolke (Post 1479008)
you need to add an aegis manifest with specific dbus permissions.
also, source code?

I need to prepare the source for publishing, maybe I upload it to extras with some more options.

However the first output was the example from Nokia's API documentation.
Quote:

class MyClass : public QObject
{
Q_OBJECT
public:
MyClass(QObject *parent = 0)
: QObject(parent)
{
QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(this);
if (source) {
connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
this, SLOT(positionUpdated(QGeoPositionInfo)));
source->startUpdates();
}
}

private slots:
void positionUpdated(const QGeoPositionInfo &info)
{
qDebug() << "Position updated:" << info;
}
};

Halftux 2015-11-15 14:49

Re: N9: Getting GPS coordinates by shell command
 
1 Attachment(s)
Updated and uploaded gpscon to openrepos.

And I also compiled it for SFOS.
Has somebody the time and the willingness to try it out?:)
I don't own a SF device.

If yes, the version is attached and please report if it works.
Remove ".tar" from the attachment.

ade 2015-11-15 15:02

Re: N9: Getting GPS coordinates by shell command
 
Quote:

Originally Posted by Halftux (Post 1488219)
And I also compiled it for SFOS.
Has somebody the time and the willingness to try it out?:)
I don't own a SF device.

Looks fine on SFOS at first glance :)

Halftux 2015-11-15 17:22

Re: N9: Getting GPS coordinates by shell command
 
Quote:

Originally Posted by ade (Post 1488220)
Looks fine on SFOS at first glance :)

Thank you that was quick.

juiceme 2015-11-18 15:08

Re: N9: Getting GPS coordinates by shell command
 
Quote:

Originally Posted by Halftux (Post 1488228)
Thank you that was quick.

Do you have source code in some repository? I'd like to try your application.

Halftux 2015-11-18 23:38

Re: N9: Getting GPS coordinates by shell command
 
Quote:

Originally Posted by juiceme (Post 1488456)
Do you have source code in some repository? I'd like to try your application.

I attached the source code to a thread.
Follow the white rabbit.....

Code:

(\_/)
=(^.^)=
(")_(")



All times are GMT. The time now is 11:37.

vBulletin® Version 3.8.8