Cruisers Forum
 


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 10-03-2020, 11:10   #1
Registered User

Join Date: Mar 2020
Posts: 9
AIS from OpenCPN to Navionics

I've been struggling with this for a few days now, and I think I'm missing something obvious so hopefully, someone can help me.


  • I have OpenCPN installed on a Raspberry Pi (4) - works fine
  • For testing - I have added an AIS feed from Sanfrancisco Bay Area as an input Connection to OpenCPN: works fine and the targets show up on the map
  • My iPad connects to a wireless access point on the RPI. I know that works as well as I can connect to there RPI's IP, port 3000 and I see the Signal K Server home page - so that works fine as well.

My questions:


  • I'm trying to get these AIS targets to show in Navionics in my iPad. I believe I should use <RPI-IP>:10110 for that that doesn't work as there doesn't seem to be anything broadcasting on port 10110. Even "Localhost:10110" on the RPI doesn't work.

  • What roles does Signal K play in this context / should this AIS feed come through Signal K instead?

  • What do I need to configure in OpenCPN so any device can connect to it and read this AIS data (so I can configure navionics on that IP Address / Port)


I'm using the OpenPlotter setup, but I don't believe that's relevant in this scenario. The people on the OpenPlotter forum have been very helpful, but we seem to be stuck on this one. Thanks in advance.
DoubleDutch1962 is offline   Reply With Quote
Old 10-03-2020, 11:16   #2
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: AIS from OpenCPN to Navionics

It depends on whether Navionics expects UDP or TCP connection. If TCP then use IP address of 0.0.0.0 in OpenCPN. Set port number to whatever Navionics expects. You think it is 10110 but you need to be certain of the number.

In Navionics give it the IP address of the RPi. The Navionics will initiate the connection and it will negotiate the connection with OpenCPN and start getting data.
transmitterdan is offline   Reply With Quote
Old 10-03-2020, 15:04   #3
Registered User

Join Date: Mar 2020
Posts: 9
Re: AIS from OpenCPN to Navionics

Thanks that got me some of the way there and the two systems are now talking to eachother but:
  • I configured a port on my RPI-4
    • Protocol: TCP
    • Address 0.0.0.0
    • Port 2002
    • Priority 1
    • Control Checksum "on"
    • Output on this port On
    • Talker ID EA
    • APB Bearing precision: x.xxx
  • On my iPad I configured this port the same in Navionics
  • I start OpenCPN on the RPI
  • I start Navionics and: OpenCPN on the RPI dies! I can replicate this and I looked in the log file on the RPI and besides the below - no errors.
    • "can not set local 'en_US' there is nothing of note and the last message is "TCP Datastream connection established: TCP: localhost:10110"
    • "GPS Watchdog Timeout at.."
I then configured OpenCPN on another Mac, connected to the same Raspberry PI instance and exactly the same happens. OpenCPN starts on the Mac, I assume it tries to connect to the RPI and then OpenCPN on the RPI dies.

Any thoughts?
DoubleDutch1962 is offline   Reply With Quote
Old 10-03-2020, 15:29   #4
Registered User
 
pinguino's Avatar

Join Date: May 2009
Location: SE Spain
Boat: Jeanneau SO 32I
Posts: 125
Re: AIS from OpenCPN to Navionics

I assume that you use openplotter and therefore the IP will be the one that assigns the default AP in such cases: 10.10.10.x.

You can use two methods.

The first one is to install in signal k the plugin called:

signalk/udp-nmea-plugin

With this configuration it works perfectly with navionics.




The second option is to use the kplex multiplexer that has just been added to the available openplotter applications. A connection like this must be configured:


In both cases it works the same, detected as a DigitalYacht WLN10. We must send the NMEA 0183 data by the broadcast address 10.10.10.255 and in the port 2000. Navionics will automatically find them. In my case the AIS and bathymetry work. I have been using it for a couple of years. I already explained it some time ago in our spanish forum which is also about openplotter and opencpn. foronavegantes.net

https://foronavegantes.net/thread-4.html
pinguino is offline   Reply With Quote
Old 11-03-2020, 12:02   #5
Registered User

Join Date: Mar 2020
Posts: 9
Re: AIS from OpenCPN to Navionics

Thank you and I will try that approach. But as I understand it - with this approach I need to move some data input away from OpenCPN to either Signal K or OpenPlotter “serial”? I have 3 at the moment (connected to OpenCPN) where / how / should I reconfigure those?

- DVB Tuner for AIS
- San Francisco AIS
- USB GPS Dongle

I guess that if I leave those connections in OPenCPN, Navionics won’t see them?
DoubleDutch1962 is offline   Reply With Quote
Old 11-03-2020, 13:53   #6
Registered User
 
pinguino's Avatar

Join Date: May 2009
Location: SE Spain
Boat: Jeanneau SO 32I
Posts: 125
Re: AIS from OpenCPN to Navionics

Right. The correct approach when using openplotter is to have kplex or Signal K take care of collecting all the NMEA data and distribute it to the rest of the applications and devices through the network or by serial connections.

If you are using opencpn to do this job you are missing some of the advantages of openplotter, but you can do it and it will work too.

Simply create an outbound connection on opencpn UDP type connection address 10.10.10.255 and port 2000.

If instead of using the connection of the openplotter AP we are using another one -an AP created with our mobile phone for example- we should use the ip range of that network by changing the last one to 255.
In Android it is quite common to use the range 192.168.43.x so we would use 192.168.43.255.

Also:
When handling NMEA data, always keep in mind the binomial:

origin-----> destination

For example, if you use opencpn to handle NMEA data you read it with input connections - either network or physical - and send it with output connections - either network or physical.

It is also crucial not to create loops in the connections that send the same data in a cyclic way and that would end up hanging up the system.

For example, using Signal K we would create input connections for the AIS and GPS and signal K sends it all by default in TCP to localhost:10110, unless we use the plugin I told you in the previous message that does it in UDP and port 2000.

Now we would need an opencpn input connection on localhost:10110 for opencpn to read the data collected by signal k.

Any other device on the same network can read the data at IPRaspberry:10110 normally 10.10.10.1 port 10110.
pinguino is offline   Reply With Quote
Old 11-03-2020, 16:59   #7
Registered User

Join Date: Mar 2020
Posts: 9
Re: AIS from OpenCPN to Navionics

Thank you for your detailed reply!


I decided to re-install my RPI with OpenPlotter and take your suggested Signal K route and I now have a configuration where using a sample stream, I can see data go from Signal-K to OpenCPN on the same device. I've never got that far!


I tried various ways (Connections / Plugins) to get this data



http://ais.exploratorium.edu/

in to Signal-K (as I'm trying this on-land so getting AIS data is tricky :-)) but I can't get that to work. Tomorrow I will try to get my GPS receiver connected into Signal-K so hopefully that will work and then maybe play with a simulator to try to create more data and add move devices.


Thanks you so much for you help. Could not have done it without you!
DoubleDutch1962 is offline   Reply With Quote
Old 12-03-2020, 00:25   #8
Registered User
 
pinguino's Avatar

Join Date: May 2009
Location: SE Spain
Boat: Jeanneau SO 32I
Posts: 125
Re: AIS from OpenCPN to Navionics

Keep a couple more things in mind.
The openplotter-serial app has as its main function to assign aliases to the physical devices so that later we can work better with them. It also has the function of being able to create those connections in signal k or kplex. However, once the aliases are assigned to the serial devices, we can also create those connections by hand.

In general it is a good idea to familiarize yourself with how connections work so that you can create them by hand and modify them exactly as you want.

In my opinion the main obstacle of openplotter and signal k is the lack of documentation. There are things that if you don't know them previously can drive you crazy.

For example:

-Signal k sends the default NMEA 0183 data in TCP to port 10110.

-It is unintuitive to create physical output connections on signal k and quite complicated to create network output connections except by using specifically designed plugins.

-There are often several ways to do the same thing in openplotter and that is confusing to many people. For example we can create input connections in Signal k, kplex and opencpn but depending on what we want to do it is better to choose the right option. It also generates confusion when others share their how-to as it is not always the most suitable for our case. That's what I think happened to you on openmarine where the difference of languages of each one still adds a little more confusion to the subject.

With time the missing chapters of the openplotter documentation will be completed -some are already being written- while the best thing is to experiment and ask in the forums when we have doubts... and cross our fingers, a little.
pinguino is offline   Reply With Quote
Old 12-03-2020, 04:40   #9
Registered User

Join Date: Mar 2020
Posts: 9
Re: AIS from OpenCPN to Navionics

I agree. I'm actually quite technical (IT Industry for 30 years and ports and sockets don't scare me :-)) but the overal picture of what should talk to what without having any knowledge of Signal K and OpenCPN before I started this project is very very complicated with conflicted guidance and empty and conflicting documentation. E.g. the bit of openplotter documentation that exists refers to a single setup program which as we all know doesn't exist anymore.

I would actually be happy to help create that documentation as I think it's a great and fun project. I may try to get in touch with the people behind it to offer that.

About your last post:
  • I don't understand "once the aliases are assigned to serial devices we can also create connections by hand". Can you clarify what / when I would use that?
  • "How connections work" - yes that has been my main challenge. I was happily configuring stuff in OpenCPN and clearly that's a mistake (except for this San Francisco AIS stream which I can't get to work any other way I think)
  • I would love you hear your advice on how you determine "we can create input connections in Signal k, kplex and opencpn but depending on what we want to do it is better to choose the right option" - I have so far totally ignored kplex as I don't know what it's use case is but if I need to know about that a well - I better start finding that manual :-)
  • Another missing topic for me is "CAN Bus" - when do I need that?
I actually don't have a boat yet (in the process of buying a sailing yacht) so just playing with this stuff at home in anticipation. Great fun, I can think of many DIY sensors (I do a bit of electronics as well) but the lack of documentation makes it more challenging. But anyway: we pursevere and again your help has been invaluable.
DoubleDutch1962 is offline   Reply With Quote
Old 12-03-2020, 05:37   #10
Registered User
 
Benjamins's Avatar

Join Date: Dec 2019
Location: Netherlands (traveling around)
Boat: Lunstroo Marwin
Posts: 17
Re: AIS from OpenCPN to Navionics

I am using I sailor on my ipad. The charts are cheap and all the add ins work easy. like AIS weather current and pilot guides. The manual is amazingly detailed. The are using Wartsila / Transas charts.
__________________
----- The adventure of your life!----
Benjamins is offline   Reply With Quote
Old 12-03-2020, 06:20   #11
Registered User

Join Date: Mar 2020
Posts: 9
Re: AIS from OpenCPN to Navionics

I've got another strange issue. When I connect > 1 (external) device to the Signal-K UDP server: the RPI's WLAN system dies.


Has anyone seen that before?
DoubleDutch1962 is offline   Reply With Quote
Old 12-03-2020, 06:50   #12
Registered User
 
pinguino's Avatar

Join Date: May 2009
Location: SE Spain
Boat: Jeanneau SO 32I
Posts: 125
Re: AIS from OpenCPN to Navionics

Quote:
Originally Posted by DoubleDutch1962 View Post
[*]I don't understand "once the aliases are assigned to serial devices we can also create connections by hand". Can you clarify what / when I would use that?
Alias:
Normally when we connect a serial device on Linux it is displayed on the system as /dev/ttyS0 if it is the first /dev/ttys1 if it is the second Etc. Nowadays as they are usually USB-serial converters they are shown as /dev/ttyUSB0 etc.

The problem arises when we have more than one serial device connected, for example one for GPS and another for AIS. Normally GPS devices work at 4800 bauds while AIS devices work at 38400 bauds. Where can the problem arise? When the system starts, the ttyUSB0 and ttyUSB1 ports can be randomly assigned to any of the two devices. If they coincide in the correct mode everything will be fine but if they are assigned the wrong way we will have neither AIS nor GPS data. That's why we thought of using aliases. We can assign an alias for each device so that no matter in which order they fall when we start the system we will always have them well located. For example we'll assign GPS the alias ttyOP_gps and AIS ttyOP_ais and create our connections using those aliases instead of their hardware names. That way they'll always be available without error.
pinguino is offline   Reply With Quote
Old 12-03-2020, 07:10   #13
Registered User
 
pinguino's Avatar

Join Date: May 2009
Location: SE Spain
Boat: Jeanneau SO 32I
Posts: 125
Re: AIS from OpenCPN to Navionics

Quote:
Originally Posted by DoubleDutch1962 View Post
[*]"How connections work" - yes that has been my main challenge. I was happily configuring stuff in OpenCPN and clearly that's a mistake (except for this San Francisco AIS stream which I can't get to work any other way I think)
The connections are mainly of two types:

1 Physical. Usually using USB-serial converters or USB devices such as GPS. In these the main parameters to be configured are the name of its physical port (/dev/ttyUSB0) or better its assigned alias, and its baud rate.

2 Network. In this case the parameters are usually the IP of the device that sends the data if we use the TCP protocol and the port. For example TCP 10.10.10.1:10110.

If we use UDP we will configure the tool that sends the data using the broadcast address and the assigned port 10.10.10.255:2000.

If we use Signal K we should know that Signal K sends by default the NMEA data in TCP format and port 10110, but it also sends the data in Signal K format on the port defined for the use of Signal K, usually 3000. Currently opencpn is not able to read Signal K data directly but this is about to change. The latest opencpn compilations are already working quite well with signal K data and soon a stable version will be released with that possibility.

Some of the tools we use may work with TCP, some with UDP and some with Signal K.

All the addresses shown here are using the openplotter AP as an example. They can change according to our network range configuration.

In the case of Internet servers such as exploratorium of Frisco bay works exactly the same only that the address will be the domain name although some tools will require us to use a numerical ip and we would have to find it by doing a ping ... for example.

pinguino is offline   Reply With Quote
Old 12-03-2020, 07:28   #14
Registered User
 
pinguino's Avatar

Join Date: May 2009
Location: SE Spain
Boat: Jeanneau SO 32I
Posts: 125
Re: AIS from OpenCPN to Navionics

Quote:
Originally Posted by DoubleDutch1962 View Post
[*]I would love you hear your advice on how you determine "we can create input connections in Signal k, kplex and opencpn but depending on what we want to do it is better to choose the right option" - I have so far totally ignored kplex as I don't know what it's use case is but if I need to know about that a well - I better start finding that manual :-)[*]Another missing topic for me is "CAN Bus" - when do I need that?
Kplex is dedicated to handling exclusively NMEA 0183 connections of all types. It is a very light software and works perfectly. Opencpn can also do it, but that requires that opencpn is working so that the rest of the computers in the network can receive data. Not usually a problem but if kplex does that task opencpn works with something more lightweight.
On the other hand Signal K can do more than opencpn and/or kplex since they only handle NMEA data while Signal K can also read sensor data in raw format using openplotter applications. However, it is less versatile and somewhat more complex when it comes to creating serial and network connections.

In addition, Signal K includes the ability to not only handle data but also to handle applications that using the Signal K protocol specifically can function as a plotter, dashboard etc.

Such is the amount of possibilities that openplotter offers that many get lost among so many options. My suggestion is to start with the basics and get into more things little by little.

As an example I will tell you my final configuration.

1 kplex collecting NMEA navigation, GPS and AIS data and sending it to tcp 10110 and UDP 2000

2 signal k collecting data from barometers, compasses, thermometers, humidity and accelerometers, converting them to NMEA 0183 and sending them to UDP 2000

3 opencpn reading data from TCP 10110 and UDP 2000 With the new beta that reads signal k I use signal k on port 3000 and TCP 10110.

Other devices on the network also read on TCP 10110 and UDP 2000

About CANBUS you will only need to work with it if your physical network uses the N2K protocol instead of NMEA 0183.
pinguino is offline   Reply With Quote
Old 12-03-2020, 07:30   #15
Registered User
 
pinguino's Avatar

Join Date: May 2009
Location: SE Spain
Boat: Jeanneau SO 32I
Posts: 125
Re: AIS from OpenCPN to Navionics

Quote:
Originally Posted by DoubleDutch1962 View Post
I've got another strange issue. When I connect > 1 (external) device to the Signal-K UDP server: the RPI's WLAN system dies.


Has anyone seen that before?
It's never happened to me. I don't think it's usual.
pinguino is offline   Reply With Quote
Reply

Tags
ais, enc, navionics, 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
What is like Navionics but not Navionics Dave_S Navigation 26 29-08-2021 19:59
Navionics plus versus Navionics Gold XL Alan N Crichton Navigation 5 04-11-2016 00:43
An iPad with iNavX/Navionics, or a Windows Surface with OpenCPN? TBillings Navigation 22 19-01-2016 04:41
OpenCPN versus Navionics wannathermal OpenCPN 0 18-06-2015 02:53
openCPN to read Navionics gold charts on SD? yzlian OpenCPN 1 10-04-2011 10:59

Advertise Here


All times are GMT -7. The time now is 03:58.


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.