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 05-10-2021, 00:12   #1
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 286
Shadowing OpenCPN with devices running iNavX

Running a tablet or phone as a repeater for OpenCPN is unsatisfactory - in my opinion. Viewing OpenCPN on such a small screen gives a poor experience. Further, if OpenCPN were to fail, the repeater will also fail. There is no resilience.

There are navigational applications better optimised for these devices and more robust. I use iNavX, which is available on iOS (iPad and iPhone) and Android devices.

If OpenCPN is being used as the main planning tool and navigational application, iNavX needs to shadow OpenCPN and keep synchronised with any changes in the navigation.

I have a script for the JavaScript plugin that causes iNavX to shadow OpenCPN by adopting any active waypoint or route. As you advance along the route, iNavX will also advance. If you amend the route in OpenCPN by adding or moving routepoints, iNavX will update accordingly.

Importantly, in the event that OpenCPN were to fail, iNavX will continue to navigate from its own ship’s navigational feed. If that feed were to fail, a device with its own GPS receiver will switch to using that. This provided essential resilience.

I have an iPad running iNavX at the wheel station, which is the helm's main navigational aid. I also have iNavX running on my iPhone and I can review progress from the comfort of my bunk, without having to turn out.
Antipole is offline   Reply With Quote
Old 15-10-2021, 17:20   #2
Registered User

Join Date: Nov 2018
Location: San Diego
Boat: Shannon 50 Ketch
Posts: 730
Re: Shadowing OpenCPN with devices running iNavX

I love this idea - I use OCPN down below and iNavX/iPad at the helm. I was very excited when I read this post, I downloaded your script and the JS plugin immediately and tried to run the script, but I get:

JavaScript ReferenceError: identifier 'onSeconds' undefined

I'm on OSx11.4 running OCPN 5.2.4+6b314e6 (current most recent version).

I don't know much about JS but I am wondering if the script is expecting onSeconds to be part of JS runtime and it is not there.

Would love to see this working at some point. If there is something I can do to get this to work I am anxious to try!

Note: I am assuming this JS reference error means the script will not work, so I have not actually tried to connect my iPad and try it out. From what I could gather looking at the code, without onSeconds listenOut will never get called after the first time, so it won't work, therefore I did not bother trying.

Any ideas if there is a way to fix this? Maybe update some JS runtime or something (which I don't know if that is even a thing!). Thanks.
jordanbigel is offline   Reply With Quote
Old 16-10-2021, 01:46   #3
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 286
Re: Shadowing OpenCPN with devices running iNavX

Quote:
Originally Posted by jordanbigel View Post
I get:

JavaScript ReferenceError: identifier 'onSeconds' undefined
Very strange, especially as I am using MacOS 11.6! Please ty this simple test script:

Code:
print (OCPNgetPluginConfig(), "\n");
onSeconds(timesUp, 1);

function timesUp(){
	print("Time is up\n");
	}
It should just display the plugin configuration and then, after 1 second, the Time is up message and then result: undefined.

If this fails, best to raise an issue here.

Not connected to your present issue, but please take a fresh copy of the sendActiveRoute.js script as I have just fixed a bug in it.
Antipole is offline   Reply With Quote
Old 16-10-2021, 07:37   #4
Registered User

Join Date: Nov 2018
Location: San Diego
Boat: Shannon 50 Ketch
Posts: 730
Re: Shadowing OpenCPN with devices running iNavX

I gather this is not what we want to see.

JavaScript ReferenceError: identifier 'OCPNgetPluginConfig' undefined

Am I doing this wrong? Are there 2 different JS plugins maybe I have the wrong one?? I also tried to change 'OCPNgetPluginConfig' to 'OCPNGetPluginConfig' - but that didn't change anything.

Okay, now, a quick google search for "OCPNgetPluginConfig" led me to another JS which you posted (https://gist.github.com/antipole2/70...2ac6059b98a4d3) - and in THAT script I found this code:

try {config = OCPNgetPluginConfig();}
catch(err){thow("This test script not for JavaScript plugin versions before v0.3");}

And then that led me to verify my JS plugin version number which I found is 0.2 not 0.3 - so that explains why this is not working I think.

So the question now is where do I get v0.3 of the jS plugin - this is where I downloaded the JS plugin.

https://opencpn.org/OpenCPN/plugins/javascript.html

I think this is the official OCPN plugin page, and it appears to be out of date. Perhaps this could be fixed by someone (if not you, you probably know who to ask? I do not).

Anyway, can you point me in the direction of the correct JS plugin?

Thanks!
Jordan.
jordanbigel is offline   Reply With Quote
Old 16-10-2021, 09:06   #5
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 286
Re: Shadowing OpenCPN with devices running iNavX

Well done... I thought you might have an old version.

Actually, you need v0.4 ! See this post and its reply #28

Look here at the new manual page. I have asked for the old one to be replaced but it has not happened yet.

Follow the link in that to get the installer for v0.4.
Antipole is offline   Reply With Quote
Old 19-10-2021, 12:22   #6
Registered User

Join Date: Jan 2020
Posts: 29
Re: Shadowing OpenCPN with devices running iNavX

Quote:
Originally Posted by Antipole View Post
Running a tablet or phone as a repeater for OpenCPN is unsatisfactory - in my opinion. Viewing OpenCPN on such a small screen gives a poor experience. Further, if OpenCPN were to fail, the repeater will also fail. There is no resilience.

There are navigational applications better optimised for these devices and more robust. I use iNavX, which is available on iOS (iPad and iPhone) and Android devices.

If OpenCPN is being used as the main planning tool and navigational application, iNavX needs to shadow OpenCPN and keep synchronised with any changes in the navigation.

I have a script for the JavaScript plugin that causes iNavX to shadow OpenCPN by adopting any active waypoint or route. As you advance along the route, iNavX will also advance. If you amend the route in OpenCPN by adding or moving routepoints, iNavX will update accordingly.

Importantly, in the event that OpenCPN were to fail, iNavX will continue to navigate from its own ship’s navigational feed. If that feed were to fail, a device with its own GPS receiver will switch to using that. This provided essential resilience.

I have an iPad running iNavX at the wheel station, which is the helm's main navigational aid. I also have iNavX running on my iPhone and I can review progress from the comfort of my bunk, without having to turn out.
This is a really cool concept, thank you for sharing.

I don't use Open CPN on my ship's PC, I have Timezero Navigator with my Furuno chart plotters. This makes me curious to see if I can figure out how to make that shadow to iNavX as well, as that would be very handy.
iNavX is offline   Reply With Quote
Old 21-10-2021, 03:50   #7
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,631
Images: 2
Re: Shadowing OpenCPN with devices running iNavX

Antipole
iNav Shadowing is a great solurion and should be covered in the O manual too. I will do that.

Since PI manuals in the wiki are depricated we need a link at the top of each one pointing to the new version and a note.
rgleason is offline   Reply With Quote
Old 20-01-2022, 08:26   #8
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 286
SendActiveRoute.js updated to v3

The SendActiveRoute script has been updated to v3 to take advantage of the new APIs in the JavaScript plugin v0.5 and OCPN v5.6.

The new version is much simplified, shorter and more robust. Routes being followed can be modified, switched and even renamed and SendActiveRoute takes it in its stride.

The instructions have been expanded to explain how to exercise this set up at home away from your boat.

v2 of the script remains available for anyone still on OCPN v5.2 and JavaScript v0.4.
Antipole is offline   Reply With Quote
Reply

Tags
enc, iNavX, opencpn


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
Interoperability between OpenCPN(s) & Devices rgleason OpenCPN 89 10-07-2022 12:14
Masthead lighting options to minimize shadowing Cyrus Safdari Construction, Maintenance & Refit 2 26-02-2020 17:29
Yacht Devices NMEA wifi to OpenCPN TheOffice OpenCPN 16 26-07-2018 15:12
OpenCPN+Android : external USB-Serial devices ? PaulRowntree OpenCPN 7 02-04-2016 05:12
An iPad with iNavX/Navionics, or a Windows Surface with OpenCPN? TBillings Navigation 22 19-01-2016 04:41

Advertise Here


All times are GMT -7. The time now is 16:38.


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.