We have moved to a new Sailfish OS Forum. Please start new discussions there.
4

Enable/Activate GPS positioning in terminal commandline

asked 2018-11-07 07:17:59 +0300

brinZ gravatar image

updated 2018-11-08 15:44:17 +0300

jiit gravatar image

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?

edit retag flag offensive close delete

Comments

According to the comments, phklrz's answer does not work... Why was it accepted? My answer works.

slowcyclist ( 2018-12-05 16:28:02 +0300 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2018-11-07 13:12:46 +0300

phklrz gravatar image

updated 2018-11-07 13:14:45 +0300

Hello

you can try

devel-su connmanctl enable gps

edit flag offensive delete publish link more

Comments

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 +0300 )edit

Thanks 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 +0300 )edit

Also:

# /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 +0300 )edit

Just tested on my second working Jolla device; the output of harbour-pitot not depending on actived or not Location function.

brinZ ( 2018-11-07 22:47:12 +0300 )edit

Just 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 +0300 )edit
0

answered 2018-11-25 18:45:18 +0300

slowcyclist gravatar image

updated 2018-11-26 12:53:54 +0300

The 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.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
5 followers

Stats

Asked: 2018-11-07 07:17:59 +0300

Seen: 566 times

Last updated: Nov 26 '18