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 22-04-2014, 05:06   #1
Marine Service Provider

Join Date: Jan 2013
Location: New Zealand
Posts: 97
Bug? OpenCPN ignoring lots of NMEA sentences - help!

Hi there,

I have used openCPN successfully for a long time and I just added a new wifi GPS/NMEA feed to the boat so I can get rid of the wires.

the old system with the nmea feed direct via a serial-USB cable worked OK and all the sentences were processed.

Now I connect the exact same NMEA feed (same sentences from same sources) via TCP connection over wifi and a lot of the sentences are being ignored by OpenCPN. The dashboard is not showing wind, rudder or heading. Very occasionally just one update of wind or rudder angle will get through and update the display, maybe once every few minutes.

The sentences coming from the GPS and AIS receiver are processed OK, but the other sentences like HDG (heading), RSA (Rudder angle) and MWV (wind) are all being ignored by OpenCPN. They don't show up at all in the NMEA debug window, not even as "skipped".

I connected direct to the TCP stream using netcat and confirmed that all the sentences are actually being received from the wifi, however when I connect with OpenCPN it ignores most of them.

The sentences which are being ignored have no checksum, perhaps this is the problem? The "Control checksum" option is disabled, but it seems like OpenCPN is ignoring this option and discarding any sentences which don't have a checksum anyway.

It worked OK with serial input so perhaps there is a bug in OpenCPN where the "Control checksum" option is ignored but only on TCP connections? Can anyone else test and duplicate this problem to confirm it?

I'm using the current release version on OSX and also tried a version from about 1 year ago on Ubuntu and both have exactly the same problem. Other software such as PolarCOM is receiving all the NMEA sentences correctly on the same computer so this appears to be an OpenCPN issue.

The only other difference is the Wifi sends these sentences with an "II" prefix, I'm not sure if they originally had a prefix on the wired system. Could that cause them to be ignored?

Any idea what the problem might be or how I can diagnose or fix it?

Thanks!
chris14679 is offline   Reply With Quote
Old 22-04-2014, 05:24   #2
Marine Service Provider

Join Date: Jan 2013
Location: New Zealand
Posts: 97
Re: Bug? OpenCPN ignoring lots of NMEA sentences - help!

PS. Here's a random theory... just a guess... perhaps the occasional messages that do get through are the ones which would have a checksum of zero? One in 255 messages getting through would be about what I'm seeing.

The heading message never ever seems to get through, but that would make sense because it never changes when I'm moored testing this, so would never have a zero checksum, whereas something randomly changing like wind would come through 1 in 255 times.

Could be some entirely different explanation for these symptoms but that one seems to fit - it's like it's trying to match a checksum when there isn't one.
chris14679 is offline   Reply With Quote
Old 22-04-2014, 06:09   #3
Registered User
 
Tristan's Avatar

Join Date: Aug 2006
Location: Cruising
Boat: Custom Ketch Asperida
Posts: 230
Re: Bug? OpenCPN ignoring lots of NMEA sentences - help!

I had a similar problem with MaxSea TZ. As a fix I run NavMonPC between TCP streams and the nav software. NavMonPC can fix the checksum problems and also select the NMEA sentences needed by the particular software.
I hope it helps.
T.
Tristan is offline   Reply With Quote
Old 22-04-2014, 07:29   #4
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,234
Re: Bug? OpenCPN ignoring lots of NMEA sentences - help!

Chris...
Can you record a few secs of the stream and post it here?

Thanks

Pavel
nohal is offline   Reply With Quote
Old 22-04-2014, 18:18   #5
Marine Service Provider

Join Date: Jan 2013
Location: New Zealand
Posts: 97
Re: Bug? OpenCPN ignoring lots of NMEA sentences - help!

Hi Pavel,

Here's a recording of the actual, complete NMEA stream. The NMEA debug window in openCPN only shows the !AI and $GP sentences, all the II sentences are missing.

Thanks for your help.

Code:
$IIHDG,31.2,,,0.0,W,
$IIMWV,338,R,5.50,N,A
$GPRMC,051245.00,A,3654.41634,S,17451.53448,E,0.006,100.62,220414,,,D*7B
$GPVTG,100.62,T,,M,0.006,N,0.011,K,D*3B
$GPGGA,051245.00,3654.41634,S,17451.53448,E,2,09,0.94,9.1,M,28.0,M,,0000*4B
$GPGSA,A,3,18,27,26,15,42,29,21,22,24,,,,1.67,0.94,1.38*01
$GPGSV,4,1,16,03,02,213,,05,02,106,15,14,06,329,,15,57,121,47*72
$GPGSV,4,2,16,16,00,251,,18,61,239,47,21,82,187,44,22,26,268,47*70
$GPGSV,4,3,16,24,22,053,40,26,23,137,45,27,15,222,34,29,27,354,42*72
$GPGSV,4,4,16,42,34,310,42,48,21,065,42,50,37,316,,51,01,082,*7B
$GPGLL,3654.41634,S,17451.53448,E,051245.00,A,D*7E
$GPRMA,A,3654.416,S,17451.534,E,,,0.0,100.6,0.0,W*7F
!AIVDM,2,1,8,A,59NSF?T2B9kHCDESN21@uLq=HThhF0l59F222216E0FC=5;60ACV`0Bk8888,0*01
!AIVDM,2,2,8,A,88888888880,2*2C
$IIRSA,2.3,A,,
$GPRMC,051246.00,A,3654.41633,S,17451.53449,E,0.007,100.62,220414,,,D*7F
$GPVTG,100.62,T,,M,0.007,N,0.013,K,D*38
$GPGGA,051246.00,3654.41633,S,17451.53449,E,2,09,0.94,9.0,M,28.0,M,,0000*4F
$GPGSA,A,3,18,27,26,15,42,29,21,22,24,,,,1.67,0.94,1.38*01
$GPGSV,4,1,16,03,02,213,,05,02,106,11,14,06,329,,15,57,121,47*76
$GPGSV,4,2,16,16,00,251,,18,61,239,47,21,82,187,44,22,26,268,47*70
$GPGSV,4,3,16,24,22,053,40,26,23,137,45,27,15,222,34,29,27,354,42*72
$GPGSV,4,4,16,42,34,310,42,48,21,065,43,50,37,316,,51,01,082,*7A
$GPGLL,3654.41633,S,17451.53449,E,051246.00,A,D*7B
!AIVDM,1,1,,A,17`B<WOP0o<P0vQbrlg7;OwN0HK;,0*3B
$AITXT,01,01,17,Synced to external*76
$IIHDG,31.0,,,0.0,W,
!AIVDM,1,1,,A,39NSF?U001<P56kbrfud;1QN0Dar,0*3D
$IIMWV,336,R,4.50,N,A
$GPRMC,051247.00,A,3654.41632,S,17451.53451,E,0.009,100.62,220414,,,D*78
$GPVTG,100.62,T,,M,0.009,N,0.017,K,D*32
$GPGGA,051247.00,3654.41632,S,17451.53451,E,2,09,0.94,9.0,M,28.0,M,,0000*46
$GPGSA,A,3,18,27,26,15,42,29,21,22,24,,,,1.67,0.94,1.38*01
$GPGSV,4,1,16,03,02,213,,05,02,105,08,14,06,329,,15,57,121,47*7D
$GPGSV,4,2,16,16,00,251,,18,61,239,47,21,82,187,44,22,26,268,46*71
$GPGSV,4,3,16,24,22,053,40,26,23,137,45,27,15,222,34,29,27,354,42*72
$GPGSV,4,4,16,42,34,310,42,48,21,065,43,50,37,316,,51,01,082,*7A
$GPGLL,3654.41632,S,17451.53451,E,051247.00,A,D*72
$GPRMA,A,3654.416,S,17451.534,E,,,0.0,100.6,0.0,W*7F
$IIRSA,2.3,A,,
$GPRMC,051248.00,A,3654.41631,S,17451.53452,E,0.004,100.62,220414,,,D*7A
$GPVTG,100.62,T,,M,0.004,N,0.008,K,D*31
$GPGGA,051248.00,3654.41631,S,17451.53452,E,2,09,0.94,9.0,M,28.0,M,,0000*49
$GPGSA,A,3,18,27,26,15,42,29,21,22,24,,,,1.67,0.94,1.38*01
$GPGSV,4,1,16,03,02,213,,05,02,105,09,14,06,329,,15,57,121,47*7C
$GPGSV,4,2,16,16,00,251,,18,61,239,47,21,82,187,44,22,26,268,46*71
$GPGSV,4,3,16,24,22,053,40,26,23,137,45,27,15,222,35,29,27,354,42*73
$GPGSV,4,4,16,42,34,310,42,48,21,065,43,50,37,316,,51,01,082,*7A
$GPGLL,3654.41631,S,17451.53452,E,051248.00,A,D*7D
$IIHDG,31.2,,,0.0,W,
$IIMWV,345,R,4.50,N,A
$GPRMC,051249.00,A,3654.41630,S,17451.53453,E,0.004,100.62,220414,,,D*7B
$GPVTG,100.62,T,,M,0.004,N,0.007,K,D*3E
$GPGGA,051249.00,3654.41630,S,17451.53453,E,2,09,0.94,9.0,M,28.0,M,,0000*48
$GPGSA,A,3,18,27,26,15,42,29,21,22,24,,,,1.67,0.94,1.38*01
$GPGSV,4,1,16,03,02,213,,05,02,105,08,14,06,329,,15,57,121,47*7D
$GPGSV,4,2,16,16,00,251,,18,61,239,47,21,82,187,44,22,26,268,46*71
$GPGSV,4,3,16,24,22,053,40,26,23,137,45,27,15,222,34,29,27,354,42*72
$GPGSV,4,4,16,42,34,310,42,48,21,065,43,50,37,316,,51,01,082,*7A
$GPGLL,3654.41630,S,17451.53453,E,051249.00,A,D*7C
$GPRMA,A,3654.416,S,17451.534,E,,,0.0,100.6,0.0,W*7F
$IIRSA,2.3,A,,
$GPRMC,051250.00,A,3654.41628,S,17451.53454,E,0.009,100.62,220414,,,D*70
$GPVTG,100.62,T,,M,0.009,N,0.017,K,D*32
$GPGGA,051250.00,3654.41628,S,17451.53454,E,2,09,0.94,8.9,M,28.0,M,,0000*46
$GPGSA,A,3,18,27,26,15,42,29,21,22,24,,,,1.67,0.94,1.38*01
$GPGSV,4,1,16,03,02,213,,05,02,105,08,14,06,329,,15,57,121,47*7D
$GPGSV,4,2,16,16,00,251,,18,61,239,47,21,82,187,43,22,26,268,46*76
$GPGSV,4,3,16,24,22,053,40,26,23,137,45,27,15,222,34,29,27,354,42*72
$GPGSV,4,4,16,42,34,310,42,48,21,065,43,50,37,316,,51,01,082,*7A
$GPGLL,3654.41628,S,17451.53454,E,051250.00,A,D*7A
$IIHDG,31.2,,,0.0,W,
$IIMWV,337,R,3.50,N,A
$GPRMC,051251.00,A,3654.41627,S,17451.53453,E,0.005,100.62,220414,,,D*75
$GPVTG,100.62,T,,M,0.005,N,0.009,K,D*31
$GPGGA,051251.00,3654.41627,S,17451.53453,E,2,09,0.94,8.9,M,28.0,M,,0000*4F
$GPGSA,A,3,18,27,26,15,42,29,21,22,24,,,,1.67,0.94,1.38*01
$GPGSV,4,1,16,03,02,213,,05,02,105,,14,06,329,,15,57,121,47*75
$GPGSV,4,2,16,16,00,251,,18,61,239,47,21,82,187,43,22,26,268,46*76
$GPGSV,4,3,16,24,22,053,40,26,23,137,45,27,15,222,34,29,27,354,42*72
$GPGSV,4,4,16,42,34,310,42,48,21,065,43,50,37,316,,51,01,082,*7A
$GPGLL,3654.41627,S,17451.53453,E,051251.00,A,D*73
W*7F
,A,3654.416,S,17451.534,E,,,0.0,100.6,0.0,W*7F
$IIRSA,2.3,A,,
$GPRMC,051252.00,A,3654.41626,S,17451.53452,E,0.003,100.62,220414,,,D*70
$GPVTG,100.62,T,,M,0.003,N,0.006,K,D*38
$GPGGA,051252.00,3654.41626,S,17451.53452,E,2,09,0.94,8.9,M,28.0,M,,0000*4C
$GPGSA,A,3,18,27,26,15,42,29,21,22,24,,,,1.67,0.94,1.38*01
$GPGSV,4,1,16,03,02,213,,05,02,105,,14,06,329,,15,57,121,47*75
$GPGSV,4,2,16,16,00,251,,18,61,239,47,21,82,187,43,22,26,268,46*76
$GPGSV,4,3,16,24,22,053,40,26,23,137,45,27,15,222,34,29,27,354,42*72
$GPGSV,4,4,16,42,34,310,42,48,21,065,43,50,37,316,,51,01,082,*7A
$GPGLL,3654.41626,S,17451.53452,E,051252.00,A,D*70
chris14679 is offline   Reply With Quote
Old 22-04-2014, 18:23   #6
Marine Service Provider

Join Date: Jan 2013
Location: New Zealand
Posts: 97
Re: Bug? OpenCPN ignoring lots of NMEA sentences - help!

Quote:
Originally Posted by Tristan View Post
I had a similar problem with MaxSea TZ. As a fix I run NavMonPC between TCP streams and the nav software. NavMonPC can fix the checksum problems and also select the NMEA sentences needed by the particular software.
I hope it helps.
T.
Thanks for the idea but I think this is windows software. I use Mac and Ubuntu linux. Plus I don't want to complicate the system with multiple layers of software, it's one more thing to go wrong.
chris14679 is offline   Reply With Quote
Old 29-04-2014, 16:30   #7
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,476
Re: Bug? OpenCPN ignoring lots of NMEA sentences - help!

chris14679....

This looks like a valid OCPN bug. On network streams, it appears that we are expecting to find the "*XX" checksum field in the NMEA message, even if we are going to ignore checksums later.

So, seeing no "*", the message is dropped without even going to the log.

Will be corrected for next Beta.

Thanks
Dave
bdbcat is online now   Reply With Quote
Old 29-04-2014, 16:37   #8
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,476
Re: Bug? OpenCPN ignoring lots of NMEA sentences - help!

Pavel...

Wanna take a crack at this one?

datastream.cpp:479
Code:
            while(!done){
                size_t nmea_end = m_sock_buffer.find('*'); // detect the potential end of a NMEA string by finding the checkum marker
                if(nmea_end != wxString::npos && nmea_end < m_sock_buffer.size()-2){
Dave
bdbcat is online now   Reply With Quote
Old 29-04-2014, 18:19   #9
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,234
Re: Bug? OpenCPN ignoring lots of NMEA sentences - help!

Dave...
Yes, should be obviously extended with check for a newline... Will have a look at it.

Pavel
nohal is offline   Reply With Quote
Old 29-04-2014, 18:37   #10
Marine Service Provider

Join Date: Jan 2013
Location: New Zealand
Posts: 97
Re: Bug? OpenCPN ignoring lots of NMEA sentences - help!

Thanks very much for tracking this down. Please let me know when there's a new version available and I'll try it.
chris14679 is offline   Reply With Quote
Reply

Tags
nmea, opencpn, enc


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
NMEA-0183 Sentences DSC, DSE continuouswave Marine Electronics 6 27-06-2020 05:57
Which NMEA Sentences Does an Autopilot Use ? svpresent Marine Electronics 8 02-05-2020 16:42
OpenCPN 3.3.xxxx and plugins : NMEA sentences list ? Gilletarom OpenCPN 17 01-05-2014 06:02
OpenCPN not sending NMEA autopilot sentences. Islander OpenCPN 6 16-04-2014 07:02

Advertise Here


All times are GMT -7. The time now is 17:46.


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.