todirbg / kln90b

kln90b gps for x-plane 11
6 stars 2 forks source link

`nan` displayed then crashed #2

Open JDeeth opened 6 months ago

JDeeth commented 6 months ago

image image

Got "NAN" displayed briefly then the GPS crashed!

Approx steps to reproduce:

  1. aircraft positioned in Spain (LEMO) while figuring out how to install 3D model
  2. start new flight in Scotland (EGPD). GPS takes a very long time to acquire position
  3. observe STA page - goes from INIT to ACQ with three satellites but NAV pages still show FLAG and no position
  4. activate GLESK SID from EGPD
  5. set left screen to FPL, right screen to REF
  6. activate right cursor and enter "GLESK"
  7. distance, N and E include "NAN" instead of numbers
  8. shortly after the plugin crashes
todirbg commented 6 months ago

I can't reproduce it. GLESK sid and GLESA wp do not exist in the standard xplane nav data. I suppose there is some kind of error in the navdata you are using. Can you please open Xplane main folder\Custom Data\KLN90B_Navdata\Waypints.txt and confirm GLESA way point exist and has correct floating point coordinates?

JDeeth commented 6 months ago

Thanks - there is a GLESK waypoint but no GLESA: image

I've got a Navigraph subscription so my custom nav data is based off recentish AIRAC data.

todirbg commented 6 months ago

Btw 4 satellites are needed for 3d fix so acq on 3 is correct. The acquisition time is very long, but you can change that in set10 page by switching GPS to FAST. The error itself has nothing to do with your position. The screen shows distance from the selected way point to the nearest vor. I can not understand where is that GLESA coming from. Did you entered it or it was part of the sid?

todirbg commented 6 months ago

What I wrote made me think a bit more. GLESK is not a vor and has no place in REF...

JDeeth commented 6 months ago

I didn't enter GLESA, it changed the FPL from GLESK to GLESA.

  1. start on EGPD runway
  2. find EGPD on APT 1, then select GLESK SID on APT 7. It loads the SID including the departure airport. image
  3. with FPL 0 and REF shown, RCRSR and enter GLESK: image
  4. FPL becomes Strange: image
  5. hitting ENT crashes the plugin image
[KLN90B ERROR]: Error updating module
[KLN90B ERROR]: [STACK]:| __mul : ...lugins/KLN90B/data/modules/Custom Module/KLN90_panel.lua:2019: attempt to perform arithmetic on local 'lat2' (a nil value)
[KLN90B ERROR]: [STACK]:| ...lugins/KLN90B/data/modules/Custom Module/KLN90_panel.lua:2019 in function <distance>
[KLN90B ERROR]: [STACK]:| ...lugins/KLN90B/data/modules/Custom Module/KLN90_panel.lua:3223 in function <findnearestleg>
[KLN90B ERROR]: [STACK]:| ...lugins/KLN90B/data/modules/Custom Module/KLN90_panel.lua:4039 in function <activateFPLN0>
[KLN90B ERROR]: [STACK]:| ...lugins/KLN90B/data/modules/Custom Module/KLN90_panel.lua:10317 in function <update>
[KLN90B ERROR]: [STACK]:| ... Marquise v2/plugins/KLN90B/data/init/initProcessing.lua:114 in function <updateAll>
[KLN90B ERROR]: [STACK]:| ...

ah so is it a case of REF not filtering what navaids it can be pointed at?

todirbg commented 6 months ago

10x I was able to reproduce it now.

JDeeth commented 5 months ago

The GPS seems to crash if you edit the flight plan with D/T open. it tries to do maths on null lat/lon values. Not sure if this is a separate issue - it does come up a lot more often than what I described above!

JDeeth commented 5 months ago

I've got a fix for the FPL0 D/T3 issue but I'm off sick with Covid and can't get to my PC to wrap it up and post it. There's an arithmetic function, checking if lat/lon/1/2 aren't "_". I wrapped this in another function that additionally checks they're not nil. Might fix this issue too but if not I'll make sure it does and should be able to send a PR next week

todirbg commented 4 months ago

Hope you are feeling better already :) I did try to follow that issue to its root, but it is deeper than just making nan checks. I was not able to understand why the function is getting nan. This needs more investigation.