OpenMarine

Full Version: choose UDP ports
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Which UDP port numbers should I use to pass NMEA  sentences to respectively :
  1. the VHF ?
  2. The Pilot ?
Having no knowledge of which port numbers are possibly used in OP !
Isn't UDP is a networking protocol?

Just a guess, but your VHF is most likely NMEA0183 and the autopilot NMEA2000. They connect to SignalK through a serial bus or Can bus, so UDP isn't really something that would apply here, as it's for ethernet or wifi connections. The SignalK-to-NMEA2000 plugin handles the back and forth through to the NMEA2000 network. And the serial ports are set up in SignalK connections. The NMEA0183-to-NMEA0183 and SignalK-to-NMEA0183 plugins are also useful here.

You previously made your VHF received data from signalk for the GPS. The turn around for that is to receive data on the same port and route it in nmea0183-to-nmea0183 plug in just the same.
(2021-06-06, 11:38 PM)SCarns Wrote: [ -> ]Isn't UDP is a networking protocol?

Just a guess, but your VHF is most likely NMEA0183 and the autopilot NMEA2000. They connect to SignalK through a serial bus or Can bus, so UDP isn't really something that would apply here, as it's for ethernet or wifi connections. The SignalK-to-NMEA2000 plugin handles the back and forth through to the NMEA2000 network. And the serial ports are set up in SignalK connections. The NMEA0183-to-NMEA0183 and SignalK-to-NMEA0183 plugins are also useful here.

You previously made your VHF received data from signalk for the GPS. The turn around for that is to receive data on the same port and route it in nmea0183-to-nmea0183 plug in just the same.
Hi SCarns, thank you for your answer. In my case both PiIlot and VHF use NMEA0183. So far I managed to avoid any contact with N2k !
I can undestand it is possible to send the position info in an NMEA form (RMC) to send it to the VHF using SignalK-to-NMEA0183 plugin.
But tell me, if you don't use UDP port, how do you pull info (APB,XTE) out from openCPN to route it to the pilot ?
Ahhh, now I see what you are trying to do... and the answer is, it's complicated.

You'll need to set up a new connection in "Data Connections" to receive data FROM OpenCPN. Set it to put output into NMEA0183output to insert that data into the NMEA0183 data stream. How does your 0183 autopilot connect to SignalK? Same as your VHF?

For the VHF, go back into your configuration in nmea0183-to-nmea0183 and your vhf out setting and turn on RMC. Once OpenCPN starts sending that, that event will update the radio.

Steve
(2021-06-07, 03:56 PM)SCarns Wrote: [ -> ]Ahhh, now I see what you are trying to do... and the answer is, it's complicated.

You'll need to set up a new connection in "Data Connections" to receive data FROM OpenCPN. Set it to put output into NMEA0183output to insert that data into the NMEA0183 data stream. How does your 0183 autopilot connect to SignalK? Same as your VHF?

For the VHF, go back into your configuration in nmea0183-to-nmea0183 and your vhf out setting and turn on RMC. Once OpenCPN starts sending that, that event will update the radio.

Steve
In fact I want to route the position (RMC) to a VHF (NMEA interface), and the pilot control (APB, XTE) to a Pilot NMEA interface.

1st in opencpn, I created 2 outgoing UDP connections with the proper sentences : OUT1 to Pilot, UDP 10116, and OUT 2 to VHF, UDP 10118 ;

In the in nmea0183-to-nmea0183 plugin I also selected the proper NMEA sentences attached to 2 newly created output events (for both pilot and VHF ) ;

Then in Signal K, I created 2 connections : to the UDP 10116 to (the RS422 USB device linking) the Pilots' output event, and to UDP 10118 to the  RS422 USB device linking the) VHF's output event 's ;

I selected the port numbers (10116 & 10118) with a blindfold,  Confused  and by pure luck it is working, so far ! Cool

I would feel much more relax if a skilled person could bless this choice (in UDP port numbers) or adversely advise me which numbers should I use ! Angel
I assume you're behind your own firewall and besides SignalK, there won't be much going on network-wise, so the port numbers are probably fine.

That said, I'm not positive they are needed, as TCP is bi-directional, so in theory, OpenCPN could output on TCP port 10110 back to signalk and you'd just need to use the nmea-to-nmea plugin to route the events... in theory. Don't quote me, as I'm not 100% on this. On the otherhand, what you have is working, and I'm a big supporter of the "if it ain't broke, don't try to fix it" axiom, so roll with it until something stops working!!!

Steve
(2021-06-07, 06:19 PM)SCarns Wrote: [ -> ]I assume you're behind your own firewall and besides SignalK, there won't be much going on network-wise, so the port numbers are probably fine.

That said, I'm not positive they are needed, as TCP is bi-directional, so in theory, OpenCPN could output on TCP port 10110 back to signalk and you'd just need to use the nmea-to-nmea plugin to route the events... in theory. Don't quote me, as I'm not 100% on this. On the otherhand, what you have is working, and I'm a big supporter of the "if it ain't broke, don't try to fix it" axiom, so roll with it until something stops working!!!

Steve

I agree with you ! A few decade ago, I noted this golden advice in a marine motor workshop of St Peter Harbour : If it works ... don't fix it !
then it never went out of my mind !

This being said, I would like to know, and what I can do is :
  1. First a backup ! check my existing backup copy is 100% valid ;
  2. figure out if chnanging the UDP ports to 10110 could work ;
  3. and if yes give it a try !
I'll be back ...
One thought - isn't RMC already coming out of signalk and being sent to opencpn? Might be slightly less work for the Pi to do using that instead of sending it to opencpn, back to signalk then out again. What GPS do you have?
(2021-06-07, 04:59 PM)Didier B Wrote: [ -> ]In fact I want to route the position (RMC) to a VHF (NMEA interface), and the pilot control (APB, XTE) to a Pilot NMEA interface.

1st in opencpn, I created 2 outgoing UDP connections with the proper sentences : OUT1 to Pilot, UDP 10116, and OUT 2 to VHF, UDP 10118 ;

In the in nmea0183-to-nmea0183 plugin I also selected the proper NMEA sentences attached to 2 newly created output events (for both pilot and VHF ) ;

Then in Signal K, I created 2 connections : to the UDP 10116 to (the RS422 USB device linking) the Pilots' output event, and to UDP 10118 to the  RS422 USB device linking the) VHF's output event 's ;

I selected the port numbers (10116 & 10118) with a blindfold,  Confused  and by pure luck it is working, so far ! Cool

I would feel much more relax if a skilled person could bless this choice (in UDP port numbers) or adversely advise me which numbers should I use ! Angel

Firstly, RMC should come from your GPS device to OCPN through the existing, incoming to OCPN connection. which should look something like below:
[attachment=1513]

then setup the outgoing connection from OCPN, notice I only send XTE, APB, RMB - this stops message loops.  your 10116 or 10118 should be fine, but you don't need separate outputs
[attachment=1512]

On the Signal K side, add a data connection (Server => Data Connections) per below, make sure the port is whatever you use:
[attachment=1514]

now you will have all the data in signal K and be able to see it on the Signal K data browser. 

after that, you can send the sentences out by setting them in SignalK to NMEA0183 plugin and a serial connection to your VHF and AP (which I think you already have)
(2021-06-08, 02:55 PM)Techstyle Wrote: [ -> ]after that, you can send the sentences out by setting them in SignalK to NMEA0183 plugin and a serial connection to your VHF and AP (which I think you already have)

Is signalk to nmea0183 needed? I just set up similar to what you described sending just RMB from opencpn to a udp input to signalk with sentence event - fromcpn, then a tcp client connection in signalk with Output events - fromcpn, the rmb nmea0183 messages showed up in a node red tcp node from signalk fine without needing any signalk - nmea0183 set up. 
It's also possible to send RMC from opencpn to the same udp port without creating a loop so should be OK to connect both autopilot nmea in and VHF nmea in to the same usb/serial output if they both use the same baud rate.
Pages: 1 2