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
Navtex
#9
(2018-10-24, 08:58 PM)ocina Wrote: I have a nasa navtex with a serial output. 
May I ask how you process the data of the memory in openplotter?
The command '$S' transfers the data to a file on the Pi. 
But than, how do how do you process the text data? With Node-Red?

And what happens when a new Navtex message comes in? 

Thank you for tips on this topic.

Best regards
Bernhard

Hi,   I used node-red, it's not been set up for a while but just found the backup, basically a insert node sends "0x0D 0x0A $S 0x0D 0x0A 0x0D 0x0A" to a serial port connected to the navtex engine for entire memory, then another serial port reads the output and sends it to a file and a node red dashboard. 

[Image: F7N3QAC.png]


Code:
[
   {
       "id": "425db2f6.5cb68c",
       "type": "debug",
       "z": "c8d5e3c.51c102",
       "name": "",
       "active": true,
       "console": "false",
       "complete": "true",
       "x": 590,
       "y": 220,
       "wires": []
   },
   {
       "id": "d0dda73f.8e4858",
       "type": "serial out",
       "z": "c8d5e3c.51c102",
       "name": "",
       "serial": "c20e3892.858608",
       "x": 610,
       "y": 380,
       "wires": []
   },
   {
       "id": "138b4303.8977fd",
       "type": "inject",
       "z": "c8d5e3c.51c102",
       "name": "Version",
       "topic": "",
       "payload": "0x0D 0x0A $V 0x0D 0x0A 0x0D 0x0A",
       "payloadType": "str",
       "repeat": "",
       "crontab": "",
       "once": false,
       "onceDelay": "",
       "x": 110,
       "y": 300,
       "wires": [
           [
               "d0dda73f.8e4858"
           ]
       ]
   },
   {
       "id": "f86d16d3.41fec8",
       "type": "file",
       "z": "c8d5e3c.51c102",
       "name": "",
       "filename": "/home/pi/navtex.txt",
       "appendNewline": true,
       "createDir": false,
       "overwriteFile": "false",
       "x": 630,
       "y": 300,
       "wires": [
           []
       ]
   },
   {
       "id": "5b1d08d6.fd2e98",
       "type": "function",
       "z": "c8d5e3c.51c102",
       "name": "Add timestamp to msg.payload",
       "func": "var today = new Date();\nvar day = today.getDate();\nif(day<10){\n    day='0'+day;\n} \nvar month = today.getMonth()+1;\nif(month<10){\n    month='0'+month;\n} \nvar hours = today.getHours();\nif(hours<10){\n    hours='0'+hours;\n} \nvar minutes = today.getMinutes();\nif(minutes<10){\n    minutes='0'+minutes;\n} \n\nvar seconds = today.getSeconds();\nif(seconds<10){\n    seconds='0'+seconds;\n} \n\nvar when = day + '/' + month + '-' + hours + ':' + minutes + ':' + seconds;\nmsg.payload=when + \" - Navtex received- \" + msg.payload;\nreturn msg;",
       "outputs": 1,
       "noerr": 0,
       "x": 330,
       "y": 240,
       "wires": [
           [
               "425db2f6.5cb68c",
               "47782932.77e948",
               "f86d16d3.41fec8",
               "cf3373d6.0f8fb"
           ]
       ]
   },
   {
       "id": "47782932.77e948",
       "type": "ui_text",
       "z": "c8d5e3c.51c102",
       "group": "2557d957.083236",
       "order": 0,
       "width": 0,
       "height": 0,
       "name": "Dashboard text window",
       "label": "",
       "format": "{{msg.payload}}",
       "layout": "row-spread",
       "x": 650,
       "y": 260,
       "wires": []
   },
   {
       "id": "d4a8292d.700a38",
       "type": "inject",
       "z": "c8d5e3c.51c102",
       "name": "Entire memory",
       "topic": "",
       "payload": "0x0D 0x0A $S 0x0D 0x0A 0x0D 0x0A",
       "payloadType": "str",
       "repeat": "",
       "crontab": "",
       "once": false,
       "x": 140,
       "y": 340,
       "wires": [
           [
               "d0dda73f.8e4858"
           ]
       ]
   },
   {
       "id": "b7ba4837.bd9d58",
       "type": "file",
       "z": "c8d5e3c.51c102",
       "name": "",
       "filename": "/home/pi/navtex2.txt",
       "appendNewline": true,
       "createDir": false,
       "overwriteFile": "false",
       "x": 640,
       "y": 340,
       "wires": [
           []
       ]
   },
   {
       "id": "cf3373d6.0f8fb",
       "type": "ui_text",
       "z": "c8d5e3c.51c102",
       "group": "60e4b1f9.7872b",
       "order": 0,
       "width": "6",
       "height": "8",
       "name": "Dashboard text window",
       "label": "",
       "format": "{{msg.payload}}",
       "layout": "row-spread",
       "x": 650,
       "y": 180,
       "wires": []
   },
   {
       "id": "b5c65947.4b7788",
       "type": "inject",
       "z": "c8d5e3c.51c102",
       "name": "",
       "topic": "",
       "payload": "0x0D 0x0A $A 0x0D 0x0A 0x0D 0x0A $C, hhmm  0x0D 0x0A  0x0D 0x0A",
       "payloadType": "str",
       "repeat": "",
       "crontab": "",
       "once": false,
       "x": 110,
       "y": 380,
       "wires": [
           [
               "d0dda73f.8e4858"
           ]
       ]
   },
   {
       "id": "e6329e00.2a7b2",
       "type": "comment",
       "z": "c8d5e3c.51c102",
       "name": "Navtex",
       "info": "",
       "x": 90,
       "y": 180,
       "wires": []
   },
   {
       "id": "594fd547.22978c",
       "type": "serial in",
       "z": "c8d5e3c.51c102",
       "name": "",
       "serial": "c20e3892.858608",
       "x": 120,
       "y": 240,
       "wires": [
           [
               "5b1d08d6.fd2e98"
           ]
       ]
   },
   {
       "id": "c20e3892.858608",
       "type": "serial-port",
       "z": "",
       "serialport": "/dev/ttyUSB0",
       "serialbaud": "38400",
       "databits": "8",
       "parity": "none",
       "stopbits": "1",
       "newline": "50",
       "bin": "false",
       "out": "time",
       "addchar": false
   },
   {
       "id": "2557d957.083236",
       "type": "ui_group",
       "z": "",
       "name": "Messages",
       "tab": "39e59923.a2ab46",
       "disp": true,
       "width": "12"
   },
   {
       "id": "60e4b1f9.7872b",
       "type": "ui_group",
       "z": "",
       "name": "Navtex messages",
       "tab": "223c6da8.91af02",
       "order": 3,
       "disp": true,
       "width": "6"
   },
   {
       "id": "39e59923.a2ab46",
       "type": "ui_tab",
       "z": "",
       "name": "Navtex ",
       "icon": "dashboard",
       "order": 4
   },
   {
       "id": "223c6da8.91af02",
       "type": "ui_tab",
       "z": "",
       "name": "Gauges",
       "icon": "dashboard",
       "order": 1
   }
]
Reply


Messages In This Thread
Navtex - by SkipperEarly - 2016-04-24, 09:05 AM
RE: Navtex - by PaddyB - 2016-04-27, 10:46 AM
RE: Navtex - by tkoning - 2016-04-29, 10:07 AM
RE: Navtex - by SkipperEarly - 2016-04-29, 07:24 PM
RE: Navtex - by PaddyB - 2016-04-29, 07:56 PM
RE: Navtex - by gniersma - 2016-11-20, 12:44 PM
RE: Navtex - by PaddyB - 2016-11-21, 06:52 AM
RE: Navtex - by ocina - 2018-10-24, 08:58 PM
RE: Navtex - by PaddyB - 2018-10-26, 12:32 PM
RE: Navtex - by ocina - 2018-10-26, 03:09 PM
RE: Navtex - by abarrow - 2018-10-26, 01:41 PM
RE: Navtex - by PaddyB - 2018-10-26, 02:18 PM
RE: Navtex - by abarrow - 2018-10-26, 06:24 PM
RE: Navtex - by PaddyB - 2018-10-27, 11:14 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)