[ { "id": "ae84828b.96ce4", "type": "switch", "z": "f1a0cb4.fe86138", "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": 140, "y": 360, "wires": [ [ "df4a7c79.5f02c" ] ] }, { "id": "df4a7c79.5f02c", "type": "change", "z": "f1a0cb4.fe86138", "name": "create msg.eng 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": 170, "y": 400, "wires": [ [ "3f01efd9.4b7b3" ] ] }, { "id": "3f01efd9.4b7b3", "type": "function", "z": "f1a0cb4.fe86138", "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": 390, "y": 360, "wires": [ [ "1e400b7c.ee0d55" ] ] }, { "id": "1e400b7c.ee0d55", "type": "delay", "z": "f1a0cb4.fe86138", "name": "", "pauseType": "rate", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "minute", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": true, "x": 390, "y": 400, "wires": [ [ "14bb1d02.077ee3" ] ] }, { "id": "14bb1d02.077ee3", "type": "sqlite", "z": "f1a0cb4.fe86138", "mydb": "fe279cd9.bbe82", "name": "", "x": 670, "y": 400, "wires": [ [] ] }, { "id": "fe279cd9.bbe82", "type": "sqlitedb", "z": "", "db": "/home/pi/database/boatdata.db" }]Kayoyan,
Perhaps another idea for you (though not SignalK based): Using a socketCAN adapter on an RPi, and Timo’s NMEA2000 lib to directly pull out the CAN messages. This would all be in C/C++, if that is usable to you.
For this you would need:
RPi
socketCAN adapter (a nice one for the RPi is the PiCAN series of adapters, there are a few variations including dual and isolated)
http://skpang.co.uk/catalog/pican2-canbus-board-for-raspberry-pi-23-p-1475.html
http://copperhilltech.com/pican-2-can-interface-for-raspberry-pi/
NMEA2000 C++ library: https://github.com/ttlappalainen/NMEA2000
socketCAN driver for NMEA2000 lib: https://github.com/thomasonw/NMEA2000_socketCAN
With this you can develop a C/C++ app directly accessing the CAN bus and parsing NMEA2000. You have to verify that Timo’s NMEA2000 lib has support for the messages you are looking at capturing.
-al-
Viking Star
45' Monk Sr. / McQueen