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

Hi,
I try Sailfish some time ago, and I see that we have some function that can be share between linux os for phone. Lot of works use by other OS has been made by Sailfish (thanks a lot).
I share you an idea and test, that we have with Vlad.
I think it could help, if you want to download it, or it could be use if anyone from UBT or Droidian, develop it before !

Hi !
To be sure we deal of the same function, aGPS or a-GPS is :
A-GNSS works by providing the necessary data to the device via a radio network instead of the slow satellite link, essentially “warming up” the receiver for a fix.
Every GPS device requires orbital data about the satellites to calculate its position. The data rate of the satellite signal is only 50 bit/s, so downloading orbital information like ephemerides and the almanac directly from satellites typically takes a long time.

An A-GPS-capable device can connect to these servers (a cache server for GPS data)and download this information using mobile-network radio bearers such as GSM, CDMA, WCDMA, LTE or even using other radio bearers such as Wi-Fi or LoRa.
(a-GPS Wikipedia)

So the a-GPS it is just the fact to download the ephemerides and the almanac by Internet (by a connection of a cache server, so the connection can be with mobile data (4G, 5G …) or Wi-Fi) instead of satellites, to have a very quick first fix.
It is not link to other way of localization based on localization of Wi-Fi … (like High accuracy in Android), it is just link and use the GPS chip.

We deal it and try it with Vlad (an Ubuntu Touch user) on Waydroid. a-GPS already works on Waydroid.
Vlad see an interesting fact : if he force a download of aGPS with SatScan (on Waydroid), it could have a very quick fast fix on UBT sat app. If it retry after few hour it continue to quick fix.
So the aGPS data is usable by UBT.

So I try the same with Droidian :
Start Waydroid
start Satscan
Download aGPS data on satscan
Stop Waydroid
Enable GPS on Droidian
Start maps, and the GPS fix very quickly (few seconds).

I try to disable GPS on Droidian, reboot, enable GPS and start maps again and it fix very quickly (I move about 30 meter during the boot)

I make a second test yesterday, after few day without using the GPS, moving about 50km, kee disable GPS on Droidian and Waydroid, download aGPS with SatScan, stop Waydroid, enable GPS on Droidian, start maps (cartes) and the GPS fix very quickly, like the test before.

So the aGPS data are store in hal ?

With Vlad we look at SatScan source (can be see on original post) and the aGPS is download and store by Android.
So we both think that it is possible to copy Android function that download the aGPS data on internet and the function that send this data to the GPS (with hal command ?).
Do you think we are right ?

Android have 2 functions :
locationmanager1.sendExtraCommand(“gps”, “force_xtra_injection”, bundle); (if I’m right download + put it in the GPS chip or hal)
locationmanager1.sendExtraCommand(“gps”, “force_time_injection”, bundle);
(link on original post)
Do you think it could be possible ?

I found this project Elastos5 (link on original post) that use GPS Xtra (from Android ?) with a c++ code.

So no modifications to do on GPS software, just a function to call each 24h or 48h if user want aGPS.

I’m sorry, I think I can’t do more.

Thanks in advance

This is the original post : Add aGPS on Droidian (and maybe UBT and Sailfish) - possible way · Issue #51 · droidian/droidian · GitHub

3 Likes

Settings → System → Location → High Precision Positioning.

This way, using GPSInfo, you have the Satellite Information screen with satellite positions within seconds.

1 Like

that is sadly not true. all high precision does is using not-working cell positioning

3 Likes

Thanks a lot.
So a-GPS is already working on Sailfish ? Or you deal about high precision, like Android, that use Wi-Fi, cells … to give location ?
Thanks

Thanks a lot.
Could you give more information, pease ? you deal about Seven ?
Thanks

I tested right now. There is
Settings → System → Location
inside there is

  1. High Precision
    1. Battery safe mode
  2. Exclusive Mode
  3. Individual settings

Inside 4 there is:

  1. GPS on/off
  2. Offline Mozilla Mobile Towers (obsolete)
  3. Mozilla Location Service (obsolete)

I suggest to choose in the first list → 1, this works, for obtaining Satellite data via internet (few seconds), which is much faster than vie satellite download (min. 1-2 minutes).
The Mozilla options are outdated and don’t work.

1 Like

The SUPL Server in gps.conf is not working, you need to use a working one, like supl.google.com. Some carriers have their own supl servers and there is the grapheneos supl proxy for supl.google.com.

2 Likes

and I’m telling you none of these options do agps

my device from 2014 has supl.google.com in gps.conf so i’m not sure what do you mean

@miau , @Mister_Magister I’ll check later what’s in the config files. I modified them long ago.

That’s strange, because my supl-proxy logs the traffic generated by my XA2 and that works most of the time.

Okay turns out I was talking bullshit and it gets a fix in 54 seconds

my bad

I think I just never enabled internet when I was using gps as my maps are offline

Ah mystery solved, for some reason my G2 despite also having google sulp server, takes sweet time to get a lock, hence I concluded it doesn’t work

4 Likes

All official devices i had used the sony erricson supl server, which is dead. With a working supl server i get a fix in less than 5 seconds outdoors. But supl only works on mobile data not on wifi.

1 Like

oh pardon me, time for second session of testing

So after reboot, on mobile data, x2 is getting lock in like 25s while g2 is taking minutes

Also motorola back in 2014 was under google so I’m not surprised they’re using google servers

But yeah seems like its not working on g2 and x2 is definitely not 5s

GPS Time to fix hack:

cd /vendor/etc/
cp /vendor/etc/gps.conf /vendor/etc/gps.conf.bak
vi /vendor/etc/gps.conf
Undo:
cp /vendor/etc/gps.conf.bak /vendor/etc/gps.conf

Now I changed in /vendor/etc/gps.conf:

line 26:

# NTP_SERVER = time.google.com
NTP_SERVER = ptbtime1.ptb.de

line 36:
INTERMEDIATE_POS=0

line 70:
NMEA_PROVIDER=1


edit: any suggestions for a good SUPL server?

2 Likes

mind that line numbers mostlikely won’t match, also on some phones /etc/gps.conf (that you should modify instead) links to /system/etc

google supl as mentioned already

SUPL_HOST=supl.google.com
SUPL_PORT=7276
2 Likes

Really? the original supl.sonyericsson.com had port 7275!

I changed now and will test.

edit: seems to work fine @Mister_Magister !
Are there other SUPL servers not from big G?

I have no idea what other servers you have in mind

I tried setting NMEA_PROVIDER=1 with no effect

The NMEA_PROVIDER=1 had a huge effect on fix time long time ago as I found this by experiment.

Changing the SUPL_HOST=lbs.geo.t-mobile.com and
SUPL_PORT=7275
also works now better than before.

2 Likes