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
SignalK not receiving wind data
#6
(2022-01-04, 11:32 PM)ash_perry Wrote: Thanks guys. I tried turning off validate checksum and turning on remove null characters which suprisingly didn't change the log output.

The wind data is coming from a NASA Marine wind transducer connected to the RPi running openCPN via a serial to USB adapter. I read on another forum that the standard NMEA0183 sentence has floating point numbers with 1 deceimal place for wind angle and speed. The NASA transducer is outputting integers for those values in the NMEA sentence. For example:

NASA sentence: $WIMWV,345,R,2.3,N,A*21
Normal sentence: $WIMWV,345.0,R,2.3,N,A*21

I'm new to node-red but I think I could use it to clean the leading NULL chars and then convert ints to floats. Unsure whether it's better to then convert this back to an NMEA0183 sentence and then into signalK or send those values directly to a signalK path. Also not sure what's going on with the 'u\0000' in the first place either.

Just had a play on node red sending various nmea sentences to the server>>
With connections validate checksum off and remove null on ->
[Image: lwG4pQP.png]

This works and shows up as signalk data - $WIMWV,345,R,0,N,A*

But this one doesn't, though does show in the nmeaout event  log - \u0000$WIMWV,345,R,0,N,A*

In the log it looks like there's been an extra backslash added as well, might be relevent..
Jan 05 00:23:25 2022-01-05T00:23:25.031Z signalk-server:events:test [ '\\u0000$WIMWV,345,R,0,N,A*' ]

Looks like those leading chars could be the issue? 

I have some node red stashed on evernote to calc an nmea checksum, I'll have a play tomorrow & see how easy it is to filter out that message and replace with a more standard one.

Node red is such a great resource to have in signalk, this would likely be a show stopper for probably every other system  Cool

didn't take long, evernote is great for stashing stuff and actually finding it again..

in node red insert this,  ctrl + i then paste. Might be a cleaner way to do it, but this seems to work..

Code:
[
   {
       "id": "4bbdebc8.526844",
       "type": "debug",
       "z": "d6c01db7.8f1c",
       "name": "",
       "active": false,
       "tosidebar": true,
       "console": false,
       "tostatus": false,
       "complete": "true",
       "targetType": "full",
       "statusVal": "",
       "statusType": "auto",
       "x": 910,
       "y": 1640,
       "wires": []
   },
   {
       "id": "be4e41e4.4d46c",
       "type": "tcp in",
       "z": "d6c01db7.8f1c",
       "name": "",
       "server": "client",
       "host": "localhost",
       "port": "10110",
       "datamode": "stream",
       "datatype": "utf8",
       "newline": "",
       "topic": "",
       "base64": false,
       "x": 210,
       "y": 1660,
       "wires": [
           [
               "b3bf00bf.cd595"
           ]
       ]
   },
   {
       "id": "b3bf00bf.cd595",
       "type": "switch",
       "z": "d6c01db7.8f1c",
       "name": "",
       "property": "payload",
       "propertyType": "msg",
       "rules": [
           {
               "t": "cont",
               "v": "\\u0000",
               "vt": "str"
           }
       ],
       "checkall": "true",
       "repair": false,
       "outputs": 1,
       "x": 390,
       "y": 1660,
       "wires": [
           [
               "b8c06b8f.14c038"
           ]
       ]
   },
   {
       "id": "b8c06b8f.14c038",
       "type": "function",
       "z": "d6c01db7.8f1c",
       "name": "remove bad stuff",
       "func": "var nmeaFull=msg.payload;\n\nvar nmeaStripped=nmeaFull.substring(nmeaFull.indexOf(\"$\")+1, nmeaFull.indexOf(\"*\"));     //cut of the leading \"$\" and the bad checksum\nmsg.payload = nmeaStripped;\nreturn msg;\n",
       "outputs": 1,
       "noerr": 0,
       "initialize": "",
       "finalize": "",
       "libs": [],
       "x": 550,
       "y": 1660,
       "wires": [
           [
               "75daf0a0.f1d1b",
               "4bbdebc8.526844"
           ]
       ]
   },
   {
       "id": "75daf0a0.f1d1b",
       "type": "function",
       "z": "d6c01db7.8f1c",
       "name": "add 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\nmsg.payload = nmea + '\\r\\n';\nreturn msg;",
       "outputs": 1,
       "noerr": 0,
       "initialize": "",
       "finalize": "",
       "libs": [],
       "x": 760,
       "y": 1680,
       "wires": [
           [
               "4bbdebc8.526844",
               "3b97d61d.55ff1a"
           ]
       ]
   },
   {
       "id": "3b97d61d.55ff1a",
       "type": "udp out",
       "z": "d6c01db7.8f1c",
       "name": "",
       "addr": "127.0.0.1",
       "iface": "",
       "port": "10111",
       "ipv": "udp4",
       "outport": "",
       "base64": false,
       "multicast": "false",
       "x": 1000,
       "y": 1680,
       "wires": []
   }
]
Reply


Messages In This Thread
SignalK not receiving wind data - by ash_perry - 2022-01-04, 04:07 AM
RE: SignalK not receiving wind data - by PaddyB - 2022-01-04, 12:45 PM
RE: SignalK not receiving wind data - by tkurki - 2022-01-04, 04:13 PM
RE: SignalK not receiving wind data - by PaddyB - 2022-01-05, 01:31 AM
RE: SignalK not receiving wind data - by tkurki - 2022-01-05, 07:29 PM
RE: SignalK not receiving wind data - by PaddyB - 2022-01-05, 11:17 PM
RE: SignalK not receiving wind data - by tkurki - 2022-01-05, 12:45 AM
RE: SignalK not receiving wind data - by PaddyB - 2022-01-06, 12:23 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)