Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of satellites calculated is higher than the displayed ones #13

Open
Olf0 opened this issue Dec 3, 2019 · 14 comments
Open

Number of satellites calculated is higher than the displayed ones #13

Olf0 opened this issue Dec 3, 2019 · 14 comments
Assignees
Labels
question Further information is requested

Comments

@Olf0
Copy link

Olf0 commented Dec 3, 2019

First of all many thanks @direc85 for maintaining and enhancing GPSinfo.
I hesitated to update to it on an old Jolla 1 with SailfishOS 2.2.1, because your fixes and enhancements are primarily addressing newer devices and GPSinfo 0.8 did its job well. But having updated to v0.11 today, I am definitely impressed by the many small enhancements introduced without altering the simple and easy look & feel of GPSinfo: The graphical display has become so smooth and more informative etc.

But there apparently is one change I am not happy with (regardless if deliberately or inadvertently introduced):
The calculated number of satellites "x / y" is always higher than the number of satellites graphically displayed. This is confusing and may be interpreted as a hardware malfunction by the user.
This might be related to issue #11.

IIRC in the "original" GPSinfo app (was using v0.8 for a long time) the displayed and calculated number of satellites match.

Screenshot depicting this issue (3 4 satellites shown (¿screenshot did not capture the single active one for some reason?), but 1+4=5 calculated):
Screenshot_20191202_001

@Pohli
Copy link

Pohli commented Dec 3, 2019

Could also mean 4 total instead of 5, 4 in view and one of them in use, it's not clear.

@direc85
Copy link
Owner

direc85 commented Dec 3, 2019

Thanks for reporting this. I intend to support SFOS 2.2 too, and this needs to be fixed of course.

The number in the picture mean that the device receives a signal from four satellites, and uses currently one satellite to calculate the position (which does not make sense, because minimum is three/four). This situation can be a classical off-by-one error where the list size is reported wrong for whatever reason in the C++ side. It is possible that some satellites are behind the "W" sign as there is one almost fully behind the "N" sign in the screenshot.

Can you check the bar graph page, if the numbers and bars match? Is the number the same in all the pages? It could be that there's a satellite behind some direction sign, or that two satellites are drawn in the same location. Is this issue persistent? I mean, if you go outside and keep the device in a good signal for a good while, are the numbers still of by one?

I have a Jolla 1 with SFOS 3.2.0 and it counts correctly, so I really suspect a counting error...

@direc85
Copy link
Owner

direc85 commented Dec 3, 2019

Okay, a little update: I compared the behavior of my XA2 Ultra and Jolla Phone, and there is a difference.

XA2 reports 0/2, 0/5, 0/8 ... 0/8 and finally jumps to e.g. 5/8 when it gets a lock. So it really only reports satellites being in use when it has a proper location lock.

Jolla reports 0/1, 1/1, 1/2, 1/3, 2/4 and with a lock 4/5 for example. GPSInfo only shows what the GPS system tells it to; Jolla reports the satellites used in the calculation whether it succeeds or not.

Can you replicate the issue with GPSInfo 0.9?

@direc85 direc85 added the question Further information is requested label Dec 3, 2019
@direc85 direc85 self-assigned this Dec 3, 2019
@mlehtima
Copy link

mlehtima commented Dec 3, 2019

In the image in the original message I assume that the remaining satellites are hidden under N which means the coordinates are 0,0 i.e. not known. The differences how different devices report used satellites are quite logical as those use different firmware and possibly have some differences in the algorithms they use for calculating the location, some only report satellites as used when there is a lock. You can see all satellite information in CSD tool in case you want to verify whether the count is correct or not.

@Olf0
Copy link
Author

Olf0 commented Dec 5, 2019

Oooh, so much input.
I'll start from the end:

I assume that the remaining satellites are hidden under N which means the coordinates are 0,0 i.e. not known.

That makes sense, as I often observe (at least) one satellite being displayed behind the N label in the grapical view. This one (¿these?) also does not move across the sky (which GPS satellites do quite quickly within more than half an hour of testing, two days ago and now again).
I am basically fine to stop investigating this issue further, due to that explaining any difference between visible satellites and the numbers displayed (assuming multiple satellites might be displayed at 0,0). But AFAICS there are other inconsistencies (although they appear to be inconsistent themselves).

differences how different devices report used satellites are quite logical

Absolutely agreed, also implying that GPSinfo can and should simply report data as it is reported by the GPS hardware.
My motivation for creating this issue was solely to ensure that there is no miscounting on GPSinfo's side.

Thanks for the hint to use the CSD tool to double-check (additionally to GPSinfo's bar graph).

@direc85,
there is definitely no satellite "behind" the W label (in the screenshot and all recent tests of mine).

Testing again (now better knowing what to look for) today, I believe this only happens when reception from satellites is lost, i.e. when the number of satellites decreases.
Once the number of satellites is down to 0 (maybe already at 1), the numbers match again and continue to do so when more satellites are received (i.e., the numbers are increasing again). If the number increases again, while the numbers do not match, the difference stays.
Taking a single satellite behind the N label into account, the numbers were "off by one" in both tests (but not in the last screenshot below?!?).

Screenshots:

  • Starting up:
    • Screenshot_20191205_002
    • Screenshot_20191205_003
    • But satellite 74 was right next to 75 when I looked at the screen (as depicted in the next screenshot, below). Somehow the screenshots do not seem to match. Maybe the reason for this effect is that the reception drops in the moment one grips around the phone to press both volume buttons (to trigger a screenshot), shielding the GPS receiver.
  • Counting up to 0 / 6 satellites:
    • Screenshot_20191205_004
    • Screenshot_20191205_005
    • This matches, assuming 25 and 29 being displayed "behind" the N label.

I might play around a bit more at the weekend and consider (depending on the results) to compare with v0.9 (or v0.8 again, to assure or disprove my memory).

@Olf0
Copy link
Author

Olf0 commented Dec 5, 2019

I was playing with GPS reception a bit more, basically determined to either make some consistent screenshots or close this issue, and twice captured GPSinfo's graphical display and corresponding bar graph in "now I got you" situations, when I finally realised:

It is only the sematics of the text line, which is confusing!

  • It is not "Satellites in use / view", as those "in use" implicitly must also be "in view". It is rather "Satellites in use / Satellites in view minus the ones in use".
  • The format "N / M" attributes to this interpretation, as this usually means "N of M".
    E.g., "2 / 7 pages" means one is "on page two of a document, which is seven pages long", with the two pages being included in the seven (otherwise it would be "2 / 5" for a seven page document).
  • @Pohli already mentioned that, but I missed his brief statement somehow.

Taking this into account plus the already seen (and depicted) situation that multiple satellites are "hidden under" the N label, everything adds up correctly.

I will think about how to resolve this semantically, without complicating that simple line of text too much, tomorrow.

@Olf0
Copy link
Author

Olf0 commented Dec 5, 2019

I believe the easiest solutions are

  • to really account for all satellites "in view" when calculating the last (at the bottom right) number displayed (i.e., including the number of those "in use").
    This way everything else (e.g., the text) can stay as it is.
  • to alter the text to "Satellites in use / not used".
    This way everything else (e.g., the calculation of the numbers) can stay as it is.

@sbridger
Copy link

Just saw these messages appear in the console while developing. Unfortunately probably happened during the night while I was asleep, so no clue of the cause...

'''
[W] unknown:0 - QGeoSatelliteInfoSourceGeoclueMaster number of in use QGeoSatelliteInfos (6) does not match expected number of in use satellites (5).
[W] unknown:0 - QGeoSatelliteInfoSourceGeoclueMaster number of in use QGeoSatelliteInfos (6) does not match expected number of in use satellites (5).
[W] unknown:0 - QGeoSatelliteInfoSourceGeoclueMaster number of in use QGeoSatelliteInfos (7) does not match expected number of in use satellites (6).
'''

@Olf0
Copy link
Author

Olf0 commented May 31, 2021

@sbridger, that is interesting!

  • On which device and SFOS release did that happen?
  • Can you think of other preconditions?
  • What (i.e., which app / program) polled your GPS, so it was kept active?

@Olf0
Copy link
Author

Olf0 commented May 31, 2021

@direc85, WRT the original issue, I believe I ultimately found and understood the culprit, and provided two possible solutions back in December 2019.

P.S.: @sbridger's observation is orthogonal to these, AFAICS.

@sbridger
Copy link

sbridger commented Jun 3, 2021

XA2, 4.1.0.24. No and i havn't looked to see where the console message comes from. Have noticed it again yet

@direc85
Copy link
Owner

direc85 commented Jun 29, 2021

Thanks for information and investigations! I'll try to get back at this shortly, as there is other pending work too.

@direc85
Copy link
Owner

direc85 commented Mar 20, 2022

Sorry about the delay, the year has been wild...

This could be per-device issue... At least with X10II the numbers are matching; right now I have 8/23 satellites on the radar, and there are about 23 blips on the map, not 30... But, as the number is incorrect on some models, I think I'll simply make it an option in the settings.

@direc85
Copy link
Owner

direc85 commented Mar 20, 2022

This is also what the emulator shows in the hand-generated data, which makes me suspect a reporting difference even more... I'll try to get it working with my Jolla, and Xperia X and XA2 tomorrow to see what kind of data they report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants