How to get GPS to work?

I am trying to get GPS working on my PinePhone Pro running the latest testing branch from Manjaro ARM for PPP.

sudo mmcli -m 0 --location-status

and

sudo mmcli -m 0 --location-get

both give me the message:

error: modem not enabled yet

When I try to enable the modem with sudo mmcli -m 0 --enable
I get this error message:

error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: modem in failed state'

Note that I don’t have a SIM card inserted.

It is a known limitation of the hardware that the modem refuses to provide any location services if no SIM card is inserted. There is nothing the software can do about that.

1 Like

Ok, thanks, now I have inserted a SIM card.
mmcli -m 1 --location-status gives me:

  --------------------------------
  Location |         capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, gps-unmanaged, agps-msa, 
           |                       agps-msb
           |              enabled: 3gpp-lac-ci, gps-nmea, agps-msb
           |              signals: yes
  --------------------------------
  GPS      |         refresh rate: 1 seconds
           | supported assistance: xtra
           |   assistance servers: http://xtrapath2.izatcloud.net/xtra3gr.bin
           |                       http://xtrapath3.izatcloud.net/xtra3gr.bin
           |                       http://xtrapath1.izatcloud.net/xtra3gr.bin

And /usr/lib/geoclue-2.0/demos/where-am-i gives me positions using 3GPP + WiFi with 10 meters accuracy. But flatpak apps like Pure Maps still show a very inaccurate position using the IP address.
Does anyone know how to solve this issue?

Looks like the geolocation libraries inside the Flatpak cannot talk to the modem. Not sure how this can be fixed. (Maybe someone has to develop a new portal for this?) I am also getting very weird geopositioning from Pure Maps.

Hi! As I understand it, you have to enable GPS first. Otherwise, those commands will only pull the network location. Look through the GPS commands here: mmcli: Control and monitor the ModemManager | ModemManager Commands | Man Pages | ManKier

It is already enabled for the original poster:

And besides, 3gpp-lac-ci (geolocation based on the cellular network cell) is enabled by default and should provide more accurate geolocation than whatever Pure Maps ends up using by default (which I suspect is a heuristic geolocation based on the surrounding’s WiFi networks).