Librem 5 GPS/Location Tracking

I know that some have had GPS issues with the phone from the factory, which would possibly explain why the initialization procedure does not work for you. Two hours would be plenty of time to initialize. Wifi must be off, mobile/cellular data on. I initialized mine by putting it on top of a large cardboard box, screen face down, outside, and the initialization was accomplished in 15 minutes. If this does not work, you should contact support.

1 Like

Yep, I had WiFi off (kill switch off) and mobile data on. Had the phone on a stone/metal table first, then alsod tried the top of a cardboard box, but not face down all the time. I will also check your procedure with my second L5, to see if they act similarly. As I recall, that other phone hasn’t been able to get a GPS fix in the past either.

1 Like

Just wanted to post an update on my March 2022 delivered Librem 5, L5vl-05. After doing a very recent reflash (last couple of days Feb 22) and the GPS initialization procedure mentioned above, to my surprise it is working now! I basically just figured that out yesterday, but was doing more testing to make sure. I checked /etc/geoclue/geoclue.conf and CDMA, 3G, and WIFI location are by default enabled as well FYI (I am not sure though if geoclue is able to actually use that information or not??).

The accuracy is about what you expect using pure GPS, with no Cell Tower, Wifi, Bluetooth, type triangulation service on-top. I would say accuracy for me is about within 2-3 car lengths which should be good enough for general navigation.

I have to say i am amazed, since it has not been working before no matter what I tried in the past - in the meantime i gave up trying or thinking about it and now bam.

For my GPS to work i did use Gnome Maps default app and didn’t set anything up or had to install anything, for the WiFI MAC address i use randomly generated ones so privacy shouldn’t be as much of an issue, but i certainly works also with HKS WiFi off, i haven’t tried WiFi on to see if there is any difference.

2 Likes

could you resend the link to the .deb if you have a testing arm64 build of GPXSee, I couldn’t find it. If building from source do you have build instructions for Debian Linux?

The test version of the arm64 deb on https://software.opensuse.org/download.html?project=home%3Atumic%3AGPXSee&package=gpxsee couldn’t be installed due to dependency issues.

could you resend the link to the .deb if you have a testing arm64 build of GPXSee, I couldn’t find it. If building from source do you have build instructions for Debian Linux?

I have built GPXsee in PureOS ARM64 chroot on my Debian x86 laptop. One of more ways, which I use for my embedded development for many different embedded projects and targest. The build should be possible exactly the same way on the Librem 5 directly but you need to install there complete Qt5 development packages which would take lot of valuable storage on the device and build would be slow.

git clone https://github.com/tumic0/GPXSee.git gpxsee-git
mkdir gpxsee-build
cd gpxsee-build
qmake ../gpxsee-git
make -j 4
make INSTALL_ROOT=../gpxsee-install install

There is result of this simple build

https://cmp.felk.cvut.cz/~pisa/librem5/gpxsee-pureos-arm64-230225.tar.gz

sudo -i
cd /tmp
wget https://cmp.felk.cvut.cz/~pisa/librem5/gpxsee-pureos-arm64-230225.tar.gz
cd /
tar -xf /tmp/gpxsee-pureos-arm64-230225.tar.gz

No warranty at all and probably even not fully clean with licence. But it is nothing more then build according to above instructions.

There is original GPXsee author’s project on Open Build Service

It could be used to obtain required files for proper Debian package build.

4 Likes

Thank you i will give it a try and report back! I am just excited to have GPS so i can finally mess around with apps and functionality…

I tried the GPXSee app you built and it installed fine thanks to your instrutions. It works without any issues and seems to be stable with no known crashes and detects the location from geoclue. It also scales fine on a mobile screen and all menues are accessible using touch.

Some observations:

  1. download offline maps tiles for use instead of online (i tried downloading of the GPXSee tiles and on selection the tile folder the app generated lots of errors when parsing those files (these weren’t the right files probably).
  2. how do you start, stop, or pause recording of a path in this app - is it possible?
  3. this is more feature rich and way faster on the rendering side than Gnome Maps, i love the map selections including topo!
  4. QT5 does not appear to ask for permission to retrieve the location in Gnome Settings.

Will post a few observation using GPS on Librem 5 when using Gnome Maps and will add to these observations as i discover them, feel free to add. This is on a stock Purism Librem 5 Luks Image, no optimizations or significant changes, no firewall running (VPN is active):

1. location acquisition does not seem to be optimized yet with PID 951 Modem Manager process eating up about 80-100% CPU resources when using Gnome Map (rendering or tile downloading probably should be GPU not CPU accelerated?), the phone is plugged into usb fully charged.

2. High CPU consumption and phone getting hot happens when on 4G (rate limited connection 100KBs) with WIFI off, but not interacting with or using the Gnome Map app (all i am doing is looking at htop to review usage on terminal), while location is turned on. fixed by disabling modem-gps as source in geoclue.conf
3. Fun eastern egg, when on WIFI versus 4G more shape layers are available through Gnome Maps.
4. Gnome Maps pinch to zoom isn’t smooth (Gnome Maps v3.38.6 not optimized for mobile touch screen device- is there an effort to implement touch properly?).
5. after leaving a location where user was connected to wifi and had 4G on, with Gnome Maps naviagtion enabled and after walking 2-3 blocks where WiFi now is disconnected the location does not automatically update and remains at the previous WiFi network location (geoclue is running the whole time), restarting the app seemed to resolve the GPS tracking issue.
6. pid: 624 gnss-share continuously uses about 1-2% CPU hovering around 1.9% .

1 Like

That kinda sounds like something is misconfigured and tries to use ModemManager to obtain GPS data? The modem’s GPS antenna is not connected, Librem 5 has a separate GPS chip which should be used instead.

GNOME Maps doesn’t really do actual pinch to zoom at all, it only acts as a binary gesture that triggers zooming by one step.

4 Likes

Turned out it was our fault - we made the change to disable it many months ago, but it never reached the repos :sweat_smile: Tagged it to be released now.

5 Likes

:man_facepalming:

@dos Any clue to why my L5 puts my location in China half the time?

1 Like

Do you get a GPS fix?

Yes, but my location still varies between Spain (where I am, though not very accurate) and somewhere in southeast China. I tried Zimmy’s procedure above and let the phone sit outside in the open for a couple of hours.

How did you verify that you get a GPS fix?

With Gnome Maps, is there another way?

Install Satellite? (not sure atm what the package name is)

So you did not verify it at all :smiley: GNOME Maps shows the location it gets from geoclue, which may get it from various sources, including WiFi or IP based location.

sudo socat unix-connect:/var/run/gnss-share.sock - should show NMEA data containing your location once a fix is aquired. I believe there was a tool that interprets it and displays in more user friendly way, but I don’t remember it right now.

2 Likes

Ok, I didn’t know that. With your socat command I get a lot of data in the form of:

$GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
$GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
$GPGSV,3,1,11,01,58,034,,30,54,254,,14,48,337,,07,42,194,*72
$GPGSV,3,2,11,22,37,127,,17,37,299,,03,32,125,,21,30,036,*79
$GPGSV,3,3,11,19,15,273,,06,13,219,,08,11,064,,,,,*47
$GLGSV,2,1,06,76,65,136,,77,60,340,,87,59,328,,88,37,251,*6F
$GLGSV,2,2,06,86,17,026,,75,08,148,,,,,,,,,*68
$GPGLL,2239.57396,N,11351.15498,E,083045.000,V,N*49
$PSTMCPU,26.49,-1,49*46
$GPRMC,083046.000,V,2239.57396,N,11351.15498,E,0.0,0.0,250223,,,N*79

Checking with Gnome Maps, I was first located to Spain near Malaga (about 80km from my current location) and then China and then Spain again, but closer to where I am.

You can run this script as root: https://source.puri.sm/angus.ainslie/librem5-agps/-/blob/main/usr/bin/gnss-test

After a few seconds you should see “timestamp” with current time in UTC. Leave it with a good view of the sky for about 15 minutes and check whether it acquired a fix.

1 Like

Ok, I’ll test. Should all apps be closed and WiFi killed with the switch?