fhorinek / SkyDrop

SkyDrop combined variometer
http://skybean.eu/
GNU General Public License v2.0
87 stars 42 forks source link

Fix invalid in GPS coordinate from IGC file #411

Closed Skysus closed 4 years ago

Skysus commented 4 years ago

Hi,

since 3909 build, all gps coordinate are incorrect. In the GPS coordinate, the Fix byte are invalid.

Does anyone have the same behaviour?

Skysus commented 4 years ago

The Fix byte in 3909 build is valid. In the upper version, the Fix byte is invalid.

bubeck commented 4 years ago

Could you please give an example line of igc:

  1. How it is currently generated
  2. Manually corrected to be right

Thanks!

Skysus commented 4 years ago

For example, for two fly at the same location: build 3909: B1206454248461N00022645EA0159601662 build 4240: B1029424248468N00022653EV0157300000

According to the 4.1 section to decode igc file from this adress: http://www.gliding.ch/images/news/lx20/fichiers_igc.htm#Brec From build 3909, the gps altitude is 01662 and from build upper, the gps altitude are always 00000

Skysus commented 4 years ago

I think the problem will be solved by changing the condition "fc.gps_data.fix == 3" to "fc.gps_data.fix > 1" in the "igc.cpp" file. From the Quectel L80 command datasheet, it seems that the GGA message provide the information if the altitude is correct. You must check the "Fix status" of the GGA message. To be correct, it must be upper 0. I can't check/compile it by myself.

bubeck commented 4 years ago

Could you please attach a gps.log by enabling setting>debug>debug gps and attach it here?

Skysus commented 4 years ago

DEBUG.LOG

Here the GPS debug log. It seems there is no GSA frame, that is why there is no 3D fix. So there is no altitude.

bubeck commented 4 years ago

Thanks for the DEBUG. This is what I found out:

  1. There is no GSA frame in your log. GSA is enabled in every mode (detailed and normal) and should be available all the time. I have no explanation, why it is missing and how it could be turned on. fc.gps_data.fix is taken from that record. Therefore you never have a fc.gps_data.fix > 0.
  2. A fc.gps_data.fix > 0 is needed for a GPS altitude to be available (in the IGC or at all)

An alternative implementation could be:

  1. As gps_altitude is already taken from GGA record, we could also use fix from GGA. The meaning of that field is a bit different than of GSA. It only has "0" and "1" meaning GPS invalid or valid. However, this is enough for gps_altitude.
  2. So I propose to introduce an additional variable fc.gps_data.fix_gsa which is used to check for a valid gps_altitude.

@fhorinek What do you think?

What else could we do?

Skysus commented 4 years ago

I tried to do a format SD card and install the last version code. And it works fine. No GPS bug log in igc file.

I find out why I had the bug. I only do an update by copying the "SKYDROP.FW" file to the SD card and do a reboot.

I change by removing the two ".EE" files and copying the "SKYDROP.FW" for 4520 version.

To check my idea, I come back to the 3909 version by copying the "SKYDROP.FW" file and removing the two .EE files. After rebooting, I notice some changement on the interface which is correct from the code (before this, I didn't understand why the interface was different, but for me the GPS is more important).

So, thanks you for your help. To sum up, it is not a GPS bug but how to do an update. Next time I will do an update, I will erase the two .EE files.