Linux at sea

Playtime

Well-Known Member
Joined
29 Jan 2007
Messages
1,194
Location
Chichester
Visit site
For a dozen or more years I have used a laptop on board for passage planning, real-time nav (back-up) and passage logging (plus all the usual laptop stuff in port). Currently I'm using Windows on a rather slow old HP system and am getting increasingly frustrated with Win10 - constant updates, slow response on the aging hardware etc.

I have dual boot with Linux (Ubuntu MATE) on the laptop and have been seriously considering abandoning Windows completely in favour of Linux. The problem holding me back has been OpenCPN, or rather the lack of up to date, legal charts that will run on it in Linux. This year, with the availability of reasonably priced Admiralty vector charts for OpenCPN that will run under Linux (see http://o-charts.org), the main problem has been solved. However, there are now a couple of secondary problems that I would appreciate help in solving.

There are 3 NMEA 0183 input streams to the laptop (instruments (converted from NMEA 2000 by an Actisense NGW1), AIS and Navtex) that I want to continue using. The instruments and AIS data currently feed into NavMonPC which not only displays and logs the data but also multiplexes it into a TCP/IP stream for OpenCPN. Navtex is passed straight to the NASA PC Pro Display programme.

So, (finally) my questions -

1. Are there any recommended Linux programmes that can replace NavMonPC for display, logging and multiplexing/virtual porting of the instruments and AIS data streams?

2. Is there a Linux programme that will handle the NASA Navtex Engine (both control and data display)?

Thanks.
 
So, (finally) my questions -

1. Are there any recommended Linux programmes that can replace NavMonPC for display, logging and multiplexing/virtual porting of the instruments and AIS data streams?

2. Is there a Linux programme that will handle the NASA Navtex Engine (both control and data display)?

Thanks.

Yes and yes. :cool:
Node red can do the job of dozens of separate programs and is easy to get going.
https://nodered.org/docs/getting-started/installation

For multiplexing some options, - Use opencpn then make an output for logging/display, Kplex, petty much the industry standard written by our very own ubercoder Laika, or maybe do it in node-red. Haven't tried node red but should work. Opencpn would be easiest to set up.

Node-red is wonderful, written by IBM for in house work and generously given free to the world, runs on most machines - basically takes any input you can think of, lets you fiddle with it massively or not at all then sends the result to any output you can think of.

On a raspberry Pi I record everything to a database through node-red but send AIS to a file ->
ku4pgno.png


Plus you can create dashboard to display anything which are published as web pages for any device on the same network to view, if it's just a standalone laptop not connected to a wifi network then this might need some fiddling to get working, laptop would need to create a network.

Same for Navtex - see here ->
http://www.ybw.com/forums/showthread.php?460824-Navtex-from-HF-to-wifi&p=6243287#post6243287

My Nasa data gets saved to a file as soon as it comes in, works great. You can make buttons easy to send the vrious commands. I've a old engine so can only dump the entire memory. Messages get sent over serial as soon as they come in.
 
Thanks GHA. I've not come across node-red before but I've already got it running and outputting a formatted timestamp (following the tutorial!). I haven't done any programming for at least 35 years (last used language was real-time Coral on a Ferranti Argus 700S) so I have a pretty steep learning curve here but I can immediately see it's a powerful tool. I'll also have a look at kplex (but see next para.)

I wasn't aware you could use OpenCPN as a mux. However, having just looked at the latest manual it states "[FONT=&quot]Virtually unlimited input port multiplexing, with shared I/O and individual data rate settings" so it looks as though Question 1 above is easily solved[/FONT]. I will try to input the 2 data streams (instruments @9.6kbs and AIS @38.4kbs) next time I'm on the boat to confirm. As you suggest I can also use OpenCPN Dashboard to display the instrument data and set up a separate logfile to record the data for later review. Obviously not as simple as the graphs in NavMonPC but I may be able to cobble something together.

Regarding Navtex, can you expand a little on how you control the Navtex Engine, please (e.g. to set up the Channel times, or dump the internal memory). The NASA PC programme is a bit crude but it does at least work.

If there are any other off-the-shelf Linux programmes that might help, please let me know.
 
Straight in there with node-red , Cool!

Graphing in node-red is actually pretty easy, there are chart nodes in the dashboard.

For navtex I use this, if you copy the code below, open up node-red, press 'control i' to open up the insert box, 'control v' to insert the code then OK you'll see my bits. You'll no doubt need to change the serial node and file storage location, maybe import some nodes if they aren't there. In the menu bar top right there's a manage palette option then an install tab in there with a search box, dead easy to install any nodes which are missing.

Basically it just listens to the serial port, if anything comes in it saves it with a time stamp to navtex.txt and without a timestamp to navtex2,txt.
For full memory dump it, when you press the inject node it sends '$S' to the serial port then the engine sends everything back. I had to put a few line feeds/carraige returns in to get it to work so it actually sends '0x0D 0x0A $S 0x0D 0x0A 0x0D 0x0A'.

I had a quick play with opencpn earlier, couldn't get TCP to work but if you set an output to UDP 127.0.0.1, port 10119 , node read should read it with a UDP input node, then put it in a file or whatever, I might have some NMEA filters saved somewhere though I use mostly signalk on Openplotter in the raspberry pi, easier to parse the messages.

Ah, found one - this filters just AIS messages which get saved in a file.
nUizqc9.png



And a graph of engine temperature in node-red -
hMXnQtf.png
 
Hi again, just came across this one stashed away in evernote - creates a random MWV windspeed NMEA message every 2 seconds, if you have Opencpn running on the same machine as node-red and set up an input connection UDP 127.0.0.1 port 10108 you just see a very gusty day in an opencpn dashboard showing app. wind speed. :)

Code:
[COLOR=#000000][[/COLOR]    {
        "id": "12dfa652.41d6aa",
        "type": "inject",
        "z": "1febfe0b.5f6be2",
        "name": "",
        "topic": "first",
        "payload": "My first flow",
        "payloadType": "str",
        "repeat": "2",
        "crontab": "",
        "once": false,
        "x": 150,
        "y": 160,
        "wires": [
            [
                "6152a454.63eb8c"
            ]
        ]
    },
    {
        "id": "6152a454.63eb8c",
        "type": "function",
        "z": "1febfe0b.5f6be2",
        "name": "Make MWV nmea sentence",
        "func": " //      1   2 3   4 5\n //       |   | |   | |\n //$--MWV,x.x,a,x.x,a*hh<CR><LF>\n//Field Number:\n\n//1.Wind Angle, 0 to 360 degrees\n\n//2.Reference, R = Relative, T = True\n\n//3.Wind Speed\n\n//4.Wind Speed Units, K/M/N\n\n//5.Status, A = Data Valid\n\n\nvar random = Math.floor((Math.random() * 100) + 1);\n\nvar nmea=\"NRMWV,179,R,\" + random + \",N,A\";\n\n\n\n\nmsg.payload = nmea;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 340,
        "y": 260,
        "wires": [
            [
                "a502b1b2.3fadd"
            ]
        ]
    },
    {
        "id": "a502b1b2.3fadd",
        "type": "function",
        "z": "1febfe0b.5f6be2",
        "name": "calc checksum",
        "func": "var nmea = msg.payload;\nvar checksum = 0; \n\nfor(var i = 0; i < nmea.length; i++) { \n  checksum = checksum ^ nmea.charCodeAt(i); \n}\nchecksum = checksum.toString(16);    //convert to hex\nnmea = '$' + nmea + '*' + checksum;  //make the full nmea sentence again\n\nmessage = 'Full message =' + nmea + '\\r\\n' + 'Checksum = ' + checksum ;\n\nmsg.payload = nmea;\nmsg.payload = msg.payload+\"\\r\\n\"\n\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 460,
        "y": 160,
        "wires": [
            [
                "e1d4dae2.f67ef8",
                "28e709ba.9c6476"
            ]
        ]
    },
    {
        "id": "e1d4dae2.f67ef8",
        "type": "udp out",
        "z": "1febfe0b.5f6be2",
        "name": "",
        "addr": "127.0.0.1",
        "iface": "",
        "port": "10108",
        "ipv": "udp4",
        "outport": "",
        "base64": false,
        "multicast": "false",
        "x": 692.9999694824219,
        "y": 143.0000352859497,
        "wires": []
    },
    {
        "id": "28e709ba.9c6476",
        "type": "debug",
        "z": "1febfe0b.5f6be2",
        "name": "",
        "active": true,
        "console": "false",
        "complete": "true",
        "x": 610,
        "y": 80,
        "wires": []
    } [COLOR=#000000]][/COLOR]
 
Thanks. You are being very helpful. I need to get down to the boat now and try some of this out. I think it will be some time before I'm writing my own complex functions, though. A good project for the winter! Might even get a Raspberry Pi to play with.
 
Last edited:
I have another question regarding navtex.
You have given some useful pointers for how to get the data out of the NASA Navtex engine but haven't mentioned channel timing. My engine has 2 channels but can only listen on one at once. You can set up the times it listens on each channel using the NASA programme and can then get all outputs for, say, Niton, on both channels.
I will need to be able to do this on the Linux set-up.
Do you recognise the problem and have any thoughts on a solution?
 
Thanks. You are being very helpful. I need to get down to the boat now and try some of this out. I think it will be some time before I'm writing my own complex functions, though. A good project for the winter! Might even get a Raspberry Pi to play with!

Get a Pi for sure!! Sensors are so cheap, barometer-voltage-temperature, openplotter is better than any kind of bread preparation :)
 
I have another question regarding navtex.
You have given some useful pointers for how to get the data out of the NASA Navtex engine but haven't mentioned channel timing. My engine has 2 channels but can only listen on one at once. You can set up the times it listens on each channel using the NASA programme and can then get all outputs for, say, Niton, on both channels.
I will need to be able to do this on the Linux set-up.
Do you recognise the problem and have any thoughts on a solution?

From the manual looks like you should be able to do that just by sending messages out of node red -

I just sent this from an inject node to lock to channel A and it came back with 'OK' so seems to work.

"0x0D 0x0A $A 0x0D 0x0A 0x0D 0x0A $C, hhmm 0x0D 0x0A 0x0D 0x0A"

The '0x0D 0x0A' is hexadecimal for '<CR><LF>' carriage return & linefeed as you no doubt know, seems to work anyway.



NASA NAVTEX PRO Engine USB The NASA NAVTEX Engine Pro uses a similar technique as the NASA AIS to read out the
data content and or to store the channel selection via a serial link (COM) at a baud rate of
38400, 8 bits, 1 start bit, no parity and 1 stop bit. For modern computers a serial to USB
adapter is required and a simple prolific kind of adapter is shipped with the NAVTEX
receiver. All commands must be preceded and followed by a carriage return and line feed
<CR><LF>.
Reading Data and Clear all Messages
The features of the NAVTEX are basically very simple. The NAVTEX accepts the following
commands:
• Poll for messages use:
<CR><LF>$S<CR><LF>
• Clear all messages and reset factory defaults use:
<CR><LF>$W<CR><LF>
• Poll for engine version use:
<CR><LF>$V<CR><LF>
Set Channel Data
To set the channel selector to either channel A or B the NAVTEX uses two different ways to
operate:
• Select a channel and lock it to the selection
• Select a channel by switching using two preset moments per channel
Set a locked Channel
To set e.g. the channel selection locked at channel A at 518 kHz use:
<CR><LF>$A<CR><LF>
<CR><LF>$C,hhmm<CR><LF>
To set e.g. the channel selection locked at channel B at 490 kHz use:
<CR><LF>$B<CR><LF>
<CR><LF>$C,hhmm<CR><LF>
In which hhmm represents the current time in hours and minutes when sending the data.
Set a switching channel mode
Consider an example in which switching between channel A and B at the specified
moments of the day is required:
channel 1
st
time 2
nd
time
switch [hhmm] switch [hhmm]
A 0102 0304
B 0506 0708
The required syntax to set these values is:
<CR><LF>$A,0102,0304<CR><LF>
<CR><LF>$B,0506,0708<CR><LF>
<CR><LF>$C,hhmm<CR><LF>
In which hhmm represents the current time in hours and minutes when sending the data.
 
Might even get a Raspberry Pi to play with.

If you do use a RPi make sure you get a good power supply to it. I think I destroyed mine by too low a voltage thru' a cheap, Chinese 12v to USB converter. (laptop to the rescue).

GHA was very helpful in helping me set up mine too. My last coding (apart from copy and paste some php) was with BASIC on a teleprinter terminal at school. And we knew more than the teachers! So I think you'll be ok. There are lots of support forums out there. The only thing I couldn't get to work was the AIS dongle.

Incidentally, I find that my old Thinkpad, completely shut off from the world, and with no protection software etc, running on XP, works well (dedicated) with Open CPN and VMH charts at about the same power takeup as the RPi. The difference is that I have to wake the laptop up but that only takes a few seconds.
 
I hope this thread isn't going to die - it's of great interest to me. Over on the motorboat forum a number of people are experimenting with Linux for boat PCs, with additional motivation due to Windows 10.

My contribution is unfortunately a negative which is that I asked Visit My Harbour (of which I am a paid member) whether there is any way of running their raster charts on Linux, and the answer is No. Therefore the OP's reference to Admiralty charts is very relevant. Has anyone actually bought the S63 licence from O-Charts, bought an Admiralty vector chart, and successfully run it in OpenCPN with Linux as the OS?

I agree the Admiralty S63 vector charts seem reasonably priced, but no way are they as cheap as the VMH chart stick. Probably doesn't matter for people who cruise in a fairly tight area but for anyone who wanders around all over the UK the cost of buying individual raster charts soon adds up.
 
I hope this thread isn't going to die - it's of great interest to me. Over on the motorboat forum a number of people are experimenting with Linux for boat PCs, with additional motivation due to Windows 10.

My contribution is unfortunately a negative which is that I asked Visit My Harbour (of which I am a paid member) whether there is any way of running their raster charts on Linux, and the answer is No. Therefore the OP's reference to Admiralty charts is very relevant. Has anyone actually bought the S63 licence from O-Charts, bought an Admiralty vector chart, and successfully run it in OpenCPN with Linux as the OS?

I agree the Admiralty S63 vector charts seem reasonably priced, but no way are they as cheap as the VMH chart stick. Probably doesn't matter for people who cruise in a fairly tight area but for anyone who wanders around all over the UK the cost of buying individual raster charts soon adds up.

Not s63 but I've bought oeSENC charts which ran fine on opencpn on a raspberry pi.
http://o-charts.org/shop/index.php?id_category=8&controller=category&id_lang=4

22,20 € for UK waters with a years updates.
 
I have run the O-Charts (Admiralty vector) on my old Windows laptop. They work OK but the whole system was grinding exceeding slow, hence my interest in Linux. I have no reason to believe that they won't run in Linux but can't check this without buying a new licence; my current licence only works with the Win10 laptop.

Regarding RPi3 - it's on my Christmas list for Santa so I may have more to report in the new year. I have managed to get AIS and instruments running on Linux (on the laptop) with OpenCPN, which is progress but haven't experimented further with NodeRed yet.
 
Last edited:
Not s63 but I've bought oeSENC charts which ran fine on opencpn on a raspberry pi.
http://o-charts.org/shop/index.php?id_category=8&controller=category&id_lang=4 22,20 € for UK waters with a years updates.
Hope you don't think I'm splitting hairs - that's a vector chart you are linking to.
I am looking for raster charts that will run in OpenCPN on Linux.
I've nothing against vector charts. My plan is to have two screens, one displaying vector and the other raster charts.
Hurricane from the Motorboat forum has raster charts for OpenCPN running on Linux, but the charts are not up to date and as already mentioned the VMH raster stick won't run on Linux.
 
Hope you don't think I'm splitting hairs - that's a vector chart you are linking to.
I am looking for raster charts that will run in OpenCPN on Linux.
I've nothing against vector charts. My plan is to have two screens, one displaying vector and the other raster charts.
Hurricane from the Motorboat forum has raster charts for OpenCPN running on Linux, but the charts are not up to date and as already mentioned the VMH raster stick won't run on Linux.

Ah, sorry , missed the bit about raster. Never really used them. Slight thread drift but google map satellite images can be really useful as well, easily created the https://www.venturefarther.com/ website or plugin.
I haven't come across any raster charts for linux on opencpn.

There is a convoluted way to create raster images from the google earth links on the VMH site using GE2KAP, but a bit long winded for anything more than a small area.

RLxNlAU.png
 
TwoHooter has just emailed me about this thread.
I am one of the people over on the Motorboat Forum who is going through this Windows to Linux process at the moment.
He and I have spent a good few hours working on a suitable Windows replacement.

I posted a fun thread earlier this year - using Raspberry Pi as a plotter etc.
http://www.ybw.com/forums/showthread.php?475608-A-challenge-to-make-a-cheap-plotter-for-under-%A360
Although it works, as a pure plotter, the RPi isn't really fast enough.
However as interfacing hardware, I'm sure it would be most appropriate.

I have to declare that I'm not really interested in Navtex - I have an old NASA Navtex engine that I used 9/10 years ago when we first commissioned our boat but I removed it about 5 years ago - it is somewhere in my box of bits.
Being a mobo, we are mostly near to 3/4G data services so anything Navtex could offer has really been superseded.

That said, I am a firm believer in the "ships PC".
To date that has always been a Windows PC - initially running Memory Map software but over the last 5 or 6 years, OpenCPN has been terrific.
OpenCPN's AIS display is "second to none".

Our boat is a Princess 67 flybridge motor boat.
The nav system consists of a Raymarine G Series Glass bridge network.
4 monitors - 2 at each helm station.
The main nav is Raymarine using Navionics charts but each of the monitors can switch to a number of different video feeds at the single press of a button.
One such button displays the video output of the ship's PC.
On longer passages, we run both the Raymarine and the PC (OpenCPN) at the same time - usually Raymarine on one screen and OpenCPN on the other.
There are 3 GPS receivers feeding into the system so, having two independent systems backing each other up allows us to "fiddle" with one whilst leaving the other "navigating".
The 3rd GPS is fed to a "logging" program that "speaks" SOG, COG, LON, LAT and time etc every half hour - we decided not to have a print out of this data as it instils a discipline on the helm - the crew on watch have to write down the data that is "spoken" from the PC. I wrote this logging system as a bit of a laugh but it has become a serious addition to our longer passages.

I georeference my own charts.
The Navionics charts under Raymarine form my main nav system so my own "self generated" charts are in addition and not so critical.
That said, I have managed to create very accurate charts.
I now have over 2000 charts that I've acquired or self generated over the years.
If anyone is interested, I can document the georeferencing process.

Now to the OP's point.
I don't want to upgrade any of my PC systems to W10.
I have friends who have had problems with W10 that would be completely unacceptable if they happened on my ships PC.
To date, I have stuck firmly with W7 but about 2 years ago, I set myself the task of finding a W7 replacement within 4 years.
That means I am now halfway through my search/research.
I really want a system that has all the "feel" of W7 but will continue to be developed (new hardware as it comes up etc)
There are three of us in Sant Carles (our marina in the Med) with the same aims and with similar PCs.
At the moment, we are moving in the Linux Mint XFCE direction.
For those who don't know, XFCE is one of the Mint project's desktop GUI options - Mint is a fork from Ubuntu and Ubuntu is a fork from Debian - etc.
This Linux Mint with the XFCE GUI has a very good Windows feel to it and with a few bespoke changes, I have got it where I want it.
I didn't like XFCE's file manager (Thunar) but the Mint Cinnamon file manager (Nemo) works well for me.
OpenCPN just works - all my charts work - the Actisense interfaces (NMEA to USB) work.
I even have my "talking" logger running under Wine.
So there is no reason why we shouldn't UPGRADE to Linux.
In fact 2 of the three of us in Sant Carles are doing just that.
I'm being a little more cautious time is "marching on" - maybe another winter of testing during the cold evenings will do it for me.
That said, I will be converting my home server to Linux very soon.
And I already have an Linux computer dedicated as an internet server on the outside of my LAN.
 
I don't know enough, to give advice; but I do know I have Seaclear running on my little Asus laptop under Linux, with CM93 charts. I have my Garmin GPS72 connected, as well as a Navman B10 Bluetooth GPS. I took me ages to get it all working, but it does all work just fine.

snapshot8.png
 
Last edited:
I've got OpenCPN with the oeSENC charts for British Isles and France Atlantic on ubuntu 16.04 on a Dell xps13. TBH I don't use it for navigation: I do that with paper charts and pencils. I have openCPN for occasional bits of hacking and frankly was bored of looking at the base map. It seems to work fine.

Note of course that there's plenty of things you might still want windows for. The electronic version of Reeds used to run on Adobe air (does it still?) which was briefly supported on linux but never really worked (and then adobe dropped linux support). The chart updater for navionics cards for plotters only used to work on mac or windows. The software for configuring SRT-based AIS units used to be windows only (but looked simple enough for wine). I wouldn't be surprised if there was plenty of configuration software for marine devices which is windows-only
 
I wouldn't be surprised if there was plenty of configuration software for marine devices which is windows-only
I think that's right. But when you look at how much progress has been made with OpenCPN, and how well it continues to be developed and supported, and how well it works in Linux, it's easy to hope that as time goes by more things will be incorporated either by having an OpenCPN equivalent or by running them in WINE. And if a boat's PC is running Linux it doesn't cost much to have a laptop or a tablet for the things that Linux can't handle. I personally think there will be progress because Windows10 is causing problems for so many people.
 
Top