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 05-06-2019, 05:41   #31
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,752
Images: 2
Re: Twocan - a new Plugin

We've fixed the problem with the Driver and Log DLL's, they are now included with the NSIS package and they install properly in the

Code:
C:\Program Files (x86)\[OpenCPN 5.0.0+366a490d]\plugins\twocan_pi\data\drivers
directory. See this appveyor artifact, Beta users can download and try it out, to check the operation.
https://ci.appveyor.com/project/rgle...8588/artifacts
My Twocan repository is here https://github.com/rgleason/TwoCanPlugIn/commits/master

Now there is one last problem with reading and writing the opencpn.ini section of Twocan.
I enter this into the the opencpn.ini file manually:

Code:
[PlugIns/TwoCan]
        Adapter=C:\\Program Files (x86)\\OpenCPN         5.0.0+366a490d\\plugins\\twocan_pi\\drivers\\kvaser.dll
        PGN=0
        Log=C:\\Program Files (x86)\\OpenCPN         5.0.0+366a490d\\plugins\\twocan_pi\\drivers\\kvaserlog.dll
        Mode=0
        Address=0
        Heartbeat=0
        [PlugIns/twocan_pi.dll]
        bEnabled=0
(Do I have the files properly located above?)

and then start opencpn and enable twocan.
The Adapter dropdown shows nothing in the dropdown.
I "apply" the plugin and then the opencpn.ini file becomes

Code:
[PlugIns/TwoCan]
          Adapter=0
          PGN=0
          Log=0
          Mode=0
          Address=0
          Heartbeat=0
          [PlugIns/twocan_pi.dll]
          bEnabled=0
See the screenshot please.
Is there a programmer who can fix this small problem?
Attached Thumbnails
Click image for larger version

Name:	TwoCan Nmea2000 Interfaces.jpg
Views:	130
Size:	126.7 KB
ID:	193286  
rgleason is offline   Reply With Quote
Old 05-06-2019, 05:49   #32
bcn
Registered User

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

Steve,

why about support for the Actisense CAN adapters?
Windows...

Hubert
bcn is offline   Reply With Quote
Old 05-06-2019, 06:34   #33
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,752
Images: 2
Re: Twocan - a new Plugin

Let's get it working first! Ok?



Quote:
Originally Posted by bcn View Post
Steve,

why about support for the Actisense CAN adapters?
Windows...

Hubert
rgleason is offline   Reply With Quote
Old 05-06-2019, 06:48   #34
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,752
Images: 2
Re: Twocan - a new Plugin

Since opening and reading the log file is an issue, the twocanlogreader.cpp file
line 47 seems to have code that tries to do that:


Quote:
int TwoCanLogReader::Open(const wchar_t *fileName) {
// Open the log file
logFileName = wxString::Format("%s/%s", wxStandardPaths::Get().GetDocumentsDir(),fileName) ;

wxLogMessage(_T("TwoCanLogReader::Open, Opening log file: %s"),logFileName);

logFileStream.open(logFileName, std::ifstream::in);

if (logFileStream.fail()) {
return SET_ERROR(TWOCAN_RESULT_FATAL, TWOCAN_SOURCE_DRIVER,TWOCAN_ERROR_FILE_NOT_FOUND);
}
There are several sections below this that have "//bug bug"
I don't yet know how this is set from within the plugin.

I think the adapters are set by the dropdown, but no devices appear. I think this is done in the twocandevice.cpp where there are also several "//bug bug" notices.

Perhaps this is something Steven will have to fix, rather than someone else.
rgleason is offline   Reply With Quote
Old 05-06-2019, 07:05   #35
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,752
Images: 2
Re: Twocan - a new Plugin

Quote:
Originally Posted by rgleason View Post
Let's get it working first! Ok?
Steven wrote in post #3

Quote:
I appreciate that few OpenCPN users possess the PC hardware adapters to connect to their NMEA2000 networks so I expect that there is little if any test coverage.

However if any OpenCPN users with other NMEA 2000 gateways (such as Actisense, Yacht Devices) or modern Multi Function Displays from Garmin or Navionics (Simrad, B & G) can capture NMEA2000 logs and forward those to twocanplugin@hotmail.com then that will provide more data with which to validate the conversions. This is especially important for AIS & DSC as I personally have yet to see live AIS & DSC data on a NMEA2000 network !

I believe you can use Wireshark to capture these data streams as has been done for radar_pi


https://www.wireshark.org/
rgleason is offline   Reply With Quote
Old 05-06-2019, 07:07   #36
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,752
Images: 2
Re: Twocan - a new Plugin

I think we need a brief step by step summary for how to get this plugin working and how to test it.
rgleason is offline   Reply With Quote
Old 07-06-2019, 02:28   #37
Registered User

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

Rick,

Absolutely brilliant for creating the package & installation for the TwoCan Windows plug-in drivers. Can’t thank you enough.

Regarding the missing interfaces in the drop down, best way to diagnose is to look in opencpn.log. The plugin logs messages and errors in the standard opencpn.log file. Major problem will be either a missing TwoCan_pi\drivers directory or no drivers present in that directory. There may also be more complicated reasons if the drivers’ functions have not been exported correctly (compile or linker ?) and cannot be invoked.

The opencpn.ini entry for the TwoCan setting “Log” is an integer representing what log format the plugin uses to save received nmea2000 messages. 0 means no logging, 1 means log using the TwoCan raw format (12 pairs of hex characters). It is not a log file name or path.

The four log file readers: TwoCan Raw, Candump, Kees and YachtDevices use hardcoded logfile names and a hardcoded folder (for Windows it is My Documents).I think I’ve documented the hardcoded logfile names in both the TwoCan plugin drivers readme.md file and in the beta plugins user manual.

To answer the other questions:
Antisense driver, only required for the NGT-1 as the NGW-1 does the conversion to NMEA0183. I can look at the api’s for interfacing with the NGT-1 but it’s not on my list of priorities and I don’t have one to test against.

My priorities are fixing bugs, verifying the accuracy of decoding, refactoring decoding/encoding to implement bi-directional support and adding additional pgn’s such as route & waypoint. Oh and learning more about wxWidgets, crake, git & nsis!

Sample data, I don’t need to capture data with wireshark, unfortunately I can almost decode NMEA2000 messages in my sleep, I just need the sample data in whatever format for AIS and DSC NMEA2000 messages to verify against.

Thanks to all.
stevead is offline   Reply With Quote
Old 07-06-2019, 02:46   #38
Registered User

Join Date: Sep 2012
Location: Baikal
Posts: 584
Re: Twocan - a new Plugin

Does this plugin Engine support?
Baikal is offline   Reply With Quote
Old 07-06-2019, 03:29   #39
Registered User

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

No.

From a NMEA2000 point of view, very easy to add support to decode the relevant pgn’s and convert to NMEA0183 RPM sentences however the problem then becomes how to display the data.

At present the dashboard plugin does not support the NMEA0183 rpm sentence. Extending the dashboard has undergone discussion so it may be prudent to follow up on that thread.

If Engine and other related NMEA2000 data (transmission, alternator, battery, charger etc) is important to you, then perhaps Openplotter (which incorporates OpenCPN) and Signal K are a better solution for you to visualise that specific data.
stevead is offline   Reply With Quote
Old 07-06-2019, 03:59   #40
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,752
Images: 2
Re: Twocan - a new Plugin

Quote:
Originally Posted by stevead View Post
Regarding the missing interfaces in the drop down, best way to diagnose is to look in opencpn.log. The plugin logs messages and errors in the standard opencpn.log file. Major problem will be either a missing TwoCan_pi\drivers directory or no drivers present in that directory. There may also be more complicated reasons if the drivers’ functions have not been exported correctly (compile or linker ?) and cannot be invoked.
Ok, I've made a PR and Merged your two PGN's and appveyor has built a new version, using the previous dlls. Available here I've installed it and now the drop down selection is working (I don't know what the problem was before!) In that I can use the dropdown and select a file. However no matter what file I select, there is a spinning wheel and Opencpn bombs out. You will see that the last log entry is twocan.


Also the kvaser.dll seems to have a problem/error.
Please see the cutdown log file attached.



Quote:

The opencpn.ini entry for the TwoCan setting “Log” is an integer representing what log format the plugin uses to save received nmea2000 messages. 0 means no logging, 1 means log using the TwoCan raw format (12 pairs of hex characters). It is not a log file name or path.
Ok, it seems that the plugin has that all figured out and protected. It won't let me screw it up by entering the path name! Now understood, but I thought we had to enter a pathname and file somewhere to get the plugin working. Where exactly is that supposed to be done?


Quote:

The four log file readers: TwoCan Raw, Candump, Kees and YachtDevices use hardcoded logfile names and a hardcoded folder (for Windows it is My Documents).I think I’ve documented the hardcoded logfile names in both the TwoCan plugin drivers readme.md file and in the beta plugins user manual.
Where are you telling me to put the "log file readers"? In My Documents?
Are these the files?
  • candumplog.dll
  • keeslog.dll
  • yachtdeviceslog.dll
  • What is the fourth one? filedevice.dll or "twocan raw"? Is this a log file?
Note, the plugin now puts all the dlls below into

C:\Program Files (x86)\OpenCPN 5.0.0+20c9a05\plugins\twocan_pi\data\drivers

  • axiomtek.dll
  • candumplog.dll
  • cantact.dll
  • filedevice.dll
  • keeslog.dll
  • kvaser.dll
  • yachtdeviceslog.dll
Do some of these files have to go somewhere else? If so, where?



Quote:
To answer the other questions:
Antisense driver, only required for the NGT-1 as the NGW-1 does the conversion to NMEA0183. I can look at the api’s for interfacing with the NGT-1 but it’s not on my list of priorities and I don’t have one to test against.

My priorities are fixing bugs, verifying the accuracy of decoding, refactoring decoding/encoding to implement bi-directional support and adding additional pgn’s such as route & waypoint. Oh and learning more about wxWidgets, crake, git & nsis!

Sample data, I don’t need to capture data with wireshark, unfortunately I can almost decode NMEA2000 messages in my sleep, I just need the sample data in whatever format for AIS and DSC NMEA2000 messages to verify against.

Thanks to all.
Steve, how would one record this data if they had an Artisense NGT-1?


PS: This engine data support question comes up more often now. The programmers appear to be reluctant to add too much data to the existing nmea messaging system perhaps because they are concerned it will require a more robust message system. I am not really the one who should be writing about this as I know very little about it.
Attached Files
File Type: doc Twocan-Errors.doc (5.1 KB, 44 views)
rgleason is offline   Reply With Quote
Old 07-06-2019, 04:04   #41
bcn
Registered User

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

Steve..

we have three N2K gateways on the ship: 1x NGW, 1x NGT and a NGT clone.
As you know, the NGW is bandwidth limited and you can select some N2K sentences, but not all of them.
I'm looking for a simple solution, that's why I'm asking for the Actisense support.
Sure, OpenPlotter, CANBoat and N2K can be a way. But I would like to keep that part as simple as possible.
I would suppose that the CANboat repository should have all the code and information how to integrate Actisense.
But obviously your are the one setting your priorities.

Hubert
bcn is offline   Reply With Quote
Old 07-06-2019, 04:14   #42
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,752
Images: 2
Re: Twocan - a new Plugin

Right now the plugin is looking for the drivers in:


Quote:
C:\Program Files (x86)\OpenCPN 5.0.0+20c9a05\plugins\twocan_pi\drivers\keeslog.dl l
When actually they are being installed in:


Quote:
C:\Program Files (x86)\OpenCPN 5.0.0+20c9a05\plugins\twocan_pi\data\drivers\keeslog.dll
This results in a blank dropdown menu. What do you want to do about it?
I know that NSIS does include everything in the "data" folder. I do not know what will happen when I move the drivers folder up one level. Would you like me to try this? -- Where do you want it to be?


We also have the OpenCPN crash to deal with after selection of the file.
Attached Thumbnails
Click image for larger version

Name:	Screenshot (151).jpg
Views:	93
Size:	264.9 KB
ID:	193432  
rgleason is offline   Reply With Quote
Old 07-06-2019, 04:15   #43
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,752
Images: 2
Re: Twocan - a new Plugin

Quote:
Originally Posted by bcn View Post
Steve..

we have three N2K gateways on the ship: 1x NGW, 1x NGT and a NGT clone.
As you know, the NGW is bandwidth limited and you can select some N2K sentences, but not all of them.
I'm looking for a simple solution, that's why I'm asking for the Actisense support.
Sure, OpenPlotter, CANBoat and N2K can be away. But I would like to keep that part as simple as possible.
I would suppose that the CANboat repository should have all the code and information how to integrate Actisense.
But obviously your are the one setting your priorities.

Hubert
Hubert, he does not have one. He needs the recorded data too. I would provide it if I had the device, (since he is one of the few people that can decode in his sleep ).
rgleason is offline   Reply With Quote
Old 07-06-2019, 04:25   #44
Registered User

Join Date: Sep 2012
Location: Baikal
Posts: 584
Re: Twocan - a new Plugin

Quote:
Originally Posted by stevead View Post
No.

From a NMEA2000 point of view, very easy to add support to decode the relevant pgn’s and convert to NMEA0183 RPM sentences however the problem then becomes how to display the data.

At present the dashboard plugin does not support the NMEA0183 rpm sentence. Extending the dashboard has undergone discussion so it may be prudent to follow up on that thread.

If Engine and other related NMEA2000 data (transmission, alternator, battery, charger etc) is important to you, then perhaps Openplotter (which incorporates OpenCPN) and Signal K are a better solution for you to visualise that specific data.
Yeah!
Dashboard is obsolete! both in design and in functionality!
I have Windows, on the CoastalExplorer program a functional dashboard.
Baikal is offline   Reply With Quote
Old 07-06-2019, 04:36   #45
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,752
Images: 2
Re: Twocan - a new Plugin

This version puts the plugin drivers in both places, and should work. Where do you want the drivers to be located Steven?

https://ci.appveyor.com/project/rgle...6996/artifacts
rgleason 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 22:02.


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.