Transfer NMEA 2000 data to cloud

625 views
Skip to first unread message

Калоян Димитров

unread,
May 28, 2017, 10:43:40 AM5/28/17
to Signal K
Hello,

First of all, I would like to say sorry that my first post will be asking for help/opinion. Usually, do not like acting such way but I have been given task and very short notice. I am just few days into the NMEA protocols and need to provide a solution to get the NMEA 2000 data from a given boat, pass it to a GRPS modem and from there send it to cloud server. 

The last part after data entering the GRPS modem is clear, the problem is before that. 

So far I have the following idea - connect Raspberry PI with SignalK Java (https://github.com/SignalK/signalk-java) to the NMEA 2000 netwrork. Then filter this information (not sure exactly what has to be done, do I need to decode it?) and pass the information to the GRPS modem. 

Will this work, can you give me any advice?

Thank you in advance!

Kind regards,
Kaloyan Dimitrov

Charles Van Dusen

unread,
Jul 12, 2017, 9:08:24 AM7/12/17
to Signal K

Hi,

We are doing something similar using Signalk node version over Wifi:

Boat->NautiCloud->IPSec VPN To Remote network->View any Signalk App 

The narrative is this. We have developed a long range Wifi solution. We place one of them on a boat with an NMEA2000 network and a number of environmental and navigation sensors. Connect to it using an Actisense gateway and a raspberry pi running signalk-node. The rpi establishes a VPN to our company HQ. Then from anywhere on the company network we get live data as long as the NautiCloud can keep the connection established. In our experience we have been able to maintain enough bandwith for the VPN even up to 3 miles.

We do have a test facility that allows us to boost the wifi from shore that we are using, so that helps with the range, but the NautiCloud will also connect to any 2.4 gHz AP at 25-30X the distance of a normal usable WiFi connection.

HEre is a screenshot of the boats instruments from today

Paddy Burnside

unread,
Jul 30, 2017, 5:01:39 PM7/30/17
to Signal K
Have a look at the openplotter image for the raspberry pi - 

They also sell a canbus - USB adaptor which should get the data into the Pi though I haven't played with one to know for sure.

Then in node red you could filter the messages you want and send them over MQTT onto the web. 

This is a node red flow I did today to save nmea data to a sqlite database on a Raspberry Pi, might help with filtering..



[
    {
        "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"
    }
]


Al Thomason

unread,
Jul 30, 2017, 11:31:17 PM7/30/17
to sig...@googlegroups.com

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

mvVikingStar.blogspot.com

Reply all
Reply to author
Forward
0 new messages