OpenCpn and VS NG Gps

Currently the newest simulator version. You can use this forum to share bugs or your ideas for the development.

Please support the development work, buy Vehicle Simulator or Virtual Sailor NG. Do not use or create piracy versions!
rafacdiaz
Posts: 4
Joined: Sun Mar 28, 2021 5:01 pm

OpenCpn and VS NG Gps

Post by rafacdiaz »

Good evening!!!
I've got a question:

Does anyone know if it is possible to send a route done on OpenCpn to the GPS included in Virtual Sailor NG?
I know that VS NG supports NMEA data share, but I am tryng to send waypoints from OpenCpn to VS NG and
I don't know what I am doing wrong but I don't get anything.

Thanks in adavance for your help.
Graubart
Posts: 9
Joined: Sat Jul 10, 2021 4:01 pm

Re: OpenCpn and VS NG Gps

Post by Graubart »

If you want, you can try this Python script. It works but is not yet considered final from my side. Python 3 Installation needed on your PC.

vfsroute-0.7.1

The wiki on my GitHub is not yet complete but already explains the export from OpenCPN and import into vsfroute. Once you converted to VS:NG or vsf waypoint format with the tool, you just copy and paste the result into a VS:NG or VSF Situation file, using a text editor.

Script and manual are WIP. I will complete the manual in short time but I am currently busy with my job, so it may take a few days.

Would be nice to receive some feedback about how it worked for you (and anybody else who uses it) :-).
Last edited by Graubart on Tue Nov 02, 2021 7:54 am, edited 1 time in total.
rafacdiaz
Posts: 4
Joined: Sun Mar 28, 2021 5:01 pm

Re: OpenCpn and VS NG Gps

Post by rafacdiaz »

Thanks a lot.

I try it and I will share how it works for me.
hjsmuc
Posts: 38
Joined: Wed Mar 10, 2021 1:21 pm

Re: OpenCpn and VS NG Gps

Post by hjsmuc »

That's very interesting, thank you.

I tried it and I got an error with my kml file:

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "C:\Users\hjsla\Desktop\VSF-Routing-main\vsfroute-0.8.pyw", line 115, in konvertieren
waypoints=root.getElementsByTagName("LineString")[0].firstChild.nextSibling.firstChild.data
IndexError: list index out of range

However, it is a kml file generated by qtvlm and not by opencpn. Could this be the reason?
Do you think you could make the script usable with csv files?

Best regards
Hans
hjsmuc
Posts: 38
Joined: Wed Mar 10, 2021 1:21 pm

Re: OpenCpn and VS NG Gps

Post by hjsmuc »

I found out why it did not work. The kml file needs to have this entry: <name>OpenCPN Route</name>

The file can have any name as long as the extension is .kml and the above entry is in the body.

If you want to use qtvlm to create your routes you can do so, export them as .gpx file, import that one into Open CPN and copy to .kml from there.
Qtvlm does allow to export directly to .kml but the script does not seem to be able to import these files at the moment.

Hope this is helpful for some.
Graubart
Posts: 9
Joined: Sat Jul 10, 2021 4:01 pm

Re: OpenCpn and VS NG Gps

Post by Graubart »

Both is entirely true. I currently support OpenSeaMap and OpenCPN. The Github site with the script also contains a Wiki, which functions as the manual. There I also described how the naming does work. It is unfortunatly not easy to decode the origin from the KML (XML-) file structure, thus the naming convention.
User avatar
ekeimaja
Posts: 37
Joined: Mon Mar 08, 2021 12:54 pm
Location: Finland

Re: OpenCpn and VS NG Gps

Post by ekeimaja »

Graubart wrote: Mon Nov 01, 2021 8:28 pm If you want, you can try this Python script. It works but is not yet considered final from my side. Python 3 Installation needed on your PC.

vfsroute-0.7.1

The wiki on my GitHub is not yet complete but already explains the export from OpenCPN and import into vsfroute. Once you converted to VS:NG or vsf waypoint format with the tool, you just copy and paste the result into a VS:NG or VSF Situation file, using a text editor.

Script and manual are WIP. I will complete the manual in short time but I am currently busy with my job, so it may take a few days.

Would be nice to receive some feedback about how it worked for you (and anybody else who uses it) :-).
I now tried this tool, and if I paste the GPX data, it does not convert it at all. If I paste any KML data, it says unsupported version of KML.
VS sailor since 2008
Graubart
Posts: 9
Joined: Sat Jul 10, 2021 4:01 pm

Re: OpenCpn and VS NG Gps

Post by Graubart »

You do not paste the data. Save your OpenCPN or OpenSeamap data to a .kml file and load this file, using the button in my tool. In the Github repository you find a Wiki, where it is explained how to set the internal identifier (name) within the kml-file, to avoid this error message.
User avatar
ekeimaja
Posts: 37
Joined: Mon Mar 08, 2021 12:54 pm
Location: Finland

Re: OpenCpn and VS NG Gps

Post by ekeimaja »

Graubart wrote: Sun Dec 05, 2021 2:04 am You do not paste the data. Save your OpenCPN or OpenSeamap data to a .kml file and load this file, using the button in my tool. In the Github repository you find a Wiki, where it is explained how to set the internal identifier (name) within the kml-file, to avoid this error message.
Ok, I will try it again.

EDIT: Now it works.
VS sailor since 2008
rafacdiaz
Posts: 4
Joined: Sun Mar 28, 2021 5:01 pm

Re: OpenCpn and VS NG Gps

Post by rafacdiaz »

Good evening!

I am looking for the script to share the routes between OpenCpn and Virtual Sailor NG GPS.
Would anyone be able to share that file. It appears as deleted on the sever,

Thanks in advance,
Graubart
Posts: 9
Joined: Sat Jul 10, 2021 4:01 pm

Re: OpenCpn and VS NG Gps

Post by Graubart »

Hi,

the script is still there

https://github.com/srothe-oslo/VSF-Routing

You just need to download the file https://github.com/srothe-oslo/VSF-Rout ... te-0.8.pyw.

Remember you need to have Python 3 installed on your machine in order to run the script.

With questions, just send me an email.
Post Reply