GPS on Pixel 3aXL

I’m running Droidian on a Pixel 3aXL and was wondering if GPS-based positioning is supposed to work, and if so, how to make it work.

It seems “wifi-based” positioning (AGPS?) works, as I get a “close“ position when I connect via WiFI. I don’t have a SIM card in the phone.

Any pointer would be appreciated!

Hi !
Sorry, long time between my last forum visit.

On Droidian, GPS use geolclue and geoclue by default have IP localization with BeaconDB. (I think it is only by IP)
It used before the first GPS fix. So it is why it could by close if you are on a WiFi of an Internet connection. And it could be at 30km if you use a phone with sharing Internet (so with mobile data).

As I understand the GPS part used by geoclue is the same that use Waydroid, it works directly with GPS chip + halium.

I take lot of time to understand GPS and how it works, it exist different mode, the true alone GPS mode with only use the GPS chip + the phone (MSB) take very long time for the first fix.

The MSB need 2 things :

  • It need to have the exact time on the RTC (real time clock) on the phone or in the GPS chip.
    Lot of phone have access to RTC in read only, like Vayu. I try with pure Android (on my phone) and it is the same (read only).
    Today the tendency is to used server solution for location with wifi-based (as you say), cellular-based … Like “High accuracy” on Android, I guess it is why some brand don’t check if RTC work right. (It is quick, but you share you exact position with all the tools that locate you, so not good for us)
    The first GPS fix put the right clock on GPS chip. We look for a way to inject the time on the GPS chip, with some guys using UBT and Berbasc (the Vayu maintainer). (We have the same issue on both OS). So if the clock is good, the first time to fix will be very smaller.

  • It need to have a map of the satellite position : the ephemeral / almanac. Android can download and inject it (like with SatStat), Qualcomm give close source software to did it to (we have it on halium).
    I don’t found how to make this software works locally so I found another way.
    We found a solution for injecting the ephemeral without proprietary software, but it works only with Droidian (not UBT).
    So with this solution the first fix take 25-35 seconds, because of the clock not right. And after is take less than 5 seconds. After the first fix, the clock stay at the good time.

So it is a summary of the MSB aGPS (assisted GPS). More information : What Is Assisted GPS? | IoT For All

I use this solution for months ago, and works well on Droidian and Waydroid.

It is a global solution, not link to the device. You only need SatStat (on Waydroid) to be sure you GPS chip work correctly on your phone. Only start SatStat outdoor, and look if you see some satellites, it could fix in about 12 minutes (you don’t need to wait for a fix !).

This is my script :

wget https://path2.xtracloud.net/xtra3Mgrbeji.bin
sudo mmcli -m any --location-enable-agps-msb
sudo mmcli -m any --location-inject-assistance-data=xtra3Mgrbeji.bin

You need to rm xtra3Mgrbeji.bin before launch it again.

So we :

- Download on a Qualcomm server the ephemeral. This file have the position of all satellites for the next 48 hours, we could find other file for 7 days. (I don’t finish the works now)

- Enable MSB mode, MSB mode = Mobile Station Based = Location calculation is performed locally on the GPS device only. So after a download it totally works offline.

It is the only correct option for privacy, we download the entire satellites map, so no one know where we are (we can make a proxy server to share this file). We don’t send any information.

- Inject the map we have just downloaded to the GPS chip.

It only works with Qualcomm chip and other brand compatible with the xtra features. But I guess all Droidian phone are compatible.

Could you try it, and tell me if it works for you to ?

Thanks !

Note : xtracloud.net is the default Qualcomm website for almanac download : Frequently Asked Questions | GrapheneOS - Whois xtracloud.net