Someone reported GPS positioning kind of working in February, via sudo cat /dev/gnss0:
When I just tried sudo cat /dev/gnss0 myself (on a Librem 5 Evergreen running byzantium), it does give NMEA-style output (including GPRMC and GPGGA NMEA sentences) which looks promising. I have not tried the gpsbabel conversion yet.
Edit: after looking more carefully at the NMEA output, maybe it is not that promising, it says there is no fix and the time that is supposed to be UTC time looks way off.
To get a fix with a GNSS receiver you need to have a good antenna connection and the GNSS module must have downloaded an almanac and the ephemerides for the satellites it is tracking. To speed up the process you can upload the almanac and ephmerides to the module , this is know as AGPS.
gnss_share can handle the AGPS portion and it also will share data with geoclue which is used by most L5 navigation software for geolocation.
You can copy the almanac and ephemeris from a phone that has a 3D fix to one that doesn’t and then have gnss_share upload it to the GNSS module.
If you don’t use AGPS the almanac and ephemeris will automatically get downloaded from the satellites. This takes at least 12 minutes and must have a clear view of the sky, preferably a window sill or outside. Once the initial navigation messages ( almanac and ephemeris https://en.wikipedia.org/wiki/GPS_signals#Navigation_message ) is downloaded it gets saved to battery backed RAM. If you are using gnss_share it will also get saved to the filesystem.
Initially you need to see a single satellite with a SNR of > 20 for the navigation messages to be downloaded and it must be active for more than 12 minutes. You’ll slowly see more and more satellites in the GSV messages. Once the module starts tracking satellites you will see a GSA message with satellites in it and that shows the current satellites being used for your location solution. After that you should see a GGA message that indicates a fix.
If you never see a GSV message with a SNR above 20 or a GSA message tracking satellites then it could either be a hardware problem or not enough of a view of the sky problem. The view of the sky problem can be cause by tall trees , tall buildings, metal or concrete roofs and the eaiest way is to take the L5 out into a field or some area with a full view of the sky.
If all the above fails then it may be a hardware problem. A common issue is the ground on the GNSS antenna https://puri.sm/wp-content/uploads/2021/03/22_v2.png. This part is both delicate and also must be touching the frame of the phone. On visual inspection if it is not touching the frame it can be GENTLY bent to touch it, see the dis-assembly instructions here https://puri.sm/posts/disassemble-librem-5/
See how the Signal to Noise ratio is zero for all satellites listed? I believe that means that although the ephemeris says those satellites are in view, the signal is absent or NFG.
That would explain why when I was testing this the number of satellites “in view” according to GPGSV sentences did not change when I moved the phone from the window to somewhere far away from the window. I was expecting to see fewer satellites in view, but there was no change. Probably I had never any satellite at all truly in view, the info shown was just what should be in view in theory based on the saved position and time info which are very far off.
Looks like it thinks I am in China, then I get to know which satellites would be in view it I was in China (and if the time was correct which it is not).
Watching it for awhile it does sometimes get 2 satellites that it will say yes and have a SNR of 20-27 for me. Going to try taking it into a field. Sadly my hikes don’t seem to give it what it needs being outside.
edit: even with those two it doesn’t get a fix. I think it needs 3.
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:
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.
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 127.0.0.1 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)
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.
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 )