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
New user, some questions...
#3
You might find node-red is a bit easier, available as a signalk app in the app store.
This is for random wind direction, outputs UDP over port 10112 so you need to create a server connection for nmea0183/UDP port 10112 >

Code:
[{"id":"bf02070e.166bf8","type":"inject","z":"f792bbef.555918","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":340,"wires":[["c66ee625.6bcd28"]]},{"id":"c66ee625.6bcd28","type":"random","z":"f792bbef.555918","name":"","low":"1","high":"10","inte":"true","property":"payload","x":120,"y":400,"wires":[["4f4e9fcd.f86bb"]]},{"id":"4f4e9fcd.f86bb","type":"function","z":"f792bbef.555918","name":"RandomWindDirection","func":"// msg.payload = \"$WIMWV,270.0,R,15.0,N,A*36\\r\\n\";\nvar temp = msg.payload * 36;\n// $ERRPM,E,1,2000,,,,*2\n\nmsg.temp = \"WIMWV,\" + temp + \",R,15.0,N,A\";\n\nvar nmea = msg.temp;\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 =  nmea + '\\r\\n';\n\n\nmsg.payload  = message;\nreturn msg;\n\n","outputs":1,"noerr":0,"x":300,"y":400,"wires":[["9749b954.a12318","8a03fcb3.c1274"]]},{"id":"9749b954.a12318","type":"debug","z":"f792bbef.555918","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":370,"y":340,"wires":[]},{"id":"8a03fcb3.c1274","type":"udp out","z":"f792bbef.555918","name":"","addr":"127.0.0.1","iface":"","port":"10112","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":540,"y":400,"wires":[]}]

Copy then in the node-red editor press ctrl & i to insert. 

Or the SKSIm app is very good for testing.
Reply


Messages In This Thread
New user, some questions... - by sebba - 2020-01-24, 01:57 PM
RE: New user, some questions... - by sebba - 2020-01-25, 01:12 PM
RE: New user, some questions... - by PaddyB - 2020-01-25, 02:32 PM
RE: New user, some questions... - by sebba - 2020-01-25, 03:41 PM
RE: New user, some questions... - by PaddyB - 2020-01-25, 04:41 PM
RE: New user, some questions... - by Tigress - 2020-08-15, 01:04 AM
RE: New user, some questions... - by PaddyB - 2020-08-15, 12:32 PM
RE: New user, some questions... - by sebba - 2020-01-25, 05:49 PM
RE: New user, some questions... - by PaddyB - 2020-01-25, 06:34 PM
RE: New user, some questions... - by sebba - 2020-01-25, 07:13 PM
RE: New user, some questions... - by PaddyB - 2020-01-25, 07:58 PM
RE: New user, some questions... - by sebba - 2020-01-25, 09:48 PM
RE: New user, some questions... - by PaddyB - 2020-01-26, 12:35 PM
RE: New user, some questions... - by sebba - 2020-01-26, 01:04 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)