direc85 / harbour-gpsinfo

GNU General Public License v2.0
5 stars 10 forks source link

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

Open Olf0 opened 4 years ago

Olf0 commented 4 years ago

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 commented 4 years ago

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

direc85 commented 4 years ago

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 commented 4 years ago

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?

mlehtima commented 4 years ago

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 commented 4 years ago

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:

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 commented 4 years ago

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!

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 commented 4 years ago

I believe the easiest solutions are

sbridger commented 3 years ago

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 commented 3 years ago

@sbridger, that is interesting!

Olf0 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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

direc85 commented 2 years ago

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 commented 2 years ago

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.