Pinephone - GPS/GNSS working?

I am trying to figure out whether my Pinephone running Beta2 with Phosh (20201117) is able to receive any GNSS (GPS, GNONASS etc.) signals.

When I installed Pure Maps (as a Flatpak - btw. great software) I wasn’t able to establish my position. So, I did some browsing over at the Pine64 forum and came across this command to enable the GPS hardware.

sudo mmcli -m 0 --location-enable-gps-nmea

Unfortunately, this is what I get:

** (mmcli:6566): WARNING **: 12:38:39.568: (mm-object.c:108):mm_object_get_modem: runtime check failed: (MM_IS_MODEM (modem))
error: couldn't find modem

I am not sure what this means. :face_with_raised_eyebrow: Could this be software or hardware related?
BTW, all of the killswitches are set to on, i.e. everything should be enabled.

Any help on this would be appreciated.

You can list the available modems via

sudo mmcli -L

Most likely your phone went to suspend and after restarting the modem it assigned it another number than 0.
On the other hand, I haven’t been able to establish any GPS location either. Enabling gps-nmea and gps-raw seems to work fine, but it never fixes on the position. It doesn’t even find a single satellite at all for me.

I had a brief moment of success when gnome-maps showed some unusual position that wasn’t the “expected” cell-tower derived position, but I did not verify if it were due to the GPS or not. Might have been connected to another cell tower, what resulted it a different position on the map.

1 Like

Thank you, idorobots!

After two reboots, suddenly something came up when I typed mmcli -L. Phew!

However, I just hit the next roadblock. mmcli -m 0 shows me this (among other things).

  Status   |                   state: failed
           |           failed reason: sim-missing
           |             power state: on
           |          signal quality: 0% (cached)

Is this supposed to mean that GPS reception will not work unless there is a SIM inserted? I definitely hope not. After all, I am not interested in A-GPS at all but rather good old satellite reception. Also, I don’t really have a spare micro SIM. Is there a way to steer around this?

This is just the GSM modem status, to obtain the location status you probably want to use:

sudo mmcli -m 0 --location-status

For gps-nmea and gps-raw you don’t need a sim card. To fetch the current location data you can use:

sudo mmcli -m 0 --location-get

For me it just returns empty data, however. No fix is ever achieved, nor does it see any satellites.

I believe there was a post somewhere that claimed that gnome-maps worked with GPS, but I cannot find it right now. Curiously enough, currently geoclue seems to lack the relevant permissions to configure the GPS receiver, so gnome-maps rightfully doesn’t use that:

Nov 19 16:24:31 manjaro-arm geoclue[4184]: Failed to set GPS refresh rate: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for 'org.freedesktop.ModemManager1.Device.Control'
Nov 19 16:24:31 manjaro-arm geoclue[4184]: Failed to enable GPS: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for 'org.freedesktop.ModemManager1.Device.Control'
Nov 19 16:24:31 manjaro-arm geoclue[4184]: Failed to enable 3GPP: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for 'org.freedesktop.ModemManager1.Device.Control'

I’m not sure if any extra steps are required in order to get the GPS operational in the current beta. :frowning:

1 Like

Thanks again, idorobots! I really appreciate your help.

Of course, I tried these commands immediately. Unfortunately, I wasn’t that lucky.

[manjaro@manjaro-arm ~]$ sudo mmcli -m 0 --location-status
error: modem not enabled yet
[manjaro@manjaro-arm ~]$ sudo mmcli -m 0 --location-get
error: modem not enabled yet

I vaguely remember reading about the SIM being important for some other seemingly unrelated problem. Can’t find it again, though. After all, I’ve been reading a lot about the Pinephone for months now (until I finally got mine last Friday).

I really wonder if there is any way to enable the modem even without having a SIM. Just to check, you have a SIM inserted, right?

Yes, I do have a sim inserted. Bummer, you can try to enable the modem manually first, but I don’t expect it to work, as the modem manager should handle that by itself.

sudo mmcli -m 0 --enable

I can verify now that it does work with a SIM inserted and unlocked. Alas, if I don’t enter the PIN, I’ll just get this:

[manjaro@manjaro-arm ~]$ sudo mmcli -m 0 --location-status
error: modem not enabled yet

So, it’s official I guess; no GPS without an active SIM. Sigh, that sure is a bummer. I wonder if this [can be|has been] fixed through the modem firmware? I heard there are several versions of that around. I hope somebody will be able to shed some light on this, please.

However, since you have your GPS up and running, how about trying to install OSM Scout Server and Pure Maps? Both are available as Flatpaks (you might have to install that first). It sure is the best GPS software I’ve experienced. The maps are downloaded to OSM Scout Server which runs as a local server on your phone. Pure Maps needs to be switched to “Profile -> Offline”. If you install flite, you’ll also get voice turn-by-turn instructions.

Hi, I can confirm GPS appears working here (in gnome maps) without a SIM card. Switching WWAN on/off does not make a difference for GPS functioning. Right after boot the modem is listed once (“QUECTEL”), but immediately afterwards not found again. I just got the phone, running stable repo so far.

edit: It appears that mmcli does not address the GNSS portion of the modem (mentioned on pineforum), that may be why your mileage varies. I installed the gpsd package with GPS cli tools. Initially a sudo gpscat /dev/ttyUSB1 appeared to dump NMEA data, but then the device disappeared.

Ah, good catch. Turns out I can get the GPS to run if I enable it via an AT command:

# mmcli -m 0 --command="AT+QGPS=1,30,50,0,2"

Then /dev/ttyUSB1 starts periodically sending NMEA messages for however long you have the phone going and gpsd is able to forward that data elsewhere. Still can’t get a fix or ever see any actual GPS data received, though, no matter how good the weather is or how long I leave it be.
Is there any extra setup needed? I imagine it’s just not going through the cold start procedure correctly without some extra external help.

I saw a user posting a git-hosted script on pineforum, which interprets the output. It downloads external mapping tables for the task. I have not tried it, but perhaps it gives the extra help. If you can’t find it, I can try to hunt the link on the desktop.