Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 07-12-2022, 12:34   #1
Registered User

Join Date: Dec 2022
Posts: 1
How to read NMEA2000 data and display it through OpenCPN or other means

Hello !

I am a student on IT doing academic research and work on a maritime security project. The goal of the project is to spoof a vessel and also build a honeypot.

Now, what I am stuck on for about two weeks is simulating the NMEA2000 port, and sending the data through VIRTUAL PORTS to a destination such as OpenCPN or even OpenSkipper so it can be read.

I have tried countless simulators that were for free online but the most comprehensive guide that I found was the one from OpenSkipper which I followed step by step with no success. On the GPS side it seems to be receivng some values that are redeable when I stear but overall like knots or other aspects are not being able to be read.

I have read the documentation from the OpenSkipper github link: https://github.com/OpenSkipper/OpenSkipper.

If it helps, this is example of PUTTY output with NMEA simulation and virtual ports.

HTML Code:
 
Arian Atapour • 6 hours ago
Update :

I have tried Putty and I get this from NMEA simulator:

{"cmd":"GetInfo", "CheckKey":"016008DAC2FA0AFC361D7DFF251B2028"}▒▒▒▒d9▒▒NMEA2000 simulator GPS1.17.1.3121.17.0.02097151▒▒▒▒d▒▒▒▒▒x▒%▒▒▒▒e9▒▒NMEA2000 simulator Log1.17.1.3121.17.0.02097150▒▒▒▒e▒▒▒▒▒x▒+▒▒▒▒f9▒▒NMEA2000 simulator Wind meter1.17.1.3121.17.0.02097149▒▒▒f▒▒▒▒▒▒▒▒▒▒▒▒g!9▒▒NMEA2000 simulator outside envir1.17.1.3121.17.0.02097148▒▒▒▒g"▒▒▒▒▒▒▒▒▒▒▒▒h%9▒▒NMEA2000 simulator engine1.17.1.3121.17.0.02097147U▒▒▒h&▒▒▒▒▒d▒▒▒▒▒i)9▒▒NMEA2000 simulator fluid level1.17.1.3121.17.0.02097146{▒▒▒i*▒▒▒▒▒▒▒▒
I will also post here the raw document text for those who are not into coding.

Raw instructions:
Testing OpenSkipper with NMEA simulator
You can test OpenSkipper with NMEA simulator. NMEA simulator can send simulated data to COM port. So you need linked COM port pair for testing. This can be done with 2 real COM ports linked with null modem cable or great null modem emulator com0com. Here are instructions for installing all necessary applications without need for any physical COM port for testing.

Download latest com0com http://sourceforge.net/projects/com0...atest/download
Unzip package.
If you have Windows 8/8.1 do first extra procedures on "Disable driver signature enforcement for Windows8" at the end of the page.
Run installalation setup.exe
On installation, untick COM#-COM# selection.
At end of installation choose "Launch Setup" or Start "All Programs"-com0com-Setup.
Now you should see "Virtual Port Pair 0" CNCA0-CNCB0
Check for both CNCA0 and CNCB0 "enable buffer overrun"
Rename CNCA0 -> COMN2KIN and CNCB0 -> COM27 and press Apply.
Download latest NMEA simulator http://kave.fi/Apps/NMEA-Simulator/NMEA-Simulator.zip
Unzip package and start NMEA_Simulator.exe
Goto Tools-Options...
On "NMEA2000 Port" choose from list COMN2KIN and press OK
Tick "Run"-checkbox on middle low.
Download latest OpenSkipper http://www.kave.fi/Apps/OpenSkipper/OpenSkipper.zip Note that official version will be on http://sourceforge.net/projects/openskipper/files/, update may be sometimes delayed.
Unzip package and start OpenSkipper.exe
With default package settings you will get error about missing COM ports. Just pass them with OK.
Choose View-"Data Streams..."-"NMEA 2000 (Actisence NGT-1-USB)".
Choose port COM27 for Main NMEA2000 stream, if it is not already selected.
If stream stated is not "Connected", press Connect.
Now if everything went right, you should see data on OpenSkipper from NMEA simulator. You can e.g. slide throddle up and turn rudder a bit, then your boat start to move and slowly turn. You can see values changing on OpenSkipper displays.

You can test OpenSkipper Web server by enabling it:

First change web server port to 2222 by going to OpenSkipper File-"Settings..." and fill 2222 to "WWW port:" and press OK.
Next goto View-"Web Server...".
If you want to try web pages from any computer within your network, uncheck "Local host only".
Check "Enable Web Server". Open skipper may complain about setting server rights.
Now on same computer open browser and set address to 127.0.0.1:2222
Next you can start to define diplays for OpenSkipper for your own needs. You can also create an other COM port pair on com0com setup and rename them e.g. COMIN-COMOUT (OpenSkipper can only see port names starting with COM) and then use that pair for NMEA0183 data on simulator and OpenSkipper. So in principle you can simulate your own yacht data by configuring related data to simulator and OpenSkipper.

Have fun, but when you go out to the sea, remember to turn OpenSkipper to use real data instead of simulated data!

You can use NMEA simulator for personal use for free. For commercial use, please contact author (see Help-About on NMEA simulator) to support development.

There is no warranty, so use all applications with your own risk.

Timo Lappalainen/10.12.2016

Disable driver signature enforcement for Windows8
Before you can install unsigned drivers like com0com, you have to disable driver signature enforcement. There is video how to do it on

and textual solution on
http://answers.microsoft.com/en-us/w...4-87c7451af222
Below are simple textual instructions.

Goto System settings (Hover mouse upper right corner and choose settings)
Click Power
Hold the shift key while clicking on Restart
Select Troubleshoot > Advanced Options > Startup Settings > Restart
After Restart select option 7.
Now you can run your driver setup program.

In the end, I truly don't want to trim my research project by not doing this part so I am open to any solutions Thanks !
SailThroughUni is offline   Reply With Quote
Old 09-12-2022, 00:45   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,234
Re: How to read NMEA2000 data and display it through OpenCPN or other means

OpenSkipper is dead as you can see from the repository, the right tool to connect to N2K backbone is https://github.com/canboat/canboat
Most of the people nowadays actually use https://github.com/SignalK/signalk-server, which uses https://github.com/SignalK/n2k-signalk for the N2K communication.
OpenCPN itself also has the https://opencpn.org/OpenCPN/plugins/twocan.html

And that most of these things primarily use Linux as the OS has a reason, serial communication on Windows simply sucks.
nohal is offline   Reply With Quote
Old 09-12-2022, 05:03   #3
Registered User
 
CaptTom's Avatar

Join Date: Apr 2004
Location: Southern Maine
Boat: Prairie 36 Coastal Cruiser
Posts: 3,232
Re: How to read NMEA2000 data and display it through OpenCPN or other means

I'm all for open standards, and fully support the idea of Signal K. It's frustrating that NMEA 2000 is proprietary.

That said, I'm not quite ready to agree that "most" people nowadays use Signal K. Certainly those on the cutting edge of DIY, open-source navigation hardware and software prefer it. But the vast majority of boats use off-the-shelf hardware. I have yet to see a name-brand navigation instrument which supports Signal K.

The more common requirement is to get NMEA 2000 data from the existing navigation equipment to use on mobile devices and maybe a machine running something like OpenCPN.
CaptTom is offline   Reply With Quote
Old 09-12-2022, 05:26   #4
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,234
Re: How to read NMEA2000 data and display it through OpenCPN or other means

Quote:
Originally Posted by CaptTom View Post
I'm all for open standards, and fully support the idea of Signal K. It's frustrating that NMEA 2000 is proprietary.

That said, I'm not quite ready to agree that "most" people nowadays use Signal K. Certainly those on the cutting edge of DIY, open-source navigation hardware and software prefer it. But the vast majority of boats use off-the-shelf hardware. I have yet to see a name-brand navigation instrument which supports Signal K.

The more common requirement is to get NMEA 2000 data from the existing navigation equipment to use on mobile devices and maybe a machine running something like OpenCPN.
You are sure right, in pretty much any context but the one of this thread.
nohal is offline   Reply With Quote
Old 09-12-2022, 09:41   #5
Nearly an old salt
 
goboatingnow's Avatar

Join Date: Jun 2009
Location: Lefkas Marina ,Greece
Boat: Bavaria 36
Posts: 22,801
Images: 3
Re: How to read NMEA2000 data and display it through OpenCPN or other means

I think the best solution is digital uschts Wi-Fi can gateway , flexible , robust and comprehensive
__________________
Interested in smart boat technology, networking and all things tech
goboatingnow is offline   Reply With Quote
Old 10-12-2022, 14:29   #6
Registered User

Join Date: Mar 2011
Posts: 724
Re: How to read NMEA2000 data and display it through OpenCPN or other means

FFS, how has this post descended into a diatribe about open standards and commercial NMEA 2000 gateways ?

Let's get back to original question
Quote:
The goal of the project is to spoof a vessel and also build a honeypot.
An admirable project, especially given the lack of security in all of the data sources that are used by navigators today and some of the environmental factors occurring at present (spoofing/jamming of GPS and AIS).

So back to the original question, there are a couple of mechanisms that could be used to artificially represent a vessel.

First of all using NMEA 183.

1. Replay an exisiting NMEA 183 log file either via the Voyage Data Recorder (VDR) plugin or by transmitting over an OpenCPN network connection (UDP or TCP) or virtual serial port (such as com0com that the OP has previously mentioned)
2. Use the Ship Driver plugin to mimic a vessel.

As NMEA 183 is a simple text format, and the data format is well documented it is easy to manually craft your own NMEA 183 sentences.

With NMEA 2000 it is a little more difficult as NMEA 2000 messages are in a binary format and not as well or widely understood as NMEA 183.

The options available for NMEA 2000 are similar to above.

1. Replay an exisiting NMEA 2000 log file over a physical or virtual CAN bus. A virtual CAN bus is most easily configured on Linux (VCAN) and existing log files are replayed using the canplay utility. Note that the current alpha release of OpenCPN supprts NMEA 2000 natively.
2. Replay an exisiting NMEA 2000 log file in any of the formats supported by either SignalK Server or TwoCan plugin.
3. Replay and convert an existing NMEA 183 log file into NMEA 2000 using either SignalK Server or the TwoCan plugin.
4. Use the NMEA Simulator that the OP previously mentioned to generate NMEA 2000 traffic. Note that the freely available NMEA Simulator only supports the Actisense NGT-1 adapter & data format, so the three options that could be used to transmit the generated NMEA 2000 traffic to OpenCPN are:
a. Setup a CAN Bus with two computers, two Actisense NGT01 adapters with one computer running the NMEA Simulator and the second running either the alpha version of OpenCPN (which supports the Actisense NGT-1) or SignalK Server.
b. Setup a CAN Bus with two computers, with one computer running the NMEA Simulator and an Actisense NGT-1 and the second running either the alpha version of OpenCPN on Linux (which supports any socketCAN adapter) or the TwoCan plugin or SignalK Server with any of their supported adapters.
c. Setup a virtual connection using com0com with NMEA simulator feeding Actisense traffic on one end, and either the alpha version of OpenCPN or SignalK Server on the other listening to the other half of the virtual com port.

Or if the OP is a skilled programmer, they could create their own NMEA 2000 simulator and generate their own NMEA 2000 traffic. These days there is enough freely available information & source code on NMEA 2000 (OpenCPN, Timo's libraries, canboat, signalk server, twocan plugin) to enable this.

To understand the physical network (Can Bus) used by NMEA 2000 the OP should avail themselves of the NMEA 2000 documentation published by vendors such as Actisense, Maretron, Garmin, Navico, Raymarine etc.
stevead is offline   Reply With Quote
Old 12-12-2022, 02:18   #7
Registered User

Join Date: Jan 2010
Location: Harlingen, NL
Boat: KMY Stadtship 56
Posts: 517
Re: How to read NMEA2000 data and display it through OpenCPN or other means

I'd even go so far as to say that the OP has NMEA 0183 and 2000 mixed up?

In any case, as @stevead suggested already, emulating NMEA 0183 is a much easier project and the "natural" way to converse with an AIS.


Maybe the OP should go back to explaining in more detail what sort of faking he wants to accomplish, then we can give technical advise on how to go about it.
merrimac is offline   Reply With Quote
Old 13-12-2022, 15:30   #8
Registered User

Join Date: Mar 2011
Posts: 724
Re: How to read NMEA2000 data and display it through OpenCPN or other means

While emulating NMEA 183 is a little easier than NMEA 2000 I would love to see a well researched academic publication covering the security limitations of NMEA 2000.

Taking traditional IT Security concepts such as Confidentiality, Integrity and Availability (CIA) and applying those to marine navigation systems highlights the fact that the tools we use today are inherently insecure.

Once a miscreant can gain access to the NMEA 2000 network, all bets are off. An attacker can run a simple Denial of Service attack, transmit whatever data they wish, mimic any other device, upload or download route & waypoint information etc.

And without more detailed analysis, given that most Chartplotters support some form of Internet access, who knows what remote vulnerabilities can be exploited.
stevead is offline   Reply With Quote
Old 23-01-2023, 13:47   #9
Registered User

Join Date: Nov 2021
Posts: 21
Re: How to read NMEA2000 data and display it through OpenCPN or other means

NMEA 2000 to NMEA 0183 is what you need. There are a few of similar devices in the market. My boat have Quark A034, it works well.
https://www.quark-elec.com/product/q...-wifi-outputs/
ChristianV is offline   Reply With Quote
Reply

Tags
enc, nmea, opencpn


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
B&G Wifi GoFree, remote control autopilot via Ipad and Apps with NMEA2000 data CaptainRivet Marine Electronics 3 17-02-2022 03:00
Repeater for NMEA2000 and 0183 data. Draughty Marine Electronics 3 20-12-2018 22:36
nmea2000, nmea0183, ST and WIFI for openCPN? blubaju OpenCPN 3 13-03-2015 01:03
Wireless NMEA2000 Data in to OpenCPN Paul_DY OpenCPN 28 10-05-2014 16:52
Will garmin NMEA2000 GPS work with other brand plotters? dennisail Marine Electronics 50 23-03-2014 16:59

Advertise Here


All times are GMT -7. The time now is 17:43.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.