Librem 5 GPS/Location Tracking

It needs six, no, seven points
No, four on earth (1,2,3 etc.)

Now I got GPS working! Seems like it needed to be outdoors, putting it in a window was not enough to get a fix. I used sudo cat /dev/gnss0 while walking around the house and put the result of that in a file tmp.nmea, then convert the nmea to gpx format like this:

gpsbabel -i nmea -f tmp.nmea -o gpx -F tmp.gpx

then it works to show the resulting track in GNOME Maps like this:

gnome-maps tmp.gpx

Then GNOME Maps opens and shows it, it even centers on it and zooms in:


This is so unixy :heart:

Spent some time out in a field and I have now managed to get a valid latitude and longitude out of /dev/gnss0 and it agrees well enough with an iPhone at the same location.


I got GPS location working in Pure Maps (on the L5)!
I had to

  1. Have clear sky
  2. wait ~10 minutes for the first fix (but then the fix is acquired fast, even after a reboot)
  3. Build gps-share and run it (quite simple, build it with cargo build. I just had to sudo apt install libudev*)
  4. fix .local domain name resolution
    4b. try where-am-i and verify it works
  5. to debug problems, check status of geoclue service
  6. run pure maps :slight_smile:

Updates are a bit laggish but navigation is finally usable!


This is probably because of the almanac and ephemeris getting downloaded the first time and then being saved, as Angus wrote about above.

Could you explain what that means?

Is “where-am-i” some command-line tool, or a function inside the Pure Maps app?

1 Like

It’s a command line tool in the geoclue-2-demo package which lives under /usr/libexec/geoclue-2.0/demos/where-am-i. It just prints out the location from geoclue. Since it connects to geoclue, if there are problems in getting the position, systemctl status geoclue prints out errors in the setup, if any.

When I started gps-share the first time, it found the gps device and said

Attempting to autodetect GPS device...
Attempting to autodetect GNSS device...
Detected /dev/gnss0 as a GPS device
TCP server bound on all interfaces
Port: 10110
group: /Client4/EntryGroup1

I also started cgps, which had 3D FIX, but where-am-i reported the location with 20000m accuracy (so it was definitely not using gps). systemctl status geoclue showed an error in domain name resolution of pureos.local. I just added pureos.local to the line in the hosts file (I really needed gps because I was lost, that’s the most quick fix I found).

(gps-share cpu usage is 0 when nothing is connected to it, and jumps to 12-15% when there’s a client. Also, I’m running it with --network-interface lo to prevent other devices from accessing its location remotely)


cgps uses gpsd which will likely break gps-share or gnss-share.

Only one of gpsd or g*-share should be given access to the /dev/gnss0 device at a time.

If you want to spoof gpsd on a system using gnss-share use something like this



socat -d -d -d -lf /tmp/socat.log TCP-LISTEN:${PORT},reuseaddr,fork UNIX-CLIENT:${SOCK} &

My experience with librem 5 in italy. Using, with Librem 5, gnome maps or in the browser with openstreetmap, my position is reported further south of about 140 m. On the other hand, with a phone with android the position is exact with a maximum error of 5 m.

1 Like

I’m in italy too, and it works ok, sometimes with reported error less than 5m. Did you try xgps?

1 Like

Maybe connecting the Librem5 to an external bluetooth GPS could be a good solution and I’m looking for if it can be done on gnome-maps or pure-maps (I can’t get a good GPS signal )

But on my Librem 5 Bluetooth does not work! I cannot enable BT.

Bluetooth is somewhat unreliable on my L5 too. Usually it can be solved by toggling the kill swith for wifi/BT.

I have tried in every way also with the kill switch, but nothing.

Eventually the gps works. I put him in my car and, after reporting for about 30 minutes that I was in China, he finally found himself well. It was a pleasure to see the directions on pure maps. But I think that the use of an external GPS receiver connected with bluetooth would be better. With bluetooth I have some difficulties for pairing and, in any case, I don’t know how to get the GPS signal from the receiver to the Librem5 and display the exact position on pure maps by not activating the Librem5 localization. We’ll see.
P.S. however the Librem5 is fantastic :slight_smile:


I’m watching the GPS receiver with grep for the GSV messages and have here an example:

 GPS only mode
   GSV record
       2 total amount of GSV messages
         1 continued number of this GSV message
           06 total number of sats in view
              15 SatxPRN Satellites list used for positioning
                 54 SatxElev evaluation in degrees           
                    011 SatxAzim Azimuth of satellite x in degree, ref. "North",
                       ,, SatxCN0 Carrier to Noise Ratio for satellite x in dB
                         18 SatxPRN
                            51 SatxElev
                               322 SatxAzim
                                  ,, SatxCN0

i.e. all GSV messages have an empty SatxCN0, between ,,. Does this mean that the hardware is broken?

It means that the module knows it should be able to see those satellites , probably based on at least a partial almanac download.

It’s not actively receiving any data from those satellites so it doesn’t show a signal to noise ratio.

Make sure it has an unobstructed view of the sky and that it’s not moving. Turing off the screen and logging in via ssh might almost improve the S/N ratio.

The L5 sits in my garden on a table, in the middle of the garden, with blue sky above. The display is off and I’m running the test via SSH.

I’ve a 2nd device L5 (the one of my son) and this works fine on the same table, getting GSV records with signal strength value and a GPS fix after a few minutes.

Could it be that the ground on the GNSS antenna is broken, or would this show no GSV records at all in this case.

On some devices the ground does not make a great connection with the frame. It can sometimes be fixed by disassembling it and adjusting the ground. You could also talk to about the device.

I’ve contacted support@ with all the logs etc. because I can’t do such deep disassembling, esp. not within the warranty. We will see.