GPS stopped working

I had fixes after one hour these days, although I did get the offline fix with 9000 m accuracy.
Therefore, it looks like it is used somehow, but it does not speed up the fix.

1 Like

To try understand better the results ob my tests, I’d need to know:

Does any of you know, for sure:
Does the hardware(or un-flahed part of the system) keep track of any GPS related data that would help to locate, even at a “cold” start?
and
Does a battery removal delete this datas if they are in HW?

I honestly do not know how to explain the behavior.
I have now also tested intensively for a week.
no matter whether MLS completely off or offline data on. after 20Sek I have an accuracy of 9000 meters.
If I have a GPS fix and then turn off GPS for an hour, when I use GPS again I get a fix within seconds. But if I have to restart the phone after a GPS fix, all previously (temporarily) saved GPS data seems to be gone. Then a new fix can take between 5 - 30 min.
It is also interesting how much the quality of the GPS signal varies.
I did a reboot session and under the same conditions, satellites are displayed once with a great signal and again with a very poor signal on the next reboot. And within 5 minutes the satellites have not moved away so much that would be an explanation.
But with me it does not matter what quality the signal has. I also get a fix from satellites that are in the red or yellow range of the signal quality.

it is all very strange

1 Like

I guess it does store data for some time on-device. The gps.conf on my system mentions 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

From their site:

The Qualcomm Location XTRA Service generates and provides accurate Satellite positions for extended periods of time to a mobile device. This assistance data is provided in compact form and allows the mobile device to perform positioning for an extended period of time (up to seven days). The assistance data files are made available to a Data Distribution Network for global distribution.

I don’t know if this is actually used.

The GPS receiver should keep the latest almanac and ephemeris data known; to do this it should be provided a backup power source, since I don’t think this unit has access to flash to store them. Therefore, removing battery will probably cold start the receiver.

That’s likely to enable AGPS online services which include downloading XTRA data (almanac) and injecting NTP time into modem.

If only MLS services are selected AGPS online functions in geoclue provider are not triggered thus not downloading the required data to speedup a GPS fix.

But speaking of XTRA data: I switched my XA2 from “high precision” (which enables XTRA data download) to device-only mode (no MLS, no data connection). This will stop injecting NTP, XTRA and MLS’ed approx. position into modem. However having a lot of SVs in sight and GPS was receiving many signals there was no fix for more than 15+ minutes so I aborted my test.

What I did next was doing a GPS cold start (manually removing cached GPS + GLONASS almanac and ephemeris data from modem), rebooting my device and see how fast it would get a fix from zero to hero without AGPS online services.

The GPS receiver now needs to download the full almanac and ephemeris data on it’s own which should take about 12 minutes. I got a fix after 10 minutes in the end which is a “normal” duration starting cold.

So from my subjective experience here is that cached almanac data and possibly the injected XTRA data might confuse the GPS receiver to prioritize the wrong SVs (GLONASS or GPS) and keeps waiting to fetch a specific signal that is weak or even not there.

1 Like

Many people testing and reporting! We are going to fix it!

@nekron thanks for the explanations. Have to read them again but for sure, at the moment, it would be extra useful to know how you do this:

My only way ATM is to unplug the battery hoping to get a cold start :yawning_face:

There must be something else, because I do all my tests with no data + no wifi.
Some devices don’t even have a simcard.
However, even after having removed the battery and re-flashed, I sometimes get a fix in less than 10 minutes (which shouldn’t be possible because of the almanac DL time).

EDIT: I did enable wifi as short as possible (max 5 to 10 seconds) to set the time.
Could that be enough to get the XTRA almanac?

Maybe as an easy solution you can reset / clear almanac and other GPS data by calling dbus SetOptions() function for geoclue provider (NOTE: below script is not working for me but someone may fix it):

#!/usr/bin/python3
#
# Inspect Geoclue DBus API
# dbus-send --session --type=method_call --print-reply --dest=org.freedesktop.Geoclue.Providers.Hybris /org/freedesktop/Geoclue/Providers/Hybris org.freedesktop.DBus.Introspectable.Introspect
#

import dbus

# main starts here
if __name__ == '__main__':
    bus = dbus.SessionBus()
    obj = bus.get_object('org.freedesktop.Geoclue.Providers.Hybris','/org/freedesktop/Geoclue/Providers/Hybris')
    api = dbus.Interface(obj, 'org.freedesktop.Geoclue')
    options = dbus.Dictionary({dbus.String('NoCachedAidingData'): dbus.Boolean(True, variant_level=1)}, signature='sv')
    api.SetOptions(options)
    print('Cleared GPS data.')

(see https://github.com/mer-hybris/geoclue-providers-hybris/blob/master/hybrisprovider.cpp#L416 for reference)

@nekron I’ll try that, thanks.

In the mean time:
Too many factors.
Too many mixed (but useful) answers.
Too many layers:

  • HW GPS, Antenna…
  • Offline MLS
  • Online MLS
  • SUPL things
  • XTRA Service

I would propose to split this thread in some parts: GPS hardware, Offline MLS, Online assistance and services.
Is that a good idea?

At least, will I start a new HW dedicated thread as I got really nice improvements by dis/re-assembling + fixing 2 from 4 of the XA2 I have.
And I’ll give it a funny title as I have almost no hair/nerves any more, so much so are the problems intricated :upside_down_face:

EDIT: Here is the hardware thread

1 Like

I’ve tried suplpatcher with Google’s SUPL on port 7276. While I never had major problems with GPS like some others here, I now got a fix within seconds (outside) instead of a minute. Thanks for this solution!

I confirm that without any doubt using Google SUPL on port 7276 ensures a quick fix.
Therefore, @nekron is right when he says that live SUPL data are making the difference.
Either the receiver is using wrong ephemeris data on a warm start, or it is using the wrong time.
A quick check could be to compare the satellite constellation shown on a malfunctioning XA2 device with one shown on a device that has produced a fix. If they do not match, wrong ephemeris data is the reason.
I remember my XA2 producing a wrong fix on start that stays the same for several days. Maybe for some reason the receiver does not save ephemeris data on shutdown (or saves them very seldom) and therefore stays with old satellite positions which produce a wrong fix, unless the data are overwritten with correct data provided by the SUPL server. Or maybe the middleware layer for some reason provides wrong data when SUPL data are not available.

There is (also) something in the /home directory.
When I rsync /home from one device to another (exact same model), which is HW fixed and well working, the fix never happen again.
A number of satellites is shown but the used ones always stay at 0.

Unfortunately, sat. positions seem to match:

Settings on High accuracy
EDIT: Left:High accuracy Right Custom-On-On-Off.
Devices offline (no Data, No Wifi)
Left: Gets a fix in 30s. - 1 minute
Right: Never gets fix

3 Likes

Almanac is right
Ephemerides are right
Maybe time is wrong?
Or maybe it’s just a bug in the receiver firmware?

Time was set automatically yesterday by wifi.
Verified today with ntp set PC: seems ok by looking at the seconds but I don’t know what is the tolerance.
Shouldn’t the firmwares on both devices be the same? Having both had android 9 and flashed with the same SFOS?

Counter-intuitive: High accuracy setting allows fix to happen, even fully offline.

I thought it was a license question (post 457)
But it’s something else:
On the ephemeris test above (pictures), I made an error:
The blocking device was in fact set on Custom-On-On-Off. No fix since days on this one (Since my /home was restored). Moz licence already accepted.
I rebooted: nothing.
I set the settings on “high accuracy”, rebooted, → fix in < 2minutes (still offline)

Since more than a week, I made all my tests with Custom-On-On-Off.
Seems logical, being offline.

Is instead “High Accuracy” the good setting to bet on?

Yes, ok. There is a real software issue.

As reported more in details in the HW tread.
Hardware repair gives a better reception, for sure (more sat. signals, higher quality).

As I began tu use my daily phone’s GPS in real life, it needed yesterday > 20 minutes in perfect conditions to get a fix.

@Jolla, we can now be sure that there is something to find on the software side.
Hardware cannot be put in cause alone.


EDIT February 10:
Today 20 min. test, same window, clear sky, custom On On Off, Jolla positioning pack.
* = HW reapired.

Devices 1* & 4, SingleSIM, 4.3.0.12 licence:
fix in < 1 minute

Devices 2* and 3, DualSIM, 4.3.0.12 free:
No fix within 20 minutes

Like said previously several times by other users,
Time to fix seems to increase as the OS installation gets older.
The fix time difference between Single and Dual devices is surprising.
First time I note this difference.

2 Likes

I freshly flashed my XA2 Dual Sim, Paid licence - no GPS fix after hours… :sleepy:
And, all these problems started as far as I remember with Sailfish 4.

I tested my XA2 DualSim (H4113) and I got position fix after my phone found four Beidou satellites (SV ID 2xx).
24 Satellites (GPS and GLONASS) wasn’t enought.

I just speculate that injected outdated XTRA data or initial position. May broke GPS and GLONASS position calculation on GNSS receiver, but it doesn’t have effect with Beidou.

1 Like