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

PGN 129284: nextPoint latitude found null by navigation.js conversion callback but it is available in data browser #94

Open
dpazz opened this issue Mar 17, 2024 · 8 comments

Comments

@dpazz
Copy link

dpazz commented Mar 17, 2024

If the "Navigation Data" option is enabled in the plugin this exception appears in the log:
Mar 17 17:23:55 TypeError: Cannot read properties of null (reading 'latitude') at callback (/home/pi/.signalk/node_modules/signalk-to-nmea2000/conversions/navigationdata.js:69:39) at /home/pi/.signalk/node_modules/signalk-to-nmea2000/index.js:209:44 at Next.valueF (/home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:912:14) at Next.value (/home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:901:31) at /home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:1048:24 at /home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:463:23 at processAfters (/home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:359:11) at Object.inTransaction (/home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:439:9) at Dispatcher.push (/home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:1214:24) at Dispatcher.handleEvent (/home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:1267:17) at /home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:242:17 at /home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:1787:17 at Timeout.sender [as _onTimeout] (/home/pi/.signalk/node_modules/baconjs/dist/Bacon.js:2242:14) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7)
But data required for conversion) are there (...nextPoint.position obj has a 'not null' latitude property), as is reported by Data Browser (see the attached screenshot). The signalk-server release is the last one (2.6.2) but I didn't looked to see if the exception occured in previous releases too.
Screenshot(24)

@dpazz
Copy link
Author

dpazz commented Mar 24, 2024

I think it can be solved changing the key transferred to callback in navigationdata.js line 37 from:
'navigation.courseRhumbline.nextPoint',
to
'navigation.courseRhumbline.nextPoint.position',

@wellenvogel
Copy link

The source for the navigation data is RMB - so I think the error has been introduced with SignalK/nmea0183-signalk@141bcbe.

As far as I understand the RMB parser is now inline with the spec (although the documentation at https://signalk.org/specification/1.7.0/doc/vesselsBranch.html does not really describe the "position" property of nextPoint).
So I guess the signalkto-nmea2000 must also be adapted.
No sure how freeboard-Sk is doing this...

@dpazz
Copy link
Author

dpazz commented Apr 5, 2024

I think the misleading is due to the 1.7.0 Sk spec. because nextPoint and previousPoint have different schema (resulting "incomplete" for the former where the "position" object is undefined) :
Screenshot(26)
even they are entities of the same type. I think that before any code release of the plugins an agreement on "fixing" the spec. should be reached

@wellenvogel
Copy link

@dpazz
Copy link
Author

dpazz commented Apr 5, 2024

I missed this screenshot to be more clear
Screenshot(27)

@free-x
Copy link

free-x commented Apr 5, 2024

#90

@mplattu
Copy link

mplattu commented Jun 29, 2024

I think it can be solved changing the key transferred to callback in navigationdata.js line 37 from: 'navigation.courseRhumbline.nextPoint', to 'navigation.courseRhumbline.nextPoint.position',

This fixed the issue for me. Thank you @dpazz

@davidsanner
Copy link

I think it can be solved changing the key transferred to callback in navigationdata.js line 37 from: 'navigation.courseRhumbline.nextPoint', to 'navigation.courseRhumbline.nextPoint.position',

That fixed it for me as well, thanks. Looks like #99 is the full fix.

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

No branches or pull requests

5 participants