This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to correctly set up autopilot control using openCPN and USBserial device
#1
Hello, dear OpenPlotter team!

Unfortunately, I have failed to get RMB, APB from OpenCPN on my USBserial device.


First, I installed

- OpenPlotter version 2020-03-24-OpenPlotter-v2-Starting-img

onto

- Raspberry Pi 4 model B

Then I update

- SignalK to v 1.36.0
- openCPN to 5.2.4

I have connected USBSerial device to RPi [Yacht Devices YDNU-02 USB gateway]


Then I follow documentation at

https://openplotter.readthedocs.io/en/la...-converter

Section "Connecting a USB-RS422 converter"


1) Input data

OpenCPN configured as per documentation, using direct SignalK connection ( Fig. 1. ).

[Image: open-CPN-to-Signal-K.png]
Fig. 1. OpenCPN direct SignalK server connection settings.

It works fine, I can see vessel moving and AIS targets displayed as well. All OK.

Then I proceed to the next step


2) Input + output data

OpenCPN configured as per documentation, using UDP connection to port 10119 ( Fig. 2. ).

[ direct SignalK connection configured earlier is also present and active ]

[Image: opencpn-OUT.png]
Fig. 2. OpenCPN AP output connection settings.

Then I've added a new connection "opencpnOUT" using the same UDP port 10119,
set ignored sentences RMB,APB and sentence event "autopilot" ( Fig. 3. ).

[Image: opencpnout-signal-K.png]
Fig. 3. "opencpnOUT" connection settings.


Then I need to specify what data should be sent to boat via the USB-RS422 converter, done that as well ( Fig. 4. ).

[Image: rs422.png]
Fig. 4. "rs422" connection settings.


..and finally restarted SignalK server and openCPN.

Then I activate "GoTo" in openCPN.

I can see APB and RMB sent, and RMC and XTE blocked in OpenCPN "NMEA Debug Window" ( Fig. 5. ). Seems correct.

[Image: opencpn-debug-window.png]
Fig. 5. OpenCPN can get data from SignalK server and can send APB and RMB to UDP port 10119.


Unfortunately, I do not observe any NMEA 0183 sentences on RS-422 interface.

And opencpnOUT has zero activity ( Fig. 6. ).

[Image: activity.png]
Fig. 6. No activity on "opencpnOUT" connection.


Please, kindly, check my configuration.

I suppose I am just missing one minor configuration detail or made a small mistake.


PS:

I've tried empty "Ignored Sentences" filters in "opencpnOUT" connection,
got APB and RMB on RS-422 device output.

However, I am not sure if this is a correct solution.

Please, confirm, if this configuration is legit,
maybe there is just an error in the openplotter documentation and we do not need APB and RMB filtering on "opencpnOUT" connection?


Thank you.
Reply
#2
Hi manekineko
have you tried to enter "localhost" as IP in the connection settings above your port?
save sailing
Andreas
Reply
#3
I also removed APB and RMB from ignored sentences and now get these sentence components in signal K. Which I am not sending to Autopilot but I am using the data in KIP
Reply
#4
Not sure about outputting serial from signalk but could you delete the autopilot rs422 output in SignalK and create another output in opencpn to the rs422 serial?
Reply
#5
(2020-11-17, 07:24 PM)xfactor99 Wrote: Hi manekineko
have you tried to enter "localhost" as IP in the connection settings above your port?
save sailing
Andreas

Nice try =)

Tested it

[Image: opencpn-localhost-outgoing.png]


unfortunately, this does not solve an issue, still got nothing received by RS422 device.
Reply
#6
(2020-11-18, 08:21 AM)PaddyB Wrote: Not sure about outputting serial from signalk but could you delete the autopilot rs422 output in SignalK and create another output in opencpn to the rs422 serial?

Then maybe you try this. It shuld work setting the Autopilot direct in Opencpn as a serial connection
save sailing
Andreas

PS:  maybe the other does not work as you had set some data in signalk to ignore ....

also check that baudrate is set according your AP
Reply
#7
(2020-11-18, 08:21 AM)PaddyB Wrote: Not sure about outputting serial from signalk but could you delete the autopilot rs422 output in SignalK and create another output in opencpn to the rs422 serial?

Done, AP works and openCPN gets vessel position and AIS targets,

but after that I am missing all data in SignalK ( RS-422 device is the only "data source" and "data sink" in my setup ).

Not good.

(2020-11-17, 11:55 PM)Techstyle Wrote: I also removed APB and RMB from ignored sentences and now get these sentence components in signal K.  Which I am not sending to Autopilot but I am using the data in KIP

This seems to work fine. [ Empty "Ignored sentences" for "opencpnOUT" connection ].

But I am not sure if I have created "data loop" accidentally.


It seems to me like there is no signs of overload, as I got the following activity:

When RS-422 device outputs no data I can see very modest load on "opencpnOUT" connection.

[Image: activity-no-input-data.png]
When RS-422 device outputs recorded trip data I can see high load on "RS422" connection and the same modest load on "opencpnOUT" connection


[Image: activity-with-input-data.png]
to ALL:

Can you kindly, confirm that there is no "data loop" in current setup? What is the best way to detect "data loops"?
Reply
#8
(2020-11-18, 02:40 PM)manekineko Wrote:
(2020-11-18, 08:21 AM)PaddyB Wrote: Not sure about outputting serial from signalk but could you delete the autopilot rs422 output in SignalK and create another output in opencpn to the rs422 serial?

Done, AP works and openCPN gets vessel position and AIS targets,

but after that I am missing all data in SignalK ( RS-422 device is the only "data source" and "data sink" in my setup ).

Not good.
Ah, just one serial connection to the Pi and you want everything to come in/out of that? Changes everything, so you want opencpn to output rmb & apb to get send to signalk over UDP then signalk outputs those sentences to the serial connection - better off asking the sigK guys direct - http://slack-invite.signalk.org/
Suspect the input / output events might do it but haven't time to play around at the moment
[Image: tIUM9PH.png]

Think that might work but don't have time to dig out a serial / usb to test, so opencpn outputs to, say, port 10121 UDP, signalk inputs that as sentence event - auto.
Then created a TCP client connection localhost port10123 , output events -AUTO
This connection sends the messages coming in port 10121UDP out tcp.
So from what you've done in post 1 it should output - one for the sigk authors,,

[Image: 7ytz5m9.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)