rgleason / watchdog_pi

watchdog plugin for opencpn
GNU General Public License v3.0
1 stars 10 forks source link

Strange behavior of Course Alarm #62

Closed Corsair-63 closed 8 months ago

Corsair-63 commented 1 year ago

Windows 11 Pro ARM64 ver 22H2 22621.2215 OCPN 5.8.4-0+1637c28 Watchdog plugin 2.4.70.0 VDR plugin 1.3.28.0 Multiplexer - Shipmodul MiniPlex-3E-N2K - Firmware Version 3.18.2 GNSS - Digital Yacht GPS 160 at 38400 bps via multiplexer Auto pilot / Compass - RayMarine via Sea Talk via Multiplexer Wind vane - Nasa - Clipper-Target-Cruiser-V2.0 at 4800 via Multiplexer Depth STW, Seawater temp, and some other data - Furuno GP1971F - Plotter/RADAR/Echo-sounder via N2K via multiplexer AIS Rec / 2nd Echo sounder /2nd GNSS - at 38400 via multiplexer.

in second test mobile Pixel 5 app Bluetooth GPS output in BT COM port at 4800 bps.

also, when click on setup Course Alarm, never goes to the heading device reading, supposed to take first the COG figure. (when click on actual course)

first test:

second test:

third test:

WD_Course_GPS_02 VDR_Course.zip VDR_Course_mobile.zip GNSS_mobile WD_Course_Compass_01 WD_Course_Compass_02 WD_Course_Compass_mobile_01 WD_Course_Compass_mobile_02 WD_Course_Compass_mobile_03 WD_Course_Compass_mobile_04 WD_Course_GPS_01

Corsair-63 commented 1 year ago

Digging a little in above report, I've compared both compass sentences from both situations, and I have no clue about why mobile signal is immediately detected and not the multiplexer one?

Input from Multiplexer (Mx) $HEHDT,287.0,T22 $HCHDG,287.00,,,0.04,E20

Input from Mobile (Mb) $HCHDT,280.1,T22 $HCHDG,280.0,,,000.1,E22

Mx $HEHDT,287.0,T22 Mb $HCHDT,280.1,T22

Mx $HCHDG,280.0,,,000.1,E22 Mb $HCHDG,287.00,,,0.04,E20

From NMEA talker ID: HC - Heading sensors: compass magnetic. HE - Heading sensors: gyro, north seeking.

From NMEA sentences: HDT - Heading true. HDG - Heading, deviation and variation.

only difference in sentences is one from multiplexer starting with HE and the other one by HC when mobile starts both with HC. NMEA sentences in both inputs have the same arrangement conforming NMEA standard.

Corsair-63 commented 1 year ago

Confirmed behaviour of WD Course alarm.

so, it means that for any reason there is a conflict with $HC & $HE inputs because in the mobile sentences both are $HC and the WD course alarm is shown without delay.

also, pointing that when click on actual course the course read is COG from GPS and not from the Heading Device.

WD_Course_Alarm_working WD_Course_Alarm_setup

rgleason commented 1 year ago

Cosair, with this instrumentation:

  1. GNSS - Digital Yacht GPS 160 at 38400 bps via multiplexer - (GPS course)
  2. Auto pilot / Compass - RayMarine via Sea Talk via Multiplexer -(Autopilot Heading Sensor)
  3. 2nd GNSS - at 38400 via multiplexer. -(GPS course)

How are you filtering and prioritizing the nmea signals? This is done in Option > Connections https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:manual_basic:toolbar:options:connections https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:manual_basic:toolbar:options:connections:priority

This is critical for Watchdog to be effective.

I have not yet tested your vdr files as we are working on a sizeable TP project, but I am following. Your reports are excellent. Thank you.

Corsair-63 commented 1 year ago

Everything doesn't need to be prioritized in OCPN because the work is done by Multiplexer and set on it as:

  1. GNSS DY GPS 160
  2. Autopilot
  3. 2nd GNSS also, bearing in mind that when not received same NMEA sentence is taken from the next in priority queue. it means that only received one same sentence in OCPN in case of duplication by sources. this help OCPN for not making the filtering sequence.
rgleason commented 1 year ago

Okay, have you captured the result that Watchdog sees in your VDR_course.zip above? If so, what sentences do you see there? Perhaps I should look now.

rgleason commented 1 year ago

Well it doesn't look like the VDR_Course.txt is being filtered does it? I think you'd better use the OpenCPN filter feature. Watchdog Course alarm has limited filtering ability, just GPS and Heading Sensor

What happens when you set Watchdog to Heading sensor?

Corsair-63 commented 1 year ago

Well it doesn't look like the VDR_Course.txt is being filtered, does it?

VDR_Course.txt is with all data from all devices from Multiplexer and filtered by it, none duplicated sentence.

What happens when you set Watchdog to Heading sensor?

with that log Course alarm comes to red and N/A. that's with $HC & $HE from multiplexer (Sea Talk converted) being able convert HDG <-> HDT.

and if I unable the multiplexer input and activate the mobile one (VDR_Course_mobile.zip) the alarm is working correctly (that's the signal of GNSS, Compass & barometer of the mobile itself)

I haven't sent a log with convert HDG <-> HDT unable in Multiplexer but that works after some seconds of OCPN started and Off Course alarm works as expected.

Corsair-63 commented 1 year ago

Okay, have you captured the result that Watchdog sees in your VDR_course.zip above? If so, what sentences do you see there? Perhaps I should look now.

yes, with input GPS last picture (setup) and result the one with red figures and 90 degrees.

with Heading device, the 3rd picture (setup) and 4th the error red and N/A all referenced pictures from original message.

rgleason commented 1 year ago

Corsair-63 This morning I tried both files and yes indeed there are some screwy things going on and I don't know why yet. But the fact is, garbage in garbage out. You should look carefully at the nmea data stream being received by Watchdog.

First of all I can confirm that the "Course" button in the Course Edit window does not work properly.

Just to be sure that watchdog course alarm was working properly using our tests I stripped down a Tactics nmea data file and ran it, and the course alarm works perfectly fine on either GPS or Heading buttons.

I attach it here as a compressed file so you can try it out without any instruments attached, just run VDR. I set the course to about 357 degrees at the start of the file. I set the off course angle to about 7 degrees and the alarm went off. Then I hit reset and it went off again later. It works with both magnetic GPS COG and magnetic Heading After you try this file, go back and compare it with your file perhaps.

Tactics-sample2-1m.zip

Tactics-Course-Test

Now I won't say that Course is perfect, but I believe it should be working better than it is for you, and I think you need to cleanup the sentences coming in.

Corsair-63 commented 1 year ago

Hi Rick,

I tried your file and works same than mine from Multiplexer. since I removed in the Multiplexer the option of convert HDG <-> HDT, the alarm works as desired, only last some seconds to activate after start OCPN.

as you pointed, also, not available to set the course as heading device when click on "actual course" always COG.

filtering in this situation when supposed that all data came from the same stream, it's little complicated but I tried with the OCPN priority feature, there was quite a lot of entrances, so I erase all, and started all my connection to recreate, and I left as attached picture priority.jpg.

Priority also, the priority as told before is done with multiplexer, and I attached picture of it, there are not so many output sentences as they are filtered on every cicle for not sending redundant from various sources. Multiplexer

  1. is autopilot.
  2. is wind vane.
  3. is GNSS DY
  4. is AIS receiver that multiplex its own GPS, plus 2nd GNSS, plus second echo sounder. N2K is Furuno Plotter with RADAR, triducer echo-sounder, GPS.

what I really don't know in priority window what are the NMEA 0183 virtual?

regarding the test with your log file, still not able to set the wind alarm nor true relative neither true absolute.

Carmelo

rgleason commented 8 months ago

@Corsair-63 Carmelo, my head is spinning after reading this thread. where are we now on this issue? Is https://github.com/rgleason/watchdog_pi/issues/76 the summary and crux of the problem?

Corsair-63 commented 8 months ago

Hi Rick,

Is https://github.com/rgleason/watchdog_pi/issues/76 the summary and crux of the problem?

yes, that's it.

also that why is not accepted by the plugin:

Input from Multiplexer (Mx) $HEHDT,287.0,T22 $HCHDG,287.00,,,0.04,E20

Input from Mobile (Mb) $HCHDT,280.1,T22 $HCHDG,280.0,,,000.1,E22

Mx $HEHDT,287.0,T22 Mb $HCHDT,280.1,T22

Mx $HCHDG,280.0,,,000.1,E22 Mb $HCHDG,287.00,,,0.04,E20

From NMEA talker ID: HC - Heading sensors: compass magnetic. HE - Heading sensors: gyro, north seeking.

From NMEA sentences: HDT - Heading true. HDG - Heading, deviation and variation.

but deactivated the conversion in Multiplexer and no problem by now. apart from WD in the setup doesn't read the heading device, on follow up it does (or I guess, because sailing COG and Heading feom device most of the times are very close)

rgleason commented 8 months ago

Great report.
So the conversion in MUX from HDG <-> HDT created the strange course behavior. Turning off this conversion in your Shipmodule fixed a major part of the problem. Now we have #76 to fix. Thanks for your persistence.