OpenMarine

Full Version: Auto run VDR plugin on OpenCPN
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,
 I currently have OpenCPN running on a Pi 3 and using the VDR plugin to record AIS targets. It is just a base station on shore and we are prone to long power cuts. Is there a way for the VDR plug in to start recording once OpenCPN opens? At the moment after every power cut i have to remote connect into the Pi and start the recording again. or are there any other AIS recording programs for the Pi that have this feature?

Thanks
Have you played with node-red? 

This flow should work to save all AIS messages to a file in the /home/pi/ directory called savedais.txt.

Code:
[
   {
       "id": "36d7cef4.ce9742",
       "type": "tcp in",
       "z": "f1a0cb4.fe86138",
       "name": "",
       "server": "client",
       "host": "10.10.10.1",
       "port": "10109",
       "datamode": "stream",
       "datatype": "utf8",
       "newline": "\\n",
       "topic": "",
       "base64": false,
       "x": 177.00001525878906,
       "y": 263.00000762939453,
       "wires": [
           [
               "2ec38e6f.de4e32"
           ]
       ]
   },
   {
       "id": "21e9962f.f4aada",
       "type": "debug",
       "z": "f1a0cb4.fe86138",
       "name": "",
       "active": true,
       "console": "false",
       "complete": "false",
       "x": 730,
       "y": 280,
       "wires": []
   },
   {
       "id": "2ec38e6f.de4e32",
       "type": "switch",
       "z": "f1a0cb4.fe86138",
       "name": "Filter just ais",
       "property": "payload",
       "propertyType": "msg",
       "rules": [
           {
               "t": "regex",
               "v": "!AIVDM*",
               "vt": "str",
               "case": true
           }
       ],
       "checkall": "true",
       "outputs": 1,
       "x": 470,
       "y": 200,
       "wires": [
           [
               "21e9962f.f4aada",
               "b94ee7ad.e95078"
           ]
       ]
   },
   {
       "id": "b94ee7ad.e95078",
       "type": "file",
       "z": "f1a0cb4.fe86138",
       "name": "",
       "filename": "/home/pi/savedais.txt",
       "appendNewline": true,
       "createDir": false,
       "overwriteFile": "false",
       "x": 760,
       "y": 120,
       "wires": []
   },
   {
       "id": "5fab7c2f.223b14",
       "type": "comment",
       "z": "f1a0cb4.fe86138",
       "name": "Saves all AIS messages to a file",
       "info": "",
       "x": 190,
       "y": 140,
       "wires": []
   }
]