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 12-06-2021, 02:20   #1
Registered User

Join Date: Jun 2021
Posts: 6
AIS problem via network connection

Hi
I am connecting over TCP to OpenCPN to send AIS sentences.

If I configure OpenCPN as a server and my device as a client then everything works correctly: the AIS sentences I send appear in the NMEA debug window; the target appears on the chart and the correct target data appears in the pop-up AIS window.

However, if I reverse the set up so the my device becomes the server and OpenCPN is configured as a client and I send exactly the same data it doesn't work so well: the sentences I send appear in the debug window, but no target appears on the chart or in the AIS list.

Thanks in advance
Alan
Alan Ward is offline   Reply With Quote
Old 12-06-2021, 06:48   #2
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: AIS problem via network connection

I do not fully understand what you are doing. Do you have an AIS receiver or do you have an AIS transmitter? And which brand is your AIS device?
CarCode is offline   Reply With Quote
Old 12-06-2021, 07:25   #3
Registered User

Join Date: Jun 2021
Posts: 6
Re: AIS problem via network connection

Hi CarCode,
Thanks for replying.
Essentially I guess what I have equates to an AIS receiver. It is something I am developing so doesn't have a brand.
I don't think that matters very much. My concern is that I send valid AIS sentences from my server to the OpenCPN client and it records them in the NMEA log, but then ignores them.
But, if I reverse their status so that I am the client and OpenCPN is the server then it works fine - with exactly the same data.

Cheers
Alan
Alan Ward is offline   Reply With Quote
Old 12-06-2021, 07:32   #4
Registered User
 
Dsanduril's Avatar

Join Date: Aug 2011
Location: Petersburg, AK
Boat: Outremer 50S
Posts: 4,229
Re: AIS problem via network connection

For OpenCPN to either display or serve AIS data it has to be a client to something, it doesn’t have a built-in AIS receiver. So, what is the entire configuration?

If you post some sample from the debug window from both configurations we could probably sort it out. Please don’t post pictures. Pause the debug window, select the NMEA text, copy it, and paste it in a post using the tags:
[C O D E]
pasted NMEA data
[/CODE]

There are extra spaces in the first word “CODE” so that I can post it without it being interpreted by the the CF engine, should just be the word itself as with the trailing tag.
Dsanduril is offline   Reply With Quote
Old 12-06-2021, 08:07   #5
Registered User

Join Date: Jun 2021
Posts: 6
Re: AIS problem via network connection

Hi Dsanduril
Thanks for the reply. Here are the two logs :
[C O D E]

This is the log when OpenCPN is the server
------------------------------------------
<GREEN>15:43:19 (Serial:COM7) $GPGSV,1,1,01,08,,,36,,,,,,,,,,,,*75<0x0D><0x0A>
<GREEN>15:43:19 (Serial:COM7) $GPGSA,A,1,,,,,,,,,,,,,1.1,0.5,1.0*34<0x0D><0x0A>
<GREEN>15:43:20 (Serial:COM7) $GPGSV,1,1,01,08,,,36,,,,,,,,,,,,*75<0x0D><0x0A>
<GREEN>15:43:21 (Serial:COM7) $GPGSV,1,1,01,08,,,34,,,,,,,,,,,,*77<0x0D><0x0A>
<GREEN>15:46:33 (TCP:0.0.0.0:2947) !AIVDM,1,1,,A,CkqS90@007tq2d7TEhqjIKv02H2M0f2T8000 000000000040PPP0,0*49<0x0D><0x0A>
<GREEN>15:47:33 (TCP:0.0.0.0:2947) !AIVDM,1,1,,A,CkqS90@007tq2PWTEjIjIKv02H2M0f2T8000 000000000040PPP0,0*27<0x0D><0x0A>
<GREEN>15:48:33 (TCP:0.0.0.0:2947) !AIVDM,1,1,,A,CkqS90@007tq2v7TEgIjIKv02H2M0f2T8000 000000000040PPP0,0*6C<0x0D><0x0A>

In this case it works fine.

This is the log when OpenCPN is the client
------------------------------------------
3,2,10,18,245,235,,21,72,083,,20,44,112,,16,40,161 ,*4F<0x0D><0x0A>
<GREEN>15:57:40 (Serial:COM7) $GPGSV,3,3,10,10,31,145,,07,16,322,,,,,,,,,*78<0x0 D><0x0A>
<GREEN>15:57:40 (Serial:COM7) $GPGSA,A,1,01,08,14,,,,,,,,,,691.3,310.0,620.0*37< 0x0D><0x0A>
<GREEN>15:57:40 (Serial:COM7) $GPGSV,2,1,08,08,67,158,20,01,46,266,35,14,26,312, 37,21,72,083,*7A<0x0D><0x0A>
<GREEN>15:57:40 (Serial:COM7) $GPGSV,2,2,08,20,44,112,,16,40,161,,10,31,145,,07, 16,322,*74<0x0D><0x0A>
<GREEN>15:58:07 (TCP:192.168.1.142:2947) !AIVDM,1,1,,A,CkqS90tq3O7TEgHupiv02H2M0f2T80000000 00000040PPP0,0*51<0x0D><0x0A>
<GREEN>15:58:17 (TCP:192.168.1.142:2947) !AIVDM,1,1,,A,CkqS90tq3O7TEgHupiv02H2M0f2T80000000 00000040PPP0,0*51<0x0D><0x0A>
<GREEN>15:58:27 (TCP:192.168.1.142:2947) !AIVDM,1,1,,A,CkqS90tq3O7TEgHupiv02H2M0f2T80000000 00000040PPP0,0*51<0x0D><0x0A>
<GREEN>15:58:37 (TCP:192.168.1.142:2947) !AIVDM,1,1,,A,CkqS90tq3O7TEgHupiv02H2M0f2T80000000 00000040PPP0,0*51<0x0D><0x0A>

In this case the AIS sentences are ignored.
They are the same sentence repeated - it is one that has worked previously in the other configuration.

[/C O D E]
Alan Ward is offline   Reply With Quote
Old 12-06-2021, 09:39   #6
Registered User
 
Dsanduril's Avatar

Join Date: Aug 2011
Location: Petersburg, AK
Boat: Outremer 50S
Posts: 4,229
Re: AIS problem via network connection

When I run those through a couple of online tools (my first step) the client AIS messages are deformed.

AIS Sentence Decoder

The server sentences (at least the one I tried) show the vessel Alan Ward.

Going to the client message it will not decode, says there is data missing. Running it through a NMEA Checksum Calculator the checksum is incorrect.

I think the problem is actually characters missing in the payload string, but I’m on a tablet at the moment without my normal tools for a deeper dive. Regardless, the sentence from 192.168.1.142 appears to be malformed.
Dsanduril is offline   Reply With Quote
Old 12-06-2021, 10:38   #7
Registered User

Join Date: Jun 2021
Posts: 6
Re: AIS problem via network connection

Hi Dsanduril
Thanks for getting back so fast.
You're right, that sentence is broken. I ran it through a parser I have and it wasn't happy with it. I can't imagine how that happened.
So, I took the first message from the previous log I sent you; checked that with the parser (OK). I also tried it with the decoder you identified and it was happy also.
I tried again to get OpenCPN to display it. No luck.
[C O D E]
<GREEN>18:35:23 (TCP:192.168.1.142:2947) !AIVDM,1,1,,A,CkqS90tq2d7TEhqjIKv02H2M0f2T80000000 00000040PPP0,0*49<0x0D><0x0A>

<GREEN>18:35:33 (TCP:192.168.1.142:2947) !AIVDM,1,1,,A,CkqS90tq2d7TEhqjIKv02H2M0f2T80000000 00000040PPP0,0*49<0x0D><0x0A>
[/C O D E]
I worry I'm wasting your time by doing something stupid, but I can't figure out what.

Thanks
Alan
Alan Ward is offline   Reply With Quote
Old 12-06-2021, 11:05   #8
Registered User
 
Dsanduril's Avatar

Join Date: Aug 2011
Location: Petersburg, AK
Boat: Outremer 50S
Posts: 4,229
Re: AIS problem via network connection

No waste of my time, when I parse the message as posted here on CF it doesn’t work, missing characters. Of course, the question does become whether the problem is with the sentence or the copy/paste at CF.

For the CODE tags I wasn’t clear, remove the spaces in the word “C O D E” so it looks like “CODE”. It creates a special text box when you post that takes the paste expression literally (otherwise the forum software does some formatting). Looks like
Code:
This is code text
Dsanduril is offline   Reply With Quote
Old 12-06-2021, 11:47   #9
Registered User
 
Dsanduril's Avatar

Join Date: Aug 2011
Location: Petersburg, AK
Boat: Outremer 50S
Posts: 4,229
Re: AIS problem via network connection

When I look at the server message there is an “@007“ symbol in the payload section that is missing in the client version. Getting stripped out somewhere. Something thinks it is an escape character?

CkqS90@007tq...
Dsanduril is offline   Reply With Quote
Old 12-06-2021, 11:53   #10
Registered User

Join Date: Jun 2021
Posts: 6
Re: AIS problem via network connection

How incredibly observant of you.
I've just checked and indeed it is getting lost somewhere between my server and OpenCPN.
What a b*gger.
I'll get wire shark on it tomorrow.
Thanks so much for your help
Alan
Alan Ward is offline   Reply With Quote
Old 12-06-2021, 12:05   #11
Registered User
 
Dsanduril's Avatar

Join Date: Aug 2011
Location: Petersburg, AK
Boat: Outremer 50S
Posts: 4,229
Re: AIS problem via network connection

Putting the @007 back in place and the sentence decodes properly.
Dsanduril is offline   Reply With Quote
Old 13-06-2021, 01:42   #12
Registered User

Join Date: Jun 2021
Posts: 6
Re: AIS problem via network connection

Hi Dsanduril

Thanks to your help I have found my problem.It is now working.
I was enclosing my test string with double quotes rather than single quotes - as simple as that!

Thanks
Alan
Alan Ward is offline   Reply With Quote
Old 14-06-2021, 08:08   #13
Registered User
 
Dsanduril's Avatar

Join Date: Aug 2011
Location: Petersburg, AK
Boat: Outremer 50S
Posts: 4,229
Re: AIS problem via network connection

Darn computers

So darn literal about doing exactly what you tell them, no more, no less. Can't wait for the day when they understand my intent (to be quickly followed by the robot uprising, of course).
Dsanduril is offline   Reply With Quote
Reply

Tags
ais, work


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
One N2k network or two (Yanmar LY3 network) codingparadox Marine Electronics 5 31-01-2021 16:08
No Network tabs showing to add connection MD99 OpenCPN 2 18-03-2019 05:42
Network connection Aart K. OpenCPN 5 27-03-2017 12:49
Raymarine HS Network Connection cp100 sonar roetter Marine Electronics 0 05-02-2017 08:37
Garmin GMS 10 network port expander vs network hub gettinthere Marine Electronics 0 04-06-2013 16:42

Advertise Here


All times are GMT -7. The time now is 15:32.


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.