Active Topics

 



Notices


Reply
Thread Tools
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#1
Gpscon is a command line tool to acquire the gps position with the qtmobility/qtlocation api.

In addition it has the ability to write a log file and to save a gpx file.

Code:
gpscon v0.0.11 by halftux

Options:
--------
  [--help] help output
  [runs=integer] max update runs before quit
  [dumps=integer] ignoring first runs
  [limit=integer] accuracy vert/hori < limit 1x and quit
  [posm=string]Position method: nonesat / all / onlysat
  [interval=integer] update interval in s
  [log=string] txt/gpx/log2gpx
  [tout=integer] timeout to exit in s
  [--del] deleting log files
  [--sat] with satellite output
  [--fout] full position output
  [--date] date output
  [--time] time output
  [--newtrack] mark in log file
  [--lknv] output lastknownposition (qdebug)
  [--script] use the option for scripts (no user input)

Without runs or limit option the app is in endless loop.
With user input:
You can exit with: x+[enter].
You can mark a newtrack with: t+[enter].
You can mark a new track segment with: s+[enter]


gpscon
without parameter gpscon will be in endless loop and print to stdout: Latitude; Longitude; Altitude
The application exits with:x+[enter]
t+[enter]: will mark a new track in the logfile.

[--fout]
will enhance the output with additional values: Direction; Ground Speed; Vertical Speed;
Horizontal Acc;Vertical Acc

[--sat]
with this option also the satellite status will be requested and printed out
"Using x of x satellites"

[posm=string]
this will select the positioning method. Default is all.
string=all |AllPositioningMethods
string=onlysat |SatellitePositioningMethods
string=nonesat |NonSatellitePositioningMethods

[interval=integer]
This property holds the requested interval in milliseconds between each update.
If the update interval is not set (or is set to 0) the source will provide updates as often as necessary.
If the update interval is set, the source will provide updates at an interval as close to the requested interval as possible. If the requested interval is less than the minimumUpdateInterval(), the minimum interval is used instead.

[runs=integer]
sets the amount on how many (shown) requests are made before exit

[dumps=integer]
sets the amount on how many first requests get dumped

[limit=integer]
sets the limit of the needed horizontal/vertical accuracy value before print out.
There will be only one print out and after this the app is closing

[log=string]
writing to a log file
string=txt |write/append gpscon.log to user dir
string=gpx |write/append gpscon.log to user dir after last run or exit, the log file will be converted and written to gpscon.gpx in user dir
string=log2gpx |convert log to gpx and exit.

[tout=integer]
sets the timeout for aquire a gps position in seconds.

[--del]
If log file exists it will be removed

[--date]
adds date to output

[--time]
adds time to output

[--newtrack]
will mark in the log file a new track. When converting to gpx old log file data and new data will be visible as separate track.

[--lknv]
This should output the last known value once at first (debug). If runs=1 it will only print the last known value out and quit.

[--script]
Will deactivate the user input which causes trouble with cron or python scripts. This option is recommended when using gpscon with scripts.

[--help]
prints help


Available for
:
Sailfish
Harmattan
Fremantle


Attached is the old source code in alpha stage, I commented out not tested code. It works same like the version before, it has only more options.
New source in fremantle extra-devel repo.

For sailfish create makefile by add this argument to qmake
Code:
qmake "CONFIG+=sailfish"
Attached Files
File Type: gz gpscon-0.0.5a.tar.gz (12.7 KB, 256 views)

Last edited by Halftux; 2017-10-13 at 23:53. Reason: new version
 

The Following 24 Users Say Thank You to Halftux For This Useful Post:
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#2
Thanks, seem to work well in SFOS.

Some changes were needed to get it to compile though; I had to add " QT += positioning location" to the project file and comment out "using namespace QtMobility;" in gpspos.h

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.
 

The Following 2 Users Say Thank You to juiceme For This Useful Post:
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#3
Originally Posted by juiceme View Post
Thanks, seem to work well in SFOS.

Some changes were needed to get it to compile though; I had to add " QT += positioning location" to the project file and comment out "using namespace QtMobility;" in gpspos.h
Thats good thx for trying. For compile my source you need to add a parameter to qmake "CONFIG+=sailfish". See picture below "create steps" or build steps in german Erstellungsschritte.


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.
Thats perfect, but I hope for you that such a case will never happen.
Have fun.
Attached Images
 
 

The Following User Says Thank You to Halftux For This Useful Post:
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#4
Version for fremantle is available now.

Added log file option. When option is set to txt it will create a log file in /$userdir/gpscon.log
When the option is set gpx it will create a gpx file from the log file.
Only values with an altitude gets saved in gpx.

When you interrupt the application with control+c no gpx file will be created instead use x+enter

You will find the sources in fremantle extra repo.
 

The Following 6 Users Say Thank You to Halftux For This Useful Post:
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#5
Originally Posted by Halftux View Post
When you interrupt the application with control+c no gpx file will be created instead use x+enter
Does that mean that when my N900 reboots (as it can do several times per day now) I will lose the track?
 

The Following 2 Users Say Thank You to int_ua For This Useful Post:
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#6
Originally Posted by int_ua View Post
Does that mean that when my N900 reboots (as it can do several times per day now) I will lose the track?
It's better not to let it run all the time anyway. That's what cron is for.
__________________
Русский военный корабль, иди нахуй!
 

The Following 2 Users Say Thank You to pichlo For This Useful Post:
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#7
Originally Posted by int_ua View Post
Does that mean that when my N900 reboots (as it can do several times per day now) I will lose the track?
All data gets saved in the log file, also when you use ctrl+c.
The gpx file will only get created when the application will exit normally.
The gpx file gets created from the log file. So when your N900 suddenly reboots you can start gpscon again with gpx option and run=1 and you will have all data in the gpx file. This will work until you delete the log file.
 

The Following 3 Users Say Thank You to Halftux For This Useful Post:
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#8
With the new version 0.0.7 you can convert a log file to a gpx as follow:

Code:
/opt/gpscon/bin/gpscon log=log2gpx
gpx multi track support:
Now you can also mark new tracks in the log file. If you have an old recorded track in the log file and you would like to record another into the log file, you could start as follow:
Code:
/opt/gpscon/bin/gpscon log=gpx --newtrack
or
/opt/gpscon/bin/gpscon log=txt --newtrack
If you would like to mark a new track during recording you need to press t+[enter].
 

The Following 4 Users Say Thank You to Halftux For This Useful Post:
Posts: 1,378 | Thanked: 1,604 times | Joined on Jun 2010 @ Göteborg, Sweden
#9
Hi Halftux,

good job this. One of those programs that has utility beyond use of the n900 as a primary phone and more as a pocket computer.

Do you have a roadmap for future features, if any and however vague at the mo'?
 

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
#10
Originally Posted by handaxe View Post
Hi Halftux,

good job this. One of those programs that has utility beyond use of the n900 as a primary phone and more as a pocket computer.

Do you have a roadmap for future features, if any and however vague at the mo'?
Thank you for the feedback. At the moment nothing is planned for future releases. Some ideas or wishes?
 

The Following 2 Users Say Thank You to Halftux For This Useful Post:
Reply

Tags
console, location, position, shell


 
Forum Jump


All times are GMT. The time now is 07:27.