Cruisers Forum
 


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 30-07-2022, 01:47   #241
Registered User

Join Date: Mar 2016
Location: Bremen
Boat: Dehler Optima 106
Posts: 156
Re: Twocan - a new Plugin

New minor issue with TwoCan:

I just replaced my depth sensor.

It has been an old analog Airmar triducer, which was part of a Nexus network connected via Garmin GND to N2K network and then fed into OpenCPN via the TwoCan Plugin.
Now it is an uptodate Airmair DST810 triducer directly connected to the N2K network. The Garmin GND now translates the data from N2K back into Nexus, so that my Nexus display still shows depth data.

I have set a depth offset of 0.4 m, since this is the depth of the sensor below the water line. In OpenCPN I do see only the depth below transducer, on the Nexus display I see depth below transducer plus depth offset, which then corresponds to water depth.

So, I reckon that TwoCan does not consider the offset, which is part of PGN 128267.

I have attached a short can dump log file, which should have some depth values. The depth below sensor should be around 2.6m and the offset is 0.4, which translates in a water depth around 3m. OpenCPN shows 2.6m, Nexus shows 3m.

The attached file has extension pdf, but actually is a text file.

Best,

Manfred

candump-2022-07-30_102821.log.pdf
Aldebaran17 is offline   Reply With Quote
Old 31-07-2022, 08:58   #242
Registered User

Join Date: Mar 2011
Posts: 725
Re: Twocan - a new Plugin

Your observations are correct.

Some kind of historical artifiact.

Previously the Dashboard only supported DBT sentences, so TwoCan only provided a conversion from PGN 128267 to the NMEA 183 DBT sentence. I guess I could have included the offset when generating the depth value for the DBT sentence.
Code:
bool TwoCanDevice::DecodePGN128267(const byte *payload, std::vector<wxString> *nmeaSentences) {
	if (payload != NULL) {

		byte sid;
		sid = payload[0];

		unsigned int depth; // /100
		depth = payload[1] | (payload[2] << 8) | (payload[3] << 16) | (payload[4] << 24);

		short offset; // /1000
		offset = payload[5] | (payload[6] << 8);

		byte maxRange; // * 10
		maxRange = payload[7];

		if (TwoCanUtils::IsDataValid(depth)) {
			
			// BUG BUG FIX
			//nmeaSentences->push_back(wxString::Format("$IIDPT,%.2f,%.2f,%.2f", (float)depth / 100, (float)offset / 100, \
			//((maxRange != 0xFFFF) && (maxRange > 0)) ? maxRange / 100 : (int)NULL);
		
			// OpenCPN Dashboard only accepts DBT sentence
			nmeaSentences->push_back(wxString::Format("$IIDBT,%.2f,f,%.2f,M,%.2f,F", CONVERT_METRES_FEET * (double)depth / 100, \
				(double)depth / 100, CONVERT_METRES_FATHOMS * (double)depth / 100));
			return TRUE;
I don't know when the Dashboard was amended to support both DBT & DPT sentences (the latter which include an offset value).Obviously I missed noticing that change. Current Dashboard code:
Code:
if (m_NMEA0183.PreParse()) {
    if (m_NMEA0183.LastSentenceIDReceived == _T("DBT")) {
      if (mPriDepth >= 4) {
        if (m_NMEA0183.Parse()) {
          /*
           double m_NMEA0183.Dbt.DepthFeet;
           double m_NMEA0183.Dbt.DepthMeters;
           double m_NMEA0183.Dbt.DepthFathoms;
           */
          double depth = NAN;
          if (!std::isnan(m_NMEA0183.Dbt.DepthMeters))
            depth = m_NMEA0183.Dbt.DepthMeters;
          else if (!std::isnan(m_NMEA0183.Dbt.DepthFeet))
            depth = m_NMEA0183.Dbt.DepthFeet * 0.3048;
          else if (!std::isnan(m_NMEA0183.Dbt.DepthFathoms))
            depth = m_NMEA0183.Dbt.DepthFathoms * 1.82880;
          if (!std::isnan(depth)) depth += g_dDashDBTOffset;
          if (!std::isnan(depth)) {
            SendSentenceToAllInstruments(
                OCPN_DBP_STC_DPT,
                toUsrDistance_Plugin(depth / 1852.0, g_iDashDepthUnit),
                getUsrDistanceUnit_Plugin(g_iDashDepthUnit));
            mPriDepth = 4;
            mDPT_DBT_Watchdog = gps_watchdog_timeout_ticks;
          }
        }
      }
    }

    else if (m_NMEA0183.LastSentenceIDReceived == _T("DPT")) {
      if (mPriDepth >= 3) {
        if (m_NMEA0183.Parse()) {
          /*
           double m_NMEA0183.Dpt.DepthMeters
           double m_NMEA0183.Dpt.OffsetFromTransducerMeters
           */
          double depth = m_NMEA0183.Dpt.DepthMeters;
          if (!std::isnan(m_NMEA0183.Dpt.OffsetFromTransducerMeters)) {
            depth += m_NMEA0183.Dpt.OffsetFromTransducerMeters;
          }
          depth += g_dDashDBTOffset;
          if (!std::isnan(depth)) {
            SendSentenceToAllInstruments(
                OCPN_DBP_STC_DPT,
                toUsrDistance_Plugin(depth / 1852.0, g_iDashDepthUnit),
                getUsrDistanceUnit_Plugin(g_iDashDepthUnit));
            mPriDepth = 3;
            mDPT_DBT_Watchdog = gps_watchdog_timeout_ticks;
          }
        }
      }
    }
Something to fix in the next release.

Thanks.
stevead is offline   Reply With Quote
Old 31-07-2022, 14:48   #243
Registered User

Join Date: Mar 2016
Location: Bremen
Boat: Dehler Optima 106
Posts: 156
Re: Twocan - a new Plugin

Quote:
Originally Posted by stevead View Post
Something to fix in the next release.
That'll be great.

Thanks,

Manfred
Aldebaran17 is offline   Reply With Quote
Old 13-06-2023, 13:08   #244
Registered User

Join Date: Apr 2023
Posts: 36
Re: Twocan - a new Plugin

I want to use TwoCan, but on one Mac it's not in the plugins list, and on another Mac it's in the plugins list. I installed and enabled it, but Preferences is greyed out (inactive) so I can't make settings.

So my questions are:

1. How do I get a plugin (TwoCan specifically) to be in the plugins list is it's not there?

2. How do I get TwoCan preferences to be usable?
Bella Donna is offline   Reply With Quote
Old 14-06-2023, 04:18   #245
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,797
Re: Twocan - a new Plugin

The two systems are with OpenCPN 5.8.2?
Versions of macOS?
bcn is offline   Reply With Quote
Old 14-06-2023, 07:47   #246
Registered User

Join Date: Apr 2023
Posts: 36
Re: Twocan - a new Plugin

OpenCPN 5.8.2
MacOS 12.6.7 and MacOS 13.3.1
TwoCan 2.1.0.0

On the v13 Mac, which had TwoCan with the Preferences issue, I removed OpenCPN and re-installed. Now it doesn't have TwoCan in the list either.
Bella Donna is offline   Reply With Quote
Old 14-06-2023, 08:53   #247
Registered User

Join Date: Mar 2011
Posts: 725
Re: Twocan - a new Plugin

I have yet to release a version of TwoCan for OpenCPN 5.8.x. The current version of TwoCan is only supported on OpenCPN 5.6.x.

As everyone is aware, OpenCPN 5.8.x uses a new version of wxWidgets; 3.2.1, which in turn requires plugin developers to update their Continous Integration (CI) build scripts to support both the wxWidgets requirements and the new platforms supported by OpenCPN (Bullseye, Flatpak etc.).

As plugin developers volunteer their time and knowledge to the OpenCPN community, we try to update our plugins as best we can, however, it is almost impossible to release an updated plugin to coincide with a new release of OpenCPN.

This is the major reason why many plugins are not listed in the plugin catalog for OpenCPN 5.8.x
stevead is offline   Reply With Quote
Old 14-06-2023, 10:01   #248
Registered User

Join Date: Apr 2023
Posts: 36
Re: Twocan - a new Plugin

Hmmm... OK. Thanks. That explains a lot. What does the timeline look like for releasing a new version of TwoCan?

If I decide to roll back to 5.6, what are the downsides?

I get that OpenCPN is what it is because of the generous and dedicated support and huge amounts of time from the developer community. I'm very grateful! If I had any skills in the realm of software development I'd like to think that I would also contribute, but, alas, the best I can do is contribute a bit financially, and give a big thanks to all of you who have given so much to making a great piece of software! Thanks!!!
Bella Donna is offline   Reply With Quote
Old 14-06-2023, 10:19   #249
Registered User

Join Date: Apr 2023
Posts: 36
Re: Twocan - a new Plugin

I've re-installed OpenCPN 5.6.2 on the v13 Mac. I'm having the same issue where the Preferences button is greyed out in the TwoCan plugin window. How can I get that working?
Bella Donna is offline   Reply With Quote
Old 15-06-2023, 01:50   #250
Registered User

Join Date: Mar 2011
Posts: 725
Re: Twocan - a new Plugin

Re: Next version of TwoCan.
Possibly in the next month, although no hard guarantees.

Re: V13 Mac.
Can you please post the opencpn.log. When you say the "preferences" button is greyed out, is the TwoCan icon correctly displayed or is the "jigsaw puzzle" icon displayed?

After installing OpenCPN 5.8.2, and then reinstalling OpenCPN 5.6.2 and TwoCan, prior to the reinstall did you manually clean out the plugin's files, the dynamic libraries, IIRC libtwocan_pi.dylib or something like that.

I have a sneaking suspicion that upon upgrading to OpenCPN 5.8.2, it may have "jailed" the plugin.

I have little experience with Mac's so it could also be some kind of issue with the build environment for plugins built for OpenCPN 5.6.2 and the newer versions of OSX or with Macs using Apple's M1 Silicon, rather than Intel processors.

I have no idea how many users run TwoCan on a Mac, and on what models of a Mac, however, there have been no reports to date of problems with TwoCan and OpenCPN 5.6.2 on Macs.
stevead is offline   Reply With Quote
Old 15-06-2023, 09:59   #251
Registered User

Join Date: Apr 2023
Posts: 36
Re: Twocan - a new Plugin

Thanks Steve--

I've once again attempted to completely remove OpenCPN and all related files. I trashed the application, which if I do a "Show package contents" has directories, including plugins. There was a directory in Library-->Application Support called "OpenCPN", and there was a directory in Library-->Preferences called "opencpn". I trashed those and emptied the Trash. I also trashed the log file. I can't find any other OpenCPN related files.

I re-downloaded and installed OpenCPN 5.6.2. Before doing anything else I installed and enabled TwoCan. The "Preferences" button is, once again, greyed out. Screenshot attached. A .pdf of the log file is attached. For future reference, how can I upload the log file? The uploader refused to accept a .log. The .txt was too large.

If I go to Library-->Application Support-->OpenCPN-->Contents-->Plugins there is one file, libtwocan_plugin_pi.dylib.jail Since that entire directory was trashed before re-installing 5.6.2, it doesn't seem like it was the upgrade to 5.8.2 that "jailed" the plugin.

Any ideas?

Thanks
Attached Thumbnails
Click image for larger version

Name:	image (1).jpg
Views:	30
Size:	90.1 KB
ID:	276758  
Attached Files
File Type: pdf opencpn.pdf (83.0 KB, 16 views)
Bella Donna is offline   Reply With Quote
Old 16-06-2023, 00:25   #252
Registered User

Join Date: Mar 2011
Posts: 725
Re: Twocan - a new Plugin

From the log file the plugin is being "jailed". The log file indicates that a dependency libKvaserCAN.0.2.1.dylib could not be loaded.

Could you check if indeed the file libKvaserCAN.0.2.1.dylib is present. It should be in the TwoCan drivers folder along with libToucan.0.2.3.dylib. I know it is present and installed from the tarball.

I am not a Mac user and am not familiar with OSX 13, so I have no idea what the problem is. To date there have been no reports from other users with problems similar to yours.

Would gratefully appreciate some insight from other Mac users.
stevead is offline   Reply With Quote
Old 16-06-2023, 11:03   #253
Registered User

Join Date: Apr 2023
Posts: 36
Re: Twocan - a new Plugin

Hi Steve--

Yes, both of those files are there. Screenshot attached.

Any suggestions?

I don't think I explained why I'm wanting to get TwoCan working. Maybe you can advise me if I'm going down a rabbit hole that ultimately will be a dead-end.

I have a Yacht Devices fluid level monitor that outputs NMEA 2000 data, that I want to use to display my water and fuel levels in OpenCPN, using the Engine Dashboard plugin. The Engine Dashboard plugin page says "you can either use the TwoCan plugin version 1.6 and later or you can use the built-in NMEA2000® support that is available in OpenCPN version 5.8 and later". I'm getting levels data in the NMEA debug window, but from what I understand, according to the Yacht Devices folks, the NMEA 0183 Standard has no sentences for fluid level, so I guess that's why I'm seeing data, but the Engine Dashboard isn't getting what it needs to show the levels. I don't know how to set things to "use the built-in NMEA2000® support" in v5.8, but Engine Dashboard gauges don't work in either v5.6 or v5.8.

So my question is, for my needs, when we get TwoCan working on my setup, will it be able to translate the levels data to NMEA 0183 in a format that Engine Dashboard can use? I'll attach a screenshot of the data I'm seeing in the debug window.

Otherwise, does anyone know how to use the built-in NMEA 2000 support in OpenCPN to translate NMEA 2000 levels data to NMEA 0183 levels data?
Attached Thumbnails
Click image for larger version

Name:	image (2).jpg
Views:	37
Size:	97.0 KB
ID:	276805   Click image for larger version

Name:	image (3).jpg
Views:	38
Size:	461.8 KB
ID:	276809  

Bella Donna is offline   Reply With Quote
Old 17-06-2023, 04:01   #254
Registered User

Join Date: Mar 2011
Posts: 725
Re: Twocan - a new Plugin

If the two "driver" files are present I don't know why they are not found when the OpenCPN plugin manager is attempting to load the TwoCan plugin.

I am not aware of any users reporting a similar program.

Could you check the relative paths (rpath) for the twocan dynamic library libtwocan_plugin_pi.dylib by using the otool command (if I recall with the -l option).

Something like otool -l /Users/doug/
Library/Application Support/OpenCPN/Contents/PlugIns/libtwocan_plugin_pi.dylib

On your system there seems to be something weird with the search paths.

Re your NMEA Debug Window, what. you are seeing appears to be some proprietsry NMEA 183 sentence that encodes NMEA 2000 messages. I have no idea what 3rd party multiplexer or gateway you are using but suffice to say neither TwoCan or to the best of my knowledge OpenCPN support proprietary NMEA 183 encoding of NMEA 2000 over TCP or UDP.
stevead is offline   Reply With Quote
Old 17-06-2023, 09:19   #255
Registered User

Join Date: Apr 2023
Posts: 36
Re: Twocan - a new Plugin

The only file I can find with that name is the jailed one at Users-->Doug-->Library-->Application Support-->OpenCPN-->Contents-->Plugins-->libtwocan_plugin_pi.dylib.jail

Terminal output:

doug@Dougs-Air ~ % otool -l /Users/doug/Library/Application\ Support/OpenCPN/Contents/PlugIns/libtwocan_plugin_pi.dylib
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
doug@Dougs-Air ~ %
Bella Donna is offline   Reply With Quote
Reply

Tags
plug


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
New IAC Fleetcode Plugin for OpenCPN CBorchardt OpenCPN 77 23-04-2019 05:40
Plugin development... How to receive chart objects in my plugin? dmartinez OpenCPN 6 04-08-2017 00:56
New History Plugin for OpenCPN seandepagnier OpenCPN 11 04-10-2010 14:11

Advertise Here


All times are GMT -7. The time now is 01:54.


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.