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
Serial Port nodes
#4
you could pull data from web-socket send to serial.. example below, you can only have one WS so use the one already there or use link node, select your config for serial node "printer".i dont know anything about that printer but other ones use cups drivers ect for setup.this flow will continually send data you will need to setup a switch somehow to send once maybe a button on dashboard.
you could get all the data directly from the web socket "ws://localhost:3000/signalk/v1/stream" it might be more than you need or you could parse out what you want.as in example for lat.

Code:
[{"id":"9b02acf9.c5cea","type":"websocket in","z":"c0812b05.2e9308","name":"ws","server":"ae07cdf2.445f1","client":"","x":50,"y":100,"wires":[["fbd5273f.9a1e28"]]},{"id":"fbd5273f.9a1e28","type":"jsonpath","z":"c0812b05.2e9308","expression":"$.updates..values[*]","split":false,"name":"Signal K delta values","x":220,"y":100,"wires":[["18af8a77.9fec86"]]},{"id":"18af8a77.9fec86","type":"function","z":"c0812b05.2e9308","name":"merge values","func":"var paths={};\nvar arrayLength = msg.payload.length;\nfor (var i = 0; i < arrayLength; i++) {\n    paths[msg.payload[i].path]=msg.payload[i].value;\n}\nmsg.payload = paths;\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":100,"wires":[["16f4fff3.e963e"]]},{"id":"16f4fff3.e963e","type":"function","z":"c0812b05.2e9308","name":"navigation.position.latitude","func":"var signalk_key=\"navigation.position\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key][\"latitude\"];\n    return msg;\n}","outputs":1,"noerr":0,"x":640,"y":100,"wires":[["f0dbe5bf.c3e018"]]},{"id":"f0dbe5bf.c3e018","type":"serial out","z":"c0812b05.2e9308","x":830,"y":100,"wires":[]},{"id":"ae07cdf2.445f1","type":"websocket-listener","z":"","path":"ws://localhost:3000/signalk/v1/stream","wholemsg":"false"}]
Reply


Messages In This Thread
Serial Port nodes - by cepicscepics - 2018-05-07, 12:22 AM
RE: Serial Port nodes - by jim321 - 2018-05-07, 10:38 AM
RE: Serial Port nodes - by cepicscepics - 2018-05-07, 12:20 PM
RE: Serial Port nodes - by jim321 - 2018-05-07, 01:06 PM
Serial Port nodes - by callmecalanca - 2018-05-07, 11:54 PM
RE: Serial Port nodes - by jim321 - 2018-05-08, 12:54 AM
Serial Port nodes - by callmecalanca - 2018-05-08, 01:40 AM
RE: Serial Port nodes - by jim321 - 2018-05-08, 10:49 AM
Serial Port nodes - by callmecalanca - 2018-05-08, 10:53 AM
RE: Serial Port nodes - by jim321 - 2018-05-08, 11:32 AM
Serial Port nodes - by callmecalanca - 2018-05-08, 11:58 AM
RE: Serial Port nodes - by jim321 - 2018-05-08, 05:11 PM
RE: Serial Port nodes - by cepicscepics - 2018-05-08, 05:21 PM
RE: Serial Port nodes - by jim321 - 2018-05-09, 12:04 PM
RE: Serial Port nodes - by cepicscepics - 2018-05-11, 05:35 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)