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
Anyone datalogging?
#19
(2017-11-17, 02:35 PM)tocan Wrote: Its nice you found yours solution but i am no more interest in sql database logging. That this is working i did publish in my blog . What i am interesting for is something you did drop for. i am interesting in a step by step guide of yours influx db logging with grafana  including the connection to  Signal K. There is no reason i think to hide what you did drop. Exact this work i am interesting for.

Grafa was populated through node-red. 
Similar to this for sqlite -



Code:
[
   {
       "id": "67b79641.1fad68",
       "type": "websocket in",
       "z": "749e8283.293f4c",
       "name": "SignalK input",
       "server": "fc1b2b62.0b63a8",
       "client": "",
       "x": 90,
       "y": 120,
       "wires": [
           [
               "20af45d9.7fe30a",
               "abc25a09.833898"
           ]
       ]
   },
   {
       "id": "abc25a09.833898",
       "type": "switch",
       "z": "749e8283.293f4c",
       "name": "Is it nav data?",
       "property": "msg.payload.updates.source.sentence",
       "propertyType": "jsonata",
       "rules": [
           {
               "t": "eq",
               "v": "RMC",
               "vt": "str"
           }
       ],
       "checkall": "false",
       "outputs": 1,
       "x": 500,
       "y": 60,
       "wires": [
           [
               "4c17ab8.141a354"
           ]
       ]
   },
   {
       "id": "4c17ab8.141a354",
       "type": "change",
       "z": "749e8283.293f4c",
       "name": "create COG, SOG etc",
       "rules": [
           {
               "t": "set",
               "p": "SOG",
               "pt": "msg",
               "to": "msg.payload.updates.values[path=\"navigation.speedOverGround\"].value*1.94384",
               "tot": "jsonata"
           },
           {
               "t": "set",
               "p": "COG",
               "pt": "msg",
               "to": "msg.payload.updates.values[path=\"navigation.courseOverGroundTrue\"].value*180/3.14",
               "tot": "jsonata"
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 520,
       "y": 100,
       "wires": [
           [
               "23641279.19f17e"
           ]
       ]
   },
   {
       "id": "23641279.19f17e",
       "type": "function",
       "z": "749e8283.293f4c",
       "name": "create INSERT topic SOG, COG",
       "func": "\n    msg.SOG=msg.SOG.toFixed(1);\n    msg.COG=msg.COG.toFixed(1);\n    msg.topic = \"INSERT INTO navdata  (SOG, COG) VALUES (\"  + msg.SOG + \",\" + msg.COG  + \" );\";\n   \n    return msg;",
       "outputs": "1",
       "noerr": 0,
       "x": 750,
       "y": 60,
       "wires": [
           [
               "8e3e8329.9202f"
           ]
       ]
   },
   {
       "id": "8e3e8329.9202f",
       "type": "delay",
       "z": "749e8283.293f4c",
       "name": "",
       "pauseType": "rate",
       "timeout": "5",
       "timeoutUnits": "seconds",
       "rate": "1",
       "nbRateUnits": "1",
       "rateUnits": "minute",
       "randomFirst": "1",
       "randomLast": "5",
       "randomUnits": "seconds",
       "drop": true,
       "x": 710,
       "y": 100,
       "wires": [
           [
               "a2715992.38a2d8"
           ]
       ]
   },
   {
       "id": "a2715992.38a2d8",
       "type": "sqlite",
       "z": "749e8283.293f4c",
       "mydb": "fe279cd9.bbe82",
       "name": "",
       "x": 1030,
       "y": 100,
       "wires": [
           []
       ]
   },
   {
       "id": "fc1b2b62.0b63a8",
       "type": "websocket-listener",
       "z": "",
       "path": "ws://localhost:3000/signalk/v1/stream",
       "wholemsg": "false"
   },
   {
       "id": "fe279cd9.bbe82",
       "type": "sqlitedb",
       "z": "",
       "db": "/home/pi/database/boatdata.db"
   }
]

This one might be of use as well, simply saving AIS to a text file -

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": 184.00001525878906,
       "y": 83,
       "wires": [
           [
               "2ec38e6f.de4e32"
           ]
       ]
   },
   {
       "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": 412,
       "y": 68.99998474121094,
       "wires": [
           [
               "b94ee7ad.e95078"
           ]
       ]
   },
   {
       "id": "b94ee7ad.e95078",
       "type": "file",
       "z": "f1a0cb4.fe86138",
       "name": "",
       "filename": "/home/pi/savedais2.txt",
       "appendNewline": true,
       "createDir": false,
       "overwriteFile": "false",
       "x": 624,
       "y": 45.99998474121094,
       "wires": []
   }
]
Reply


Messages In This Thread
Anyone datalogging? - by PaddyB - 2017-11-14, 10:03 PM
RE: Anyone datalogging? - by shark24 - 2017-11-15, 10:19 AM
RE: Anyone datalogging? - by PaddyB - 2017-11-15, 10:51 AM
RE: Anyone datalogging? - by shark24 - 2017-11-15, 11:45 AM
RE: Anyone datalogging? - by PaddyB - 2017-11-15, 02:27 PM
RE: Anyone datalogging? - by tocan - 2017-11-15, 03:13 PM
RE: Anyone datalogging? - by PaddyB - 2017-11-15, 03:45 PM
RE: Anyone datalogging? - by tocan - 2017-11-15, 05:20 PM
RE: Anyone datalogging? - by tocan - 2017-11-15, 03:51 PM
RE: Anyone datalogging? - by shark24 - 2017-11-15, 04:49 PM
RE: Anyone datalogging? - by tocan - 2017-11-15, 09:06 PM
RE: Anyone datalogging? - by shark24 - 2017-11-16, 11:10 AM
RE: Anyone datalogging? - by PaddyB - 2017-11-16, 10:46 AM
RE: Anyone datalogging? - by tocan - 2017-11-16, 09:01 PM
RE: Anyone datalogging? - by shark24 - 2017-11-17, 01:23 PM
RE: Anyone datalogging? - by PaddyB - 2017-11-17, 02:09 PM
RE: Anyone datalogging? - by tocan - 2017-11-17, 09:09 AM
RE: Anyone datalogging? - by tocan - 2017-11-17, 02:35 PM
RE: Anyone datalogging? - by PaddyB - 2017-11-17, 03:09 PM
RE: Anyone datalogging? - by shark24 - 2017-11-19, 09:08 AM
RE: Anyone datalogging? - by tocan - 2017-11-19, 04:44 PM
RE: Anyone datalogging? - by shark24 - 2017-11-19, 06:14 PM
RE: Anyone datalogging? - by tocan - 2017-11-19, 07:16 PM
RE: Anyone datalogging? - by shark24 - 2017-11-19, 08:21 PM
RE: Anyone datalogging? - by tocan - 2017-11-19, 11:23 PM
RE: Anyone datalogging? - by PaddyB - 2017-11-22, 11:54 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)