Active Topics

 



Notices


Reply
Thread Tools
Posts: 1,378 | Thanked: 1,604 times | Joined on Jun 2010 @ Göteborg, Sweden
#11
Originally Posted by Halftux View Post
Thank you for the feedback. At the moment nothing is planned for future releases. Some ideas or wishes?
Ok, this likely is out of scale BUT, the n900 is a great GPS device but it lacks an implementation of GPSd, or a nmea (some such) output daemon.

CNT (Columbus Navigation Toolkit) provides such but 1) it has a GUI and does a whole lot more (resource hungry but very stylish) and 2) is unstable.

I submit that the above is broadly consistent with gpscon current mission. Easy to write huh, as a non-coding, ageing smart-***, I know :-)
 

The Following User Says Thank You to handaxe For This Useful Post:
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#12
Originally Posted by handaxe View Post
Ok, this likely is out of scale BUT, the n900 is a great GPS device but it lacks an implementation of GPSd, or a nmea (some such) output daemon.
This is a different approach and would be nice to have. However my application is more an example for a qt console application which uses the qt location api and thus it is limited by the api.
 

The Following 2 Users Say Thank You to Halftux For This Useful Post:
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#13
Originally Posted by juiceme View Post
This is pretty neat as now I can run it from cron every half an hour or so and push the position to my server. Just perfect in case I lose my device or it gets stolen.
If I may ask you, how did you do it?

The reason I ask... I have the following script running every 3 minutes from cron:
Code:
#!/bin/sh

STR=`gpscon runs=1`

LAT=`echo $STR | cut -d " " -f 2 | cut -d ";" -f 1`
LON=`echo $STR | cut -d " " -f 4 | cut -d ";" -f 1`
ALT=`echo $STR | cut -d " " -f 6`

STR={\"name\":\"`hostname`\",\"time\":`date +%s`,\"lon\":$LON,\"lat\":$LAT
if [ $ALT != "nan" ]; then
  STR=$STR,\"alt\":$ALT
fi
STR=$STR}

curl -H "Content-Type: application/json" -X POST -d $STR \
  http://<myserver>/gpscon/json.php -k
But I am getting some strange results. Basically, I have about 30 hours of exactly the same data (with only the time stamp updating), even though I drove about 50km, spent the night and drove 50km back again.

I then experimented with gpscon a bit more and found that it always returns the same previous value if run only once. Only when run two or more times, it starts updating the value.

Unfortunately,
Code:
gpscon runs=x
results in spawning a new instance every time my cron job kicks in and the previous instance never terminates if x is any value other than 1. That means that after 30 minutes I have 10 instances of gpscon running and no data uploaded because my script never passed that line. If I use x=1, the script runs normally but the value is never updated.

What am I doing wrong?
__________________
Русский военный корабль, иди нахуй!

Last edited by pichlo; 2016-02-26 at 16:00.
 

The Following 2 Users Say Thank You to pichlo For This Useful Post:
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#14
In addition to the above, I get strange results like:
Code:
[nemo@Dinghy ~]$ gpscon
Latitude: 51.6126; Longitude: -0.730567; Altitude: nan
Latitude: 51.6126; Longitude: -0.730567; Altitude: nan
Latitude: 51.6126; Longitude: -0.730567; Altitude: nan
Latitude: 51.6126; Longitude: -0.730564; Altitude: nan
^C
[nemo@Dinghy ~]$ gpscon runs=1
Latitude: 51.6126; Longitude: -0.730567; Altitude: nan
[nemo@Dinghy ~]$
How can I explain the last run (with runs=1)? Why is it different than the last line of the previous run?
I would expect...
  1. The coordinates are updated. But then each run should print updated values. This is not the case, the values stay the same with runs=1 when I move.
  2. The coordinates are not updated. But then the values should match the last line of the previous run.

Moreover... I open two terminal windows, one with gpscon running permanently (I see the values changing in the last digit). In the other, I run gpscon runs=1 manually from time to time. I expect the manual run reflect the current values from the window with gpscon running permanently, but it is always the same.

What is going on?
(Experiments run on Sailfish if that makes a difference.)
__________________
Русский военный корабль, иди нахуй!
 
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#15
Even better:
Code:
[nemo@Dinghy ~]$ gpscon
Latitude: 51.6126; Longitude: -0.730567; Altitude: nan
Latitude: 51.6844; Longitude: -1.26139; Altitude: nan
Latitude: 51.6844; Longitude: -1.26139; Altitude: nan
Latitude: 51.6844; Longitude: -1.26139; Altitude: nan
^C
[nemo@Dinghy ~]$ gpscon runs=1
Latitude: 51.6126; Longitude: -0.730567; Altitude: nan
[nemo@Dinghy ~]$
WTF???

However,
Code:
[nemo@Dinghy ~]$ gpscon runs=3
Latitude: 51.6126; Longitude: -0.730567; Altitude: nan
Latitude: 51.6844; Longitude: -1.26139; Altitude: nan
Latitude: 51.6844; Longitude: -1.26139; Altitude: nan
[nemo@Dinghy ~]$ gpscon runs=1
Latitude: 51.6844; Longitude: -1.26139; Altitude: nan
[nemo@Dinghy ~]$
So clearly, the last known value gets updated only when
  1. gpscon has completed at least two runs and
  2. gpscon terminated on its own, without ^C

The remaining £100 question is, why does gpscon runs=3 not terminate when run from a script triggered by cron when it quite happily terminates when the same script is run manually from the command line.
__________________
Русский военный корабль, иди нахуй!
 
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#16
@ pichlo, sorry I do not have sailfish . But I will look into your posts and see if I can help you.

One thing is the position api can get different positions. So after some time you should get exact values when your gps signal is fixed.

First I would set position method option to "posm=onlysat".

Code:
Satellite-based positioning methods such as GPS.
A good approach would be to use the [limit=integer] option.
Set it to 80 and this would lead to one print out with a fixed gps position.
 

The Following User Says Thank You to Halftux For This Useful Post:
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#17
Hmm. Something is fishy here. I tried gpscon limit=80 and it never terminated (not in 5 minutes anyway). Neither did limit=10.
__________________
Русский военный корабль, иди нахуй!
 
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#18
Originally Posted by pichlo View Post
Hmm. Something is fishy here. I tried gpscon limit=80 and it never terminated (not in 5 minutes anyway). Neither did limit=10.
I dont know maybe on sailfish it has different values for a fixed signal or you have a very bad view to the satellites.

gpscon posm=onlysat --fout --sat

Let it run and see how the values are changing. What is the minimum value for your accuarcy?
 
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#19
@pichlo By the way the altitude is nan this means the position doesn't come from the gps.


Originally Posted by pichlo
1. That means that after 30 minutes I have 10 instances of gpscon running and no data uploaded because my script never passed that line. If I use x=1, the script runs normally but the value is never updated.
About the instances I don't know I will try to run your script on the N900 with alarmed, no clue why it couldn't terminate.

Is it worth to try in another script after some timout.
Code:
kill -SIGTERM $(pidof gpscon)
Don't know if you are able to read the output.

It could be that the value will not change because it is a last known value (it shouldn't take it), or the value comes from a not very accurate positioning method. However the N900 and the N950 act different because of different qtmobility. Maybe Jolla also act different.

P.S.: Maybe the first value is the lastknown value could be a bug in the last version, I will look into the source code.

Last edited by Halftux; 2016-02-26 at 23:37.
 

The Following 2 Users Say Thank You to Halftux For This Useful Post:
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#20
Originally Posted by Halftux View Post
Let it run and see how the values are changing. What is the minimum value for your accuarcy?
Oh, I get it now! The "limit" is on accuracy, not time! Silly me

I ran it indoors but on the upper floor of a typical 2-story English house with thin wooden floors and ceilings. No concrete. It started off with 0 out of 19 satellites used, accuracy something like 67. Then I put it in the window while tucking the kids in the bed. I do not know long it took as I was busy but now, after 3894 runs, it says 5 out of 20 sats used, accuracy 4.

Originally Posted by Halftux View Post
@pichlo By the way the altitude is nan this means the position doesn't come from the gps.
That makes sense. But it turns upside down my understanding of how the positioning in Sailfish works. I never turn it off and I was assuming that it would stay locked. Apparently not.

BTW the altitude was a number sometimes
__________________
Русский военный корабль, иди нахуй!
 

The Following User Says Thank You to pichlo For This Useful Post:
Reply

Tags
console, location, position, shell


 
Forum Jump


All times are GMT. The time now is 19:29.