Add aGPS on Sailfish (and maybe UBT and Droidian) - possible way

This:

XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra2.bin      
XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra2.bin                        
XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra2.bin

I guess they belong to the chip manufacturer.

This also seems to be important:
AGPS_CONFIG_INJECT = 1

It’s using satellite Kepler data (Satellite’s orbital data) from Internet server instead of downloading them from satellites. The first needs a few seconds, the last at least one minute under best conditions, but usually under normal conditions 3-10 minutes or sometimes more.

This kind of A-GPS has nothing to do with scanning WIFIs. It doesn’t send data to a server that is able to reveal your location.

edit: since the outdated SUPL_HOST is replaced by a working one, the whole phone runs smoother including no more stuttering BT audio, touch keyboard, Browser, everything. It seems that this wrong configuration did block something generally or caused a mess in the system.

1 Like

Thanks a lot :slight_smile:
So it works on Sailfish nice !!

“It’s using satellite Kepler data (Satellite’s orbital data) from Internet server instead of downloading them from satellites” Nice I’m agree

“This kind of A-GPS has nothing to do with scanning WIFIs. It doesn’t send data to a server that is able to reveal your location.” I’m agree to.

You know which software or service in Sailfish is dealing with aGPS ?

Thanks a lot

1 Like

It’s correct that WiFi information is not included in a SUPL request, but MCC, MNC, and CellId are. Furthermore the location of your latest GPS fix and your IMSI are included in a request.

3 Likes

AGPS or GPS only is set in Settings → System → Location.
There set GPS only for data saving but slow position fix,
or set High Precision for revealing your position and data to external hosts but fast position fix.

@martinh Many thanks for info !

Thanks a lot, so you mean that the supl is not a-GPS but High Precision.

With a-GPS we just download the ephemerides and the almanac, so it is just a map, we don’t send anything. We download a file that is the same for everyone.
And for example it work on Waydroid that not send MCC, MNC, and CellId (it can’t have access to that).

As Seven say aGPS work with the use of GPS only (You could check it in native Android or Waydroid, and it work this GPS only mode).

So Sailfish have aGPS only support ?

Thanks in advance

SUPL is the protocol used for aGPS (though SUPL V2 also supports other GNSS systems, not only GPS). It is almost entirely handled by the SOC, there’s not much to see in SailfishOS, let alone Waydroid.

Whenever a client requests highly accurate positioning information, geoclue-master starts geoclue-hybris which checks, if aGPS is wanted/allowed by the user (i.e. not in flight mode) and technically possible (mobile data connection available). If possible, geoclue-hybris injects current time and SUPL server details telling the SOC that aGPS is wanted. The rest is handled by the SOC, which obviously has access to MCC, MNC, CID and IMSI.

2 Likes

So for you an Internet connection is need at each GPS location fix ?

I’m not sure we dealing of the same concept.

Thanks in advance !

I’m read news fact about aGPS, and if seem now it is a global word to include other support in some case, as you told.

I’m just dealing of the “old” a-GPS function that is to download the satellites ephemerides and almanac. That is a global file common for each user and without privacy problem.
This is this way we try, and work, on Waydroid.
On Android it is the function DOWNLOAD_XTRA_DATA.
We need to download this only one time a day or 48h. And after the GPS fix quickly without Internet.

So Sailfish already use XTRA server and could download ephemerides ?

Thanks in advance

Downloading some file would be easy but I doubt there’s a way to tell the SOC to use the data contained in it.

Thanks, Android did it, so my idea is to copy this code from Android source. Another project : elastos seem to have c++ code based on Android.

I don’t have skill for that, I just see how it work and test.
With UBT and Droidian, when we download the Xtra data on Waydroid, we could use it directly with UBT and Droidian.
So I guess if someone could copy the right piece of code of Android or Elastos we could push the data to the soc on the Linux side.

Everybody interested in GPS vs SFOS also search this forum for suplpatcher.

1 Like

Thanks a lot, I see it previously, but I’m not sure to really understand. It could be use just for download the satellites ephemerides ?

In case someone wants to try on c2 there is no gps.conf but supl.xml in /vendor/etc and /data/vendor/gnss/supl, there is some difference in behaviour as you get a 9000m lock in about 10sec with google supl, but proper lock is still around 40-50sec from my testing, ymmv

@throwaway69 :
40-50 sec. without any assisted GPS? so GPS only?
That would be a very good value!

i’m getting 40-50s on x2 with supposedly agps so idk anymore.

It fetches sattelites fast, which is ig all the data agps is downloading, like after 5 seconds i have 0/21 or something like that, then it just needs a lock

I think that’s normal and good working.
Right now I tried with an Xperia 10 / 5.0.0.68, it was very similar values as at your side.

edit: at the end I’ve simply commented the two lines

# SUPL_HOST= (old sonyericsson deleted)
# SUPL_PORT=7275

so the SoC uses the one from manufactorer by default.

That’s with agps (the data icon indicator barely blimps, but a certificate file is dumprd every time an app requests location in /data/vendor/gnss/supl/spirentroot.cer)

1 Like

This was an experiment. My current config, I want to keep for next time, is:

# FOR SUPL SUPPORT, set the following
SUPL_HOST=146.59.144.170
SUPL_PORT=7275

This is the numeric SUPL server address of Graphene OS, to also avoid unnecessary DNS request.

You can just use supl.grapheneos.org, but in the end you’re just trusting another company to do privacy for you (they say they don’t do x, y, z and strip your private data before eventually passing your request to googol), if you trust their schizos (who attack fdroid and suggest people use gplay for security, restrict root etcetc) be their guest, openagps can’t come soon enough

1 Like

Who attacked Fdroid? I have no clue! What happened?