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 01-02-2025, 18:57   #301
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

Re: log of 0183 messages/sentences being sent to OpenCPN, here is a copy from my NMEA Debug Window:
Code:
<MAROON>20:52:46 (/dev/ttyACM0) $GPGSV,4,3,13,20,68,007,11,25,31,287,27,29,14,318,19,46,30,247,*76<0x0D><0x0A>
<MAROON>20:52:46 (/dev/ttyACM0) $GPGSV,4,4,13,48,34,244,30*41<0x0D><0x0A>
<GREEN>20:52:46 (/dev/ttyACM0) $GPGLL,2657.85624,N,08205.58595,W,015246.00,A,D*7A<0x0D><0x0A>
<GREEN>20:52:46 (N2000) PGN: 130306 Source: nmea2000 socketCAN-can0 ID: 0  Desc: DBoard: Wind data

<GREEN>20:52:46 (N2000) PGN: 128259 Source: nmea2000 socketCAN-can0 ID: 35  Desc: DBoard: Speed through water

<GREEN>20:52:46 (N2000) PGN: 130310 Source: nmea2000 socketCAN-can0 ID: 35  Desc: DBoard: Envorinment data

<GREEN>20:52:46 (N2000) PGN: 130311 Source: nmea2000 socketCAN-can0 ID: 35  Desc: Environmental parameters. Not used by OCPN, maybe by Plugins

<GREEN>20:52:46 (N2000) PGN: 128275 Source: nmea2000 socketCAN-can0 ID: 35  Desc: DBoard: Distance log

<GREEN>20:52:46 (N2000) PGN: 65309 Source: nmea2000 socketCAN-can0 ID: 0  Desc: No description. Not used by OCPN, maybe passed to plugins

<GREEN>20:52:46 (virtual) $IIMWV,192.55,R,0.00,N,A*37<0x0D><0x0A>
<GREEN>20:52:46 (virtual) $IIVHW,,T,,M,0.00,N,0.00,K*55<0x0D><0x0A>
<GREEN>20:52:46 (virtual) $IIMTW,27.51,C*22<0x0D><0x0A>
<GREEN>20:52:46 (virtual) $IIMTW,27.51,C*22<0x0D><0x0A>
<GREEN>20:52:46 (N2000) PGN: 130306 Source: nmea2000 socketCAN-can0 ID: 0  Desc: DBoard: Wind data

<GREEN>20:52:46 (virtual) $IIMWV,192.55,R,0.00,N,A*37<0x0D><0x0A>
<GREEN>20:52:46 (N2000) PGN: 128259 Source: nmea2000 socketCAN-can0 ID: 35  Desc: DBoard: Speed through water

<GREEN>20:52:46 (N2000) PGN: 130316 Source: nmea2000 socketCAN-can0 ID: 35  Desc: Temperature extended range. Not used by OCPN, maybe by Plugins

<GREEN>20:52:46 (virtual) $IIVHW,,T,,M,0.00,N,0.00,K*55<0x0D><0x0A>
<GREEN>20:52:46 (virtual) $IIMTW,27.51,C*22<0x0D><0x0A>
<GREEN>20:52:46 (N2000) PGN: 128259 Source: nmea2000 socketCAN-can0 ID: 35  Desc: DBoard: Speed through water

<GREEN>20:52:46 (virtual) $IIVHW,,T,,M,0.00,N,0.00,K*55<0x0D><0x0A>
<GREEN>20:52:46 (N2000) PGN: 130306 Source: nmea2000 socketCAN-can0 ID: 0  Desc: DBoard: Wind data

<GREEN>20:52:46 (virtual) $IIMWV,192.55,R,0.06,N,A*31<0x0D><0x0A>
<GREEN>20:52:46 (N2000) PGN: 130311 Source: nmea2000 socketCAN-can0 ID: 35  Desc: Environmental parameters. Not used by OCPN, maybe by Plugins

<GREEN>20:52:46 (virtual) $IIMTW,27.51,C*22<0x0D><0x0A>
<GREEN>20:52:47 (N2000) PGN: 130306 Source: nmea2000 socketCAN-can0 ID: 0  Desc: DBoard: Wind data

<GREEN>20:52:47 (N2000) PGN: 128259 Source: nmea2000 socketCAN-can0 ID: 35  Desc: DBoard: Speed through water

<GREEN>20:52:47 (virtual) $IIMWV,192.55,R,0.12,N,A*34<0x0D><0x0A>
<GREEN>20:52:47 (virtual) $IIVHW,,T,,M,0.00,N,0.00,K*55<0x0D><0x0A>
<GREEN>20:52:47 (/dev/ttyACM0) $GPRMC,015247.00,A,2657.85634,N,08205.58602,W,0.195,,020225,,,D*64<0x0D><0x0A>
<MAROON>20:52:47 (/dev/ttyACM0) $GPVTG,,T,,M,0.195,N,0.360,K,D*2E<0x0D><0x0A>
<GREEN>20:52:47 (/dev/ttyACM0) $GPGGA,015247.00,2657.85634,N,08205.58602,W,2,08,1.19,7.3,M,-26.8,M,,0000*60<0x0D><0x0A>
<MAROON>20:52:47 (/dev/ttyACM0) $GPGSA,A,3,11,05,12,48,19,20,13,25,,,,,2.53,1.19,2.24*0E<0x0D><0x0A>
<MAROON>20:52:47 (/dev/ttyACM0) $GPGSV,4,1,13,05,65,247,35,06,24,062,15,09,04,039,15,11,48,029,27*7E<0x0D><0x0A>
<MAROON>20:52:47 (/dev/ttyACM0) $GPGSV,4,2,13,12,46,239,29,13,20,160,21,15,08,193,,19,23,124,12*71<0x0D><0x0A>
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Old 01-02-2025, 19:14   #302
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

Attaching my OpenCPN config file:
Attached Files
File Type: doc P39-2_opencpn.doc (59.0 KB, 6 views)
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Old 01-02-2025, 19:25   #303
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

Steve, yes, there are a total of 6 plugins installed and enabled. Should I uninstall all except TwoCan?
Screenshot attached
Attached Thumbnails
Click image for larger version

Name:	20250201_21h23m00s_grim.jpg
Views:	10
Size:	216.5 KB
ID:	298260  
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Old 01-02-2025, 19:53   #304
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

And here is my attempt to implement the vcan0 test:
Code:
mav@raspberrypi:~ $ sudo modprobe can-raw
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
RTNETLINK answers: File exists
mav@raspberrypi:~ $ candump vcan0
^Cmav@raspberrypi:~ $
Nothing happens, so I cntrl-C the candump.

Yes, I selected vcan0 as the TwoCan preference for NMEA 2000 interface, and made sure I'd unchecked 129025 Position (GLL) which is one of the 0183 sentences coming into OpenCPN from my GPS sensor.

I also set up a new connection socketcan ; vcan0, but opencpn nmea debug window shows no output messages. But at least pressing OK on the TwoCan preferences did not crash OpenCPN with vcan0 as the interface.
But if I then go on to the DEVICE tab and check Active Mode, and Bi-directional, it does crash opencpn just as with can0 as the interface.
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Old 01-02-2025, 22:34   #305
Registered User

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

You already have a connection for can0 configured in OpenCPN.

Configuring a connection in both OpenCPN and TwoCan for the same socket CAN interface from my perspective is not a supported configuration, is untested and any resulting behaviour is undefined.
stevead is offline   Reply With Quote
Old 01-02-2025, 22:59   #306
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

Yes, of course you are right. I've had to reinstall the RPi back on the boat for tomorrow's race, but I'll change the setup to only TwoCan getting the can0 interface tomorrow night. Thanks for your help with this.
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Old 03-02-2025, 08:55   #307
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

Quote:
Originally Posted by stevead View Post
You already have a connection for can0 configured in OpenCPN.

Configuring a connection in both OpenCPN and TwoCan for the same socket CAN interface from my perspective is not a supported configuration, is untested and any resulting behaviour is undefined.
I removed the connection to can0 in OpenCPN. My only connection there now is a single 0183 at 4800 baud to my gps sensor. OpenCPN is receiving N2K data translated to 0183 sentences
Code:
$IIVHW,,T,,M,0.00,N,0.00,K*55
$IIMTW,26.93,C*2D
$IIMWV,209.75,R,0.19,N,A*3C
$IIVHW,,T,,M,0.00,N,0.00,K*55
$IIMWV,209.78,R,0.14,N,A*3C
$IIMTW,26.92,C*2C
$IIVHW,,T,,M,0.00,N,0.00,K*55
$IIMWV,209.81,R,0.21,N,A*3C
$IIVHW,,T,,M,0.00,N,0.00,K*55
$IIMWV,209.80,R,0.27,N,A*3B
But when I check Enable Active Mode/Apply/OK OpenCPN still crashes.
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Old 03-02-2025, 21:52   #308
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

Does anyone have the TwoCan plugin for OpenCPN running on any LINUX machine connected to an NMEA 2000 network?
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Old 04-02-2025, 07:39   #309
Registered User

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

I don't doubt that you are experiencing a problem, but I can't replicate it on the hardware that I have at my disposal which is a Raspberry Pi 4 Model B Rev 1.4 running Debian GNU/Linux 12 (bookworm), OpenCPN 5.10.2 and TwoCan 2.2

I have an old Pharos GPS connected via a Serial USB connection as /dev/ttyUSB0 at 4800 baud, and a Pican-M CAN bus adapter.

It works as expected, even using a configuration where both OpenCPN and TwoCan are configured to use can0 (just causes duplication of position information). TwoCan is correctly converting NMEA 0183 position related sentences (GLL, GGA) to PGN's 129025, 129026 & 129029 and these are shown correctly on a B&G Triton display

My only suggestion would be start with a clean configuration, just with a single serial connection to your GPS (which by the way doesn't appear to be generating any NMEA 0183 position information in your previous NMEA Debug capture) no NMEA 0183 filters, and TwoCan with just a connection to can0, no PGN's checked and Active Mode, Heartbeats and Bi-Directional Gateway enabled.

Alternatively a complete new install or run OpenCPN under the debugger (GDB).
Attached Thumbnails
Click image for larger version

Name:	IMG20250205004757.jpg
Views:	5
Size:	399.2 KB
ID:	298322   Click image for larger version

Name:	IMG20250205004813.jpg
Views:	5
Size:	401.4 KB
ID:	298323  

Click image for larger version

Name:	IMG20250205004723.jpg
Views:	4
Size:	389.4 KB
ID:	298324  
stevead is offline   Reply With Quote
Old 05-02-2025, 09:52   #310
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

I'm also on the RPi model 4B but running the flatpak provided bookworm o/s.

The window I show in my post #307 is not from OpenCPN NMEA debug. It is from the TwoCan debug window. I was not in Active mode, of course. Does that explain the absence of gps sentences that you noted? My gps sensor certainly shows much data incoming to OpenCPN via my /dev/tty/ACMO USB connection at 4800 baud as you can see in my post #301.

My TwoCan is 2.2.2.0 aarch64_flatpak from your cloudsmith tarball github site. Specifically:https://cloudsmith.io/~steven-adler/...+2319.e42759a/

I downloaded it, then imported it into OpenCPN plugins. Is this the exact same TwoCan you are successfully running, Steve? I see on the Cloudsmith site there is also a tarball for a Debian-armf-12-bookworm version of TwoCan:
https://cloudsmith.io/~steven-adler/...+2321.e42759a/
Are you perhaps running that plugin? Should i try it for my RPi?
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Old 05-02-2025, 10:11   #311
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

Could you please clarify what you mean for "Alternatively a complete new install...". A new install of ?
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Old 05-02-2025, 10:20   #312
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

I found this re:GDB on another forum thread, Re: Mint 19.1: OpenCPN 5.0.0 from Ubuntu ppa crashes on startup:

Install GDB
Code:
sudo apt-get install gdb
point the debugger to OpenCPN
Code:
gdb /usr/bin/opencpn
Start the process
Code:
run
Let it crash and then generate the backtrace
Code:
bt
Is this how I should get and run the GNU debugger for my TwoCan problem?
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Old 05-02-2025, 14:59   #313
Registered User

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

I'm currently running the "native" version of OpenCPN & TwoCan, not the flatpak versions. I'll install flatpak and test the flatpak versions.

By complete new install, I meant just find an empty SD card, install a fresh image of Raspberry PI OS (64 bit) and OpenCPN and then import the TwoCan plugin (twocan_plugin_pi-2.2.2.0-debian-arm64-12-bookworm-arm64.tar.gz) and see how that goes. Remember to note down your boot config.txt settings for your Pican-M adapter and the socket can initialization stuff.

The other thing worth investigating is incrementally add filters for the incoming GPS sentences. Start with RMC then successively add, GLL, GGA, GSV, VDM and see if any of those cause a problem. If you can possibly upload a log the incoming NMEA 0183 traffic I can replay it.

Re GDB, the commands you've found are correct.

Thanks for your perseverance.
stevead is offline   Reply With Quote
Old 05-02-2025, 20:17   #314
Registered User

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

Just installed the flatpak version and can confirm the behaviour that you are seeing, in that enabling Active Mode causes a crash.

Makes little sense to me as it used to work on all supported platforms and I doubt that piece of code has been changed since the feature was originally implemented.

I'll look into it, but the obvious workaround is to install the native (non flatpak) versions of both OpenCPN and TwoCan.
stevead is offline   Reply With Quote
Old 05-02-2025, 23:07   #315
Registered User
 
Pearson 39-II's Avatar

Join Date: Jul 2021
Location: Punta Gorda, FL
Boat: Pearson 39-2 , 39' 3"
Posts: 35
Re: Twocan - a new Plugin

I misspoke re: my installation of Bookworm. It was not under flatpak it is:
Code:
cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
So I left the o/s as is and preserved the config.txt settings for Pican-M adapter and the socket can initialization setup.

It was OpenCPN that was installed under flatpak, then later your TwoCan 2.2.2 tarball for flatpak.
So, I uninstalled OpenCPN, and then was reminded why I had given up trying install "native" OpenCPN from the debian repositories and used flatpak instead. Even the latest instructions in the OpenCPN manual for RPi install do not work or when you realize you have to use the Debian backports I still cannot follow the required process.

So I'll post what I found on backport instructions and then these forums, if only to save myself time when I have to do this all again:
Code:
sudo nano /etc/apt/sources.list
then in the nano editor add the line: "deb Index of /debian bookworm-backports main" to the sources.list file
Code:
sudo apt-get update
sudo apt-get install opencpn
And it installed OpenCPN 5.10.2, reporting:
Code:
Get:21 http://deb.debian.org/debian bookworm-backports/main arm64 opencpn arm64 1:5.10.2+dfsg-1~bpo12+1 [6,847 kB]
I then downloaded from your Cloudsmith repository at
HTML Code:
https://cloudsmith.io/~steven-adler/repos/twocanplugin-alpha/packages/
The TwoCan plugin tarball "twocan_plugin_pi-2.2.2.0-debian-arm64-12-bookworm-arm64.tar.gz".
Unlike the failed attempt to import this plugin within the flatpak OpenCPN 5.10.2 it did import well within the "native" OpenCPN. And, best of all, configuring TwoCan preferences for Active mode, heartbeat, and bi-directional does not crash OpenCPN.
During the OpenCPN install it defaulted to opening a socketcan can0 connection which did prevent TwoCan from working, but removing that connection so only TwoCan get that fixed the problem, I think.
Just beginning to test all this. More later.
__________________
Raspberry Pi 4B
64-bit Raspian [Debian] 12 O/S "Bookworm"
OpenCPN 5.10....
Pearson 39-II is offline   Reply With Quote
Reply

Tags
plug

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 78 23-01-2025 11:34
Plugin development... How to receive chart objects in my plugin? dmartinez OpenCPN 6 04-08-2017 01:56
New History Plugin for OpenCPN seandepagnier OpenCPN 11 04-10-2010 15:11

Advertise Here


All times are GMT -7. The time now is 10:35.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2025, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.