FriendlyNeighborhoodShane / MinMicroG

Sources and scripts for MinMicroG installers. You shall find no prebuilt releases here.
GNU General Public License v3.0
306 stars 30 forks source link

Google Maps showing wrong location #52

Closed k2helix closed 11 months ago

k2helix commented 11 months ago

Hello, I've been using MinMicroG for a while, but it's been some time since Google Maps started showing a wrong location.

I currently am using latest gmscore (0.2.28.x) which does not need nlp backends. I also tried downgrading to 0.2.27.x with the nlp backends I've been using all this time but nothing.

I don't know if this was happening before updating gmscore, but the only app that displays an incorrect location is Google Maps, which says I'm at 0,0 in the middle of the atlantic. However, other apps such as SatStat or Organic Maps work fine.

I also created an issue in GmsCore's repository (https://github.com/microg/GmsCore/issues/1997), but as I don't know if it's related to MinMicroG too I'm posting here.

FriendlyNeighborhoodShane commented 11 months ago

SatStat (uniquely among apps) differentiates between the location it gets from the network location providers (on behalf of microG) and GPS (unrelated to microG/GApps). Because of that, you can use it to determine which part of the stack is not working correctly. Google maps usually grabs the NLP location FAIK but when that's not available it settles for GPS location too.

The last tab in SatStat is a map page which will show you a red circle/marker for a GPS lock (much more precise) and a blue one for the network lock (much more coarse).

If there isn't any NLP lock, then that means your location provider is not functioning. Try enabling others in microg's settings. Unfortunately Mozilla wasn't the best-equipped backend for many places in the world, and for now, they are out of luck.

If there is an NLP lock but it shows you swimming with the fishes in the atlantic, one of your location providers is malfunctioning (unless, of course, you're actually on a cruise). You need to find out which one it is (by testing them alone one-by-one) and keep it disabled.

Your GPS lock should be in any case your precise location (sometimes it takes a while to lock on, you need to be outside or near a window, etc.). If that is giving you the wrong location... something deeper than microG is wrong there.

k2helix commented 11 months ago

Hi again.

The GPS lock works correctly as the red marker in SatStat is placed correctly. I see a blue marker sometimes not so far from it, but not always. However, I do not see the Fused marker anywhere, which I think that is causing the problem.

As I said, I'm currently using latest microG, which does not use nlp backends anymore so I cannot really switch them off. But I also tried the previous version with Mozilla, Deja Vu, Wifi, etc. and the same thing happened.

I don't use Google Maps often, but as far as I can remember it was working fine some time ago. Don't know what could have changed this.

FriendlyNeighborhoodShane commented 11 months ago

The GPS lock works correctly as the red marker in SatStat is placed correctly. I see a blue marker sometimes not so far from it, but not always. However, I do not see the Fused marker anywhere, which I think that is causing the problem.

According to the legends, the blue marker is the "Fused" marker. It mentions the independent network being green, but TBH I've never ever seen it appear, only the blue marker, so I don't know what that even actually means (maybe it's classifying microG as a fused location provider instead of network-only).

So you mean that your GPS location is accurate, but your NLP location is sometimes fine but sometimes doesn't lock at all? and that's when gmaps gets confused (did you check the atlantic for the blue marker lol)?

As I said, I'm currently using latest microG, which does not use nlp backends anymore so I cannot really switch them off. But I also tried the previous version with Mozilla, Deja Vu, Wifi, etc. and the same thing happened.

But you can. You actually still have the choice between 3 backends, 2 wifi-based and 1 radio based, that you can individually toggle.

But it's weird that the older, backend-based build is still not working for you. Think something got changed in the databases of one of those backends that no longer registers your location? Or maybe one of them is malfunctioning and blocking the correct location from one of the others? (microG uses an algorithm to determine the correct location from the answers given by all enabled backends, based on various factors like an self-estimated accuracy)

Something I probably should have asked earlier: is your microG self-check all-ok?

k2helix commented 11 months ago

Everything is ticked in the self-check.

I have switched off the Hotspot option from the Location tab in microG settings (leaving Mozilla for Wifi and data the only one enabled) and SatStat detects the network location, which according to my legend is the blue marker, correctly. But still no green marker (which is Fused for me).

SatStat does not show anything in the atlantic. And I don't think I can switch microg to the old version again to test disabling some backends. All I can see is that the network marker provided by Mozilla (if it's the only enabled I guess it's the one providing it) is fine, just a street away.

FriendlyNeighborhoodShane commented 11 months ago

image

... are you using a different version of SatStat than me or are these legends randomised or something? I'm confused.

anyway, I don't have much more of a clue if SatStat shows a correct NLP lock but gmaps doesn't see it, sorry. You could disable NLP, forcing it to fall back to GPS, but that comes with the GPS inconveniences in speed and environment.

k2helix commented 11 months ago

Screenshot_20230730-230214_SatStat.png

Yup, it seems they are randomised (my version is 3.5 from Fdroid). I already tried disabling NLP (switched off everything in the Location tab in microg) but GMaps still shows the same location. I guess I'll have to use other maps application

FriendlyNeighborhoodShane commented 11 months ago

I already tried disabling NLP (switched off everything in the Location tab in microg) but GMaps still shows the same location.

... Does Google maps have precise location permissions? When you open an app for the first time (or in app settings) the permission prompt in modern android versions asks you to specify whether you want it to have coarse or precise location access (which is roughly equivalent to NLP and GPS).

k2helix commented 11 months ago

Yup, it has precise location access. I have not checked as I don't know any, but maybe it doesn't work for apps that use the fused/network location.

k2helix commented 11 months ago

Ok I found out one interesting thing which is that in the Location tab in microg settings if you click an app that requested the location you can see what ubication was reported. Microg says that google maps was reported my correct location. But GMaps still thinks I'm swimming with sharks

k2helix commented 11 months ago

Well for some reason which I cannot understand, uninstalling and reinstalling the app worked. This makes no sense as I had already cleared data and cache. But it seems that the simplest thing made the trick.

Thanks for all your help!

FriendlyNeighborhoodShane commented 11 months ago

lol. You're welcome!

ale5000-git commented 11 months ago

@k2helix This is the possible problem: If the new version of microG declare new permissions and Google Maps use one of the new permissions but was installed before the new version of microG then Google Maps won't get them granted until you uninstall and reinstall Google Maps.