Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 11-09-2017, 15:43   #1
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Opencpn crashes when receiving WIMDA nmea sentence,

This is a bit of an odd one...

So chain of events - openplotter running on Pi3 has a BMP180 barometer attached, it creates an OCMDA nmea sentence with the pressure reading and via Kplex it gets sent out of a TCP port, 10.10.10.1:10109.
Then node red also connects to the same TCP port, filters to the OCMDA message, strips the "OC" and instead converts it to WIMDA (plus calcs new checksum). This goes back to kplex on port :10108 then goes from Kplex to opencpn over wifi with the rest of the nmea on Pi.Ip.Address:10109

This is so the logbook plugin will record the pressure automatically, it's the only sentence I could find which works.

Then O crashes! If I filter incoming messages to ignore WIMDA in OpenCPN then it's OK though the WIMDA sentence will still show up in the nmea debug window.

Pretty sure it worked on 4.6, now running 4.8.0 on a windows 10 laptop. Seems to be fine running Opencpn with the WIMDA sentence on the raspberry pi.

The nmea ->
$OCMDA,,,1.015,,24.8,C,,,,,,,,,,,,,,*3C
$WIMDA,,,1.015,,24.9,C,,,,,,,,,,,,,,*2f

Copied from node red but they look the same in Opencpn debug window.

TIA
conachair is offline   Reply With Quote
Old 12-09-2017, 00:17   #2
Registered User

Join Date: Feb 2012
Location: Austria
Posts: 320
Re: Opencpn crashes when receiving WIMDA nmea sentence,

Have raised this ... inconvenience (?) already in the past. unfortunatly nobody seems to be interested enough to fix this. the logbook pi should ignore the sensorid (OCxxx or WIxxx who cares, XxMDA is clear enough) . that we all now need to fiddle around with node-red just adds another level of fragility.
@conachair please vote in tracker #2241 pi-logbook section, I raised this bug there but it gets little attention. Maybe your (and other votes) can change this
skipperearly is offline   Reply With Quote
Old 12-09-2017, 01:03   #3
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: Opencpn crashes when receiving WIMDA nmea sentence,

If someone tells me how to get a NMEA file that causes the crash I will investigate.
transmitterdan is offline   Reply With Quote
Old 12-09-2017, 01:37   #4
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Opencpn crashes when receiving WIMDA nmea sentence,

WIMDA.txt.doc
Quote:
Originally Posted by transmitterdan View Post
If someone tells me how to get a NMEA file that causes the crash I will investigate.
Short saved file, this crashes Opencpn 4.8 on win10 if played through the VDR.
conachair is offline   Reply With Quote
Old 12-09-2017, 01:39   #5
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Opencpn crashes when receiving WIMDA nmea sentence,

Quote:
Originally Posted by skipperearly View Post
Have raised this ... inconvenience (?) already in the past. unfortunatly nobody seems to be interested enough to fix this. the logbook pi should ignore the sensorid (OCxxx or WIxxx who cares, XxMDA is clear enough) . that we all now need to fiddle around with node-red just adds another level of fragility.
@conachair please vote in tracker #2241 pi-logbook section, I raised this bug there but it gets little attention. Maybe your (and other votes) can change this


Also, in the meantime here's the node-red code should anyone be interested..

Code:
[
    {
        "id": "f8248ead.b409f",
        "type": "tcp in",
        "z": "749e8283.293f4c",
        "name": "",
        "server": "client",
        "host": "10.10.10.1",
        "port": "10109",
        "datamode": "stream",
        "datatype": "utf8",
        "newline": "",
        "topic": "",
        "base64": false,
        "x": 130,
        "y": 1720,
        "wires": [
            [
                "4f871abe.fbc6f4"
            ]
        ]
    },
    {
        "id": "4f871abe.fbc6f4",
        "type": "switch",
        "z": "749e8283.293f4c",
        "name": "Filter just pressure",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "regex",
                "v": "^(?=.*OCMDA)",
                "vt": "str",
                "case": false
            }
        ],
        "checkall": "true",
        "outputs": 1,
        "x": 170,
        "y": 1780,
        "wires": [
            [
                "84fb9bdf.4d3318",
                "4c4e6016.1474d"
            ]
        ]
    },
    {
        "id": "4c4e6016.1474d",
        "type": "function",
        "z": "749e8283.293f4c",
        "name": " '$OC\" to\"$WI\"",
        "func": "var nmeaFull=msg.payload;\n\nvar nmea=nmeaFull.substring(6 );     //\nnmea = '$WIMDA'  +  nmea;\n\n\nmsg.payload = nmea;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 367.0000305175781,
        "y": 1716.9999647140503,
        "wires": [
            [
                "c145d781.15cff8"
            ]
        ]
    },
    {
        "id": "c145d781.15cff8",
        "type": "function",
        "z": "749e8283.293f4c",
        "name": "Strip front and back",
        "func": "var nmeaFull=msg.payload;\n\nvar nmeaStripped=nmeaFull.substring(1, nmeaFull.indexOf(\"*\"));     //cut of the leading \"$\" and the bad checksum\nmsg.payload = nmeaStripped;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 400,
        "y": 1780,
        "wires": [
            [
                "15047f8.d3b1381"
            ]
        ]
    },
    {
        "id": "15047f8.d3b1381",
        "type": "delay",
        "z": "749e8283.293f4c",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "5",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "x": 580,
        "y": 1740,
        "wires": [
            [
                "4a1292f1.0e5eac"
            ]
        ]
    },
    {
        "id": "4a1292f1.0e5eac",
        "type": "function",
        "z": "749e8283.293f4c",
        "name": "calc checksum",
        "func": "var nmea = msg.payload;\nvar checksum = 0; \n\nfor(var i = 0; i < nmea.length; i++) { \n  checksum = checksum ^ nmea.charCodeAt(i); \n}\nchecksum = checksum.toString(16);    //convert to hex\nnmea = '$' + nmea + '*' + checksum;  //make the full nmea sentence again\n\nmessage = 'Full message =' + nmea + '\\r\\n' + 'Checksum = ' + checksum ;\n\nmsg.payload = nmea;\nmsg.payload = msg.payload+\"\\r\\n\"\n\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 700,
        "y": 1700,
        "wires": [
            [
                "39df93ac.8980fc",
                "738c6b4f.c2df54",
                "353fcc59.de9db4"
            ]
        ]
    },
    {
        "id": "738c6b4f.c2df54",
        "type": "udp out",
        "z": "749e8283.293f4c",
        "name": "",
        "addr": "127.0.0.1",
        "iface": "",
        "port": "10108",
        "ipv": "udp4",
        "outport": "",
        "base64": false,
        "multicast": "false",
        "x": 960,
        "y": 1680,
        "wires": []
    }
]
Edit - After a little more digging, if the "use WIMDA from weatherstation" is not selected in the konni logbook options|misc then Opencpn doesn't crash.
conachair is offline   Reply With Quote
Old 12-09-2017, 05:07   #6
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: Opencpn crashes when receiving WIMDA nmea sentence,

Quote:
Originally Posted by conachair View Post
Attachment 155925

Short saved file, this crashes Opencpn 4.8 on win10 if played through the VDR.
In Opencpn 4.8 under Windows 10 I get no crash. What dashboard instruments showing barometric pressure do you have showing? There is a known issue with history charts eating up a lot of CPU time. Are you getting a real crash or does it just hang and become unresponsive?
transmitterdan is offline   Reply With Quote
Old 12-09-2017, 07:59   #7
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,740
Re: Opencpn crashes when receiving WIMDA nmea sentence,

Dan,

looks from the comments that Konni's logbook crashes, not OCPN core.

Quote:
Have raised this ... inconvenience (?) already in the past. unfortunatly nobody seems to be interested enough to fix this. the logbook pi should ignore the sensorid (OCxxx or WIxxx who cares, XxMDA is clear enough)
bcn is online now   Reply With Quote
Old 12-09-2017, 15:45   #8
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Opencpn crashes when receiving WIMDA nmea sentence,

I believe Peter Tulip or Douwe might be able to fix this as they have updated/maintained logbook konni, but perhaps TDan will.
rgleason is offline   Reply With Quote
Old 13-09-2017, 02:05   #9
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Opencpn crashes when receiving WIMDA nmea sentence,

Quote:
Originally Posted by transmitterdan View Post
In Opencpn 4.8 under Windows 10 I get no crash. What dashboard instruments showing barometric pressure do you have showing? There is a known issue with history charts eating up a lot of CPU time. Are you getting a real crash or does it just hang and become unresponsive?
Just tried filtering out the OCMTW barometer nmea sentence and turning off the dashboard, same thing "opencpn has stopped working"

Only happens when receiving WIMDA sentence with "Use WIMDA.." selected in the logbook options.

conachair is offline   Reply With Quote
Old 13-09-2017, 03:13   #10
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: Opencpn crashes when receiving WIMDA nmea sentence,

Quote:
Originally Posted by conachair View Post
Just tried filtering out the OCMTW barometer nmea sentence and turning off the dashboard, same thing "opencpn has stopped working"

Only happens when receiving WIMDA sentence with "Use WIMDA.." selected in the logbook options.
The reason might be the way how plugins are compiled now for OpenCPN.
Long times ago the developers decided to compile plugins as standalone. This results in double code for e.g. nmea0183 in the OCPN code as well as in code for plugins which needs nmea. There are several other places where are code doubles then. This results into the need to change code in several places when it has changed in one place only.

I never used this scheme because it is unneeded work for me. I always compile all plugins together with the main OCPN code. Other examples of double code are wxJSON and files like ocpn_plugin.h and a lot more.

Obviously the developers have seen also some problems. OCPN comes now with 4 plugins together instead of 2 only as times before. The plugin scheme is not well-thought-out.

Gerhard
CarCode is online now   Reply With Quote
Old 15-09-2017, 15:16   #11
Registered User

Join Date: Nov 2014
Location: Netherlands
Posts: 219
Re: Opencpn crashes when receiving WIMDA nmea sentence,

I have build a new version (1.2027) of Logbookkonni.
This version should be able to read xxMDA and xxXDR messages with temperature, pressure and humidity if available.
I removed the WIMDA check field on the Preferences/Miscellaneous form.

As I don't have a windows environment I cannot test this version under windows
If somebody could be helpful and compile the code from https://github.com/ptulp/LogbookKonni-1.2 and see if this also solves the crashing problems.

Peter
ptulp is offline   Reply With Quote
Old 15-09-2017, 15:46   #12
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Opencpn crashes when receiving WIMDA nmea sentence,

ptulp
I can give it a try. Is there a Nmea file I should run to test it? ....Perhaps I can find one on file thingie/nmea but I am not sure about that.

Some others with Windows should also test I thinkk..
rgleason is offline   Reply With Quote
Old 15-09-2017, 16:41   #13
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Opencpn crashes when receiving WIMDA nmea sentence,

Gerhard, can you explain how this happens in a little more detail so perhaps we all can understand?

Quote:
Long times ago the developers decided to compile plugins as standalone. This results in double code for e.g. nmea0183 in the OCPN code as well as in code for plugins which needs nmea. There are several other places where are code doubles then. This results into the need to change code in several places when it has changed in one place only.
rgleason is offline   Reply With Quote
Old 15-09-2017, 17:21   #14
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Logbook compiled & runs

Ptulp, Thank you!

O Beta File Thingie 2.5.7 rguser, rgpass

Look in 4.8.0 Win PI directory for
Logbookkonni_pi-1.2027-win32.exe

Check your file with virustotal.com
No engines detected this file
SHA-256f1440b403f262565da16122c4c67d51d201957da0e9fc26 3f6ecc0f03133a66cFile name: logbookkonni_pi-1.2027-win32.exe
File size: 1.97 MB
Last analysis: 2017-09-15 23:58:57 UTC

I am trying to find where I start the nmea file, or do I just use VDRplayer or VDR? <-- I guess yes, since O and plugins all share the same messages generally.

The next question is I need a nmea file with:
WIMDA - to see if it crashes
xxMDA - to see if they work.
xxXDR messages with temperature, pressure and humidity if available.

Maybe tracker has a file under Logbook...

Hope others willl try this...
Perhaps Logbook could be expanded for Units and Own Ship - Boat Data such that it can share that with O and the other plugiins? Perhaps even allowing other plugins to change the values?

https://opencpn.org/flyspray/index.p...edit&sort=desc

I think Logbook might be ideal, because I don't see this being handled or stored by the main program... I don't believe there is any intention to do so.
rgleason is offline   Reply With Quote
Old 15-09-2017, 17:41   #15
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Opencpn crashes when receiving WIMDA nmea sentence,

I found WIMDA in this file on O Beta File Thingie in the Nmea directory to test for crashes, VDR-ais-file.txt but I created one instead...attached.

Here is the Logbook Tracker item this addresses.
https://opencpn.org/flyspray/index.p...241&project=13
Attached Files
File Type: doc WIMDA+OCMDA.doc (6.2 KB, 40 views)
rgleason is offline   Reply With Quote
Reply

Tags
enc, nmea, opencpn


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
how to generate nmea sentence for configuration Pegase Marine Electronics 4 03-03-2015 14:30
Radio Ocean O.Chart 7 NMEA 0183 Sentence moteje Marine Electronics 0 23-09-2013 04:13
NMEA WPL sentence support? s/v Jedi OpenCPN 9 04-03-2013 04:29
OpenCPN and NMEA sentence dmoore OpenCPN 8 21-12-2012 12:47
MOB NMEA sentence Cavalier Marine Electronics 13 27-08-2012 10:12

Advertise Here


All times are GMT -7. The time now is 10:09.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.