This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Allow NMEA 0183 file input/output
#8
(2017-05-31, 11:50 AM)holgerw Wrote: Hello

good Solution to input/patch the NMEA Data.


But another Thing about KPLEX Config:
Why do we allways get these system_a and system_b ports with default. 
Both were INPUTS and get DATA from the same UDP-in Port 10110. 
In my Opinion one is obsolete.

Not sure and don't know enough to consider going near  the delete button.....

One last thing, when node red was outputting to address = "localhost" , the address in openplotter nmea tab seemed to ned to be blank to accept the data, I've changed node red to send to address "10.10.10.1" , with openplotter set to look there it seems to work OK. 

[Image: ESNd2Dn.png]


And another tip - if you want to quickly see whats coming in a port you can use this in a terminal..

netcat -ul 10108
(port 10108)


And a quick node-red flow which creates a new NMEA message which opencpn dashboard recognises and will automatically ut into the logbook konni. Note - you need to have an input on 10.10.10.1:10108 in the nmea tab for this to work. Ta

Code:
[
   {
       "id": "a40d315e.6d623",
       "type": "udp in",
       "z": "dcf0a43.0c79158",
       "name": "",
       "iface": "",
       "port": "10110",
       "ipv": "udp4",
       "multicast": "false",
       "group": "",
       "datatype": "utf8",
       "x": 220,
       "y": 520,
       "wires": [
           [
                "983684db.178fa8",
                "4bdefe26.a6557"
            ]
       ]
   },
   {
       "id": "8f7e9341.ce0e1",
       "type": "debug",
       "z": "dcf0a43.0c79158",
       "name": "",
       "active": false,
       "console": "false",
       "complete": "false",
       "x": 1090,
       "y": 500,
       "wires": []
   },
   {
       "id": "4bdefe26.a6557",
       "type": "debug",
       "z": "dcf0a43.0c79158",
       "name": "",
       "active": false,
       "console": "false",
       "complete": "false",
       "x": 390,
       "y": 600,
       "wires": []
   },
   {
       "id": "983684db.178fa8",
       "type": "switch",
       "z": "dcf0a43.0c79158",
       "name": "Filter just pressure",
       "property": "payload",
       "propertyType": "msg",
       "rules": [
            {
                "t": "regex",
                "v": "OCMDA*",
                "vt": "str",
                "case": true
            }
        ],
       "checkall": "true",
       "outputs": 1,
       "x": 430,
       "y": 520,
       "wires": [
           [
                "85be98e1.ebdaf8"
            ]
       ]
   },
   {
       "id": "85be98e1.ebdaf8",
       "type": "function",
       "z": "dcf0a43.0c79158",
       "name": "Strip '$OC\"",
       "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": 610,
       "y": 520,
       "wires": [
           [
                "15037269.71db2e"
            ]
       ]
   },
   {
       "id": "f276f15e.2e3c6",
       "type": "udp out",
       "z": "dcf0a43.0c79158",
       "name": "",
       "addr": "10.10.10.1",
       "iface": "",
       "port": "10108",
       "ipv": "udp4",
       "outport": "",
       "base64": false,
       "multicast": "false",
       "x": 1120,
       "y": 560,
       "wires": []
   },
   {
       "id": "5d7d539b.4836dc",
       "type": "function",
       "z": "dcf0a43.0c79158",
       "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": 840,
       "y": 600,
       "wires": [
           [
                "8f7e9341.ce0e1",
                "f276f15e.2e3c6"
            ]
       ]
   },
   {
       "id": "15037269.71db2e",
       "type": "function",
       "z": "dcf0a43.0c79158",
       "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": 820,
       "y": 500,
       "wires": [
           [
                "5d7d539b.4836dc"
            ]
       ]
   }
]
Reply


Messages In This Thread
Allow NMEA 0183 file input/output - by abarrow - 2017-05-30, 10:12 PM
RE: Allow NMEA 0183 file input/output - by PaddyB - 2017-05-30, 10:18 PM
RE: Allow NMEA 0183 file input/output - by PaddyB - 2017-05-30, 11:59 PM
RE: Allow NMEA 0183 file input/output - by PaddyB - 2017-05-31, 10:32 AM
RE: Allow NMEA 0183 file input/output - by PaddyB - 2017-05-31, 11:59 AM
RE: Allow NMEA 0183 file input/output - by MatsA - 2017-08-13, 09:11 PM
RE: Allow NMEA 0183 file input/output - by PaddyB - 2017-08-14, 12:46 PM
RE: Allow NMEA 0183 file input/output - by MatsA - 2017-08-15, 09:14 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)