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.
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
}
]