Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 27-09-2021, 02:20   #1
Registered User

Join Date: Jul 2020
Posts: 6
OpenCPN crashes when receiving certain NMEA messages

Hello,


I'm experiencing a weird problem, that might be difficult to recreate.


I have made a program written in Python that takes some sensor data (GPS, Radar, AIS, etc.) either directly from the sensors or from recorded text files. The program runs some processing and then sends the processed information to OpenCPN via UDP for visualization. This has worked very well for a while, but recently OpenCPN has started crashing when receiving certain NMEA messages.


If I send the following 3 NMEA messages to OpenCPN, it freezes and I have to restart it:
$HEHDT,90.0,T*16
$HEGGA,000000.00,0.0,N,0.0,E,2,11,0.8,-0.5,M,44.1,M,,*64


So the program just sends this out when no info is available from the sensors. As seen it just sets the own ship to coordinates (0,0) with a heading of 90 degrees.


Here comes the even weirder part:
If I only sends one of those messages there are no problems.

If I send both messages, but change the heading in the HDT message to 89.9 degrees or 90.1 degrees, there are no problems.
It is only when I send both messages and keep the heading at 90 degrees that OpenCPN crashes.


Has anyone experienced something similar or maybe know what could cause this? I'm using OpenCPN 5.2.4.
rhandersen is offline   Reply With Quote
Old 27-09-2021, 06:56   #2
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 3,268
Re: OpenCPN crashes when receiving certain NMEA messages

@rhandersen
Yes on Win10 I can reproduce that O is hanging when Lat/Lon is exactly 0.0 and HDT is exactly 90.0.
I can't debug it deep enough to find the cause but the same situation would likely not happen in real life. If this seems as a real problem a simple hack would be to change if hdt=90.000 then hdt = hdt + 0.0001. For your tests I'd recommend to use hdt = 90.0001 instead?
Hakan is offline   Reply With Quote
Old 27-09-2021, 07:11   #3
Registered User

Join Date: Jul 2020
Posts: 6
Re: OpenCPN crashes when receiving certain NMEA messages

Thank you. I will change the program to use different default values.

It's interesting that it doesn't work with these exact values, but you're right it's a very rare real life case.
rhandersen is offline   Reply With Quote
Old 01-10-2021, 23:36   #4
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 3,268
Re: OpenCPN crashes when receiving certain NMEA messages

For you info has Dave now corrected this in the master code for next O release.
Hakan is offline   Reply With Quote
Reply

Tags
enc, nmea, opencpn

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opencpn not receiving nmea sentances Boostin OpenCPN 3 11-01-2021 00:55
OpenCPN android 9 and NMEA messages through bluetooth pieterrv OpenCPN 1 02-05-2019 10:53
Opencpn crashes when receiving WIMDA nmea sentence, conachair OpenCPN 25 03-10-2017 03:18
AIS NMEA messages not acquired. usodimare OpenCPN 8 16-04-2017 19:16
Radar NMEA messages SolentBlue OpenCPN 19 27-07-2015 19:22

Advertise Here


All times are GMT -7. The time now is 07:51.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2021, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.