Enable/Activate GPS positioning in terminal commandline
Hello, how to create something like script to push location icon, if touchscreen not working. Is there solutions to manage GPS device via command line?
We have moved to a new Sailfish OS Forum. Please start new discussions there.
Hello, how to create something like script to push location icon, if touchscreen not working. Is there solutions to manage GPS device via command line?
I've just noticed the question has been updated, but certainly to start or stop the GPS, your command is 'spot on!' :)
Spam Hunter ( 2018-11-07 13:17:20 +0200 )editThanks a lot but it wrote
# connmanctl enable gps
Error gps: Already enabled
then
$dbus-launch harbour-pitot (gps application)
[D] unknown:0 - Using Wayland-EGL
[D] unknown:0 - Geoclue client path: "/org/freedesktop/Geoclue/Master/client0"
[W] unknown:0 - QMetaMethod::invoke: Unable to handle unregistered datatype 'QGeoPositionInfo'
brinZ (
2018-11-07 21:29:49 +0200
)editAlso:
# /usr/libexec/geoclue-master &
[1] 1833
[root@Sailfish nemo]# Master options:
** Message: GSettings key 'gps-baudrate' initialised to '0'
** Message: GSettings key 'gps-device' initialised to '(null)'
Found providers:
geoclue-here.provider
geoclue-hybris.provider
brinZ (
2018-11-07 21:45:45 +0200
)editJust found almost similar topic. But there is NO answer in https://together.jolla.com/question/96248/toggle-settings-from-terminal-to-start-gps/
My attempt was like:
#/bin/dbus-send --print-reply --type=method_call --system --dest=net.connman /net/connman/technology/gps net.connman.Technology.SetProperty string:Powered variant:boolean:true
Error net.connman.Error.AlreadyEnabled: Already enabled
But GPS client application still not working
brinZ ( 2018-11-07 22:47:57 +0200 )editThe Positioning settings in the UI are reflected in the /etc/location/location.conf file. Since positioning information is sensitive, applications running with standard user privilege can only read these settings (the file is read-only for the user).
If you want to enable gps positioning from command line you need super user rights. For that you'll need to have developer mode activated and to use devel-su or sudo. Warning: be careful (make a back-up of the file...), as you can break things.
The command lines that enable gps positioning are thus :
devel-su sed -i 's|^enabled=false|enabled=true|' /etc/location/location.conf
devel-su sed -i 's|^gps\\enabled=false|gps\\enabled=true|' /etc/location/location.conf
The first one is for enabling positioning as a whole, and the second one specifically enables the gps. Depending on your current settings you may need only one of the two commands, but running the two won't hurt.
Note that this does not turn the gps on until an application really needs it.
This thread is public, all members of Together.Jolla.Com can read this page.
Asked: 2018-11-07 07:17:59 +0200
Seen: 698 times
Last updated: Nov 26 '18
AGPS lets Mobile Data become active even when connected to wifi [released]
Fingerterm terminal defaults to / as current working directory [duplicate]
Improve location acquisition with wi-fi positioning [answered]
Allow to attach GPS tags (geotags) to pictures in camera
bug: Information about GPS satellites not put through to dalvik [answered]
According to the comments, phklrz's answer does not work... Why was it accepted? My answer works.
slowcyclist ( 2018-12-05 16:28:02 +0200 )edit