OpenMarine
Output from ocpn to N2K - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=2)
+--- Thread: Output from ocpn to N2K (/showthread.php?tid=2065)

Pages: 1 2


Output from ocpn to N2K - Celestine - 2019-11-02

Hello,
I'm setting up a N2K network to work with OP/OCPN. I manage to get data from the network (Garmin transducers via Actisense NGT-1) to OCPN. I want to use the Garmin GNX20 to show data for an active route and possibly also have my Simrad TP32 to steer via SIMNET/N2K.
I see data flowing out from OCPN on the output UDP connection. I can also see corresponding data on the OP system port NMEA0183. How do I bring this data on to the N2K bus?
Tried to install signalk plugin signalk-nmea2000 from signalk admin. 
Now OP refuse to start, I get the message "SignalK doesn't work! Openplotter will exit because it wasn't able to start SignalK"
Restarting the system doesn't help. 
I get messages as below when I try to start OP in terminal.
Any help would be greatly appreciated!
Bestr regards,
Pär W

Signal K starting
/home/pi/.config/signalk-server-node/node_modules/@canboat/canboatjs/lib/fromPgn.js:289
      const { data, direction, error, ...pgn } = parseYDRAW(pgn_data)
                                      ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pi/.config/signalk-server-node/node_modules/@canboat/canboatjs/index.js:20:12)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
Signal K starting
[Errno 111] Connection refused
/home/pi/.config/signalk-server-node/node_modules/@canboat/canboatjs/lib/fromPgn.js:289
      const { data, direction, error, ...pgn } = parseYDRAW(pgn_data)
                                      ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pi/.config/signalk-server-node/node_modules/@canboat/canboatjs/index.js:20:12)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
[Errno 111] Connection refused


Output from ocpn to N2K - tkurki - 2019-11-03

The error sounds like you have an outdated Node.js version. You can check it with

node -v

It should be minimum 8, preferably 10.

A quick fix is to rename the directory
/home/pi/.config/signalk-server-node/node_modules/

That will disable all the plugins.



Sent from my iPhone using Tapatalk


RE: Output from ocpn to N2K - Celestine - 2019-11-03

(2019-11-03, 08:07 AM)tkurki Wrote: Hi,
Yes, the version is old; 6.14.1
I renamed the direcory. OP still fails to start but the errors are different. See below.
Are there a way to roll back the failed install of signalk-nmea2000 ?

Cheers,
Pär W

.pi@openplotter:~ $ openplotter
Signal K starting
module.js:478
    throw err;
    ^

Error: Cannot find module 'express'
    at Function.Module._resolveFilename (module.js:476:15)
    at Function.Module._load (module.js:424:25)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pi/.config/signalk-server-node/lib/index.js:22:17)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
[Errno 111] Connection refused
Signal K starting
module.js:478
    throw err;
    ^

Error: Cannot find module 'express'
    at Function.Module._resolveFilename (module.js:476:15)
    at Function.Module._load (module.js:424:25)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pi/.config/signalk-server-node/lib/index.js:22:17)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
[Errno 111] Connection refused
Traceback (most recent call last):
  File "/home/pi/.config/openplotter/openplotter", line 3539, in <module>
    MainFrame().Show()
  File "/home/pi/.config/openplotter/openplotter", line 224, in __init__
    self.page_sk()
  File "/home/pi/.config/openplotter/openplotter", line 2998, in page_sk
    self.close()
AttributeError: 'MainFrame' object has no attribute 'close'



The error sounds like you have an outdated Node.js version. You can check it with

node -v

It should be minimum 8, preferably 10.

A quick fix is to rename the directory
/home/pi/.config/signalk-server-node/node_modules/

That will disable all the plugins.



Sent from my iPhone using Tapatalk



RE: Output from ocpn to N2K - tkurki - 2019-11-03

(2019-11-03, 12:02 PM)Celestine Wrote:
(2019-11-03, 08:07 AM)tkurki Wrote: Yes, the version is old; 6.14.1
I renamed the direcory. OP still fails to start but the errors are different. See below.
Are there a way to roll back the failed install of signalk-nmea2000 ?
I don't think there is an easy way back. Furthermore my advice was (pun intended) ill advised: this is an older OpenPlotter installation and the directory /home/pi/.config/signalk-server-node/node_modules/ contains the server's libraries, not libraries for the plugins. I am not familiar enough with the way OpenPlotter used to install SK server to be able to offer much help.

For the latest server to work you must upgrade Node.js to version 10, but that won't be enough, as some of the libraries have been installed for Node 6 and will not work with a newer one.

Essentially the easiest way out is to reinstall SK Server, but I can't help you out with how to do that in OpenPlotter 1. Maybe somebody else here can?


RE: Output from ocpn to N2K - Celestine - 2019-11-04

(2019-11-03, 08:09 PM)tkurki Wrote:
(2019-11-03, 12:02 PM)Celestine Wrote:
(2019-11-03, 08:07 AM)tkurki Wrote: Yes, the version is old; 6.14.1
I renamed the direcory. OP still fails to start but the errors are different. See below.
Are there a way to roll back the failed install of signalk-nmea2000 ?
I don't think there is an easy way back. Furthermore my advice was (pun intended) ill advised: this is an older OpenPlotter installation and the directory /home/pi/.config/signalk-server-node/node_modules/ contains the server's libraries, not libraries for the plugins. I am not familiar enough with the way OpenPlotter used to install SK server to be able to offer much help.

For the latest server to work you must upgrade Node.js to version 10, but that won't be enough, as some of the libraries have been installed for Node 6 and will not work with a newer one.

Essentially the easiest way out is to reinstall SK Server, but I can't help you out with how to do that in OpenPlotter 1. Maybe somebody else here can?
This i my backup/spare sytem running an older version of OpenPlotter. Guess I need to start over and install v2 beta and hope the beta stage is over before next season.
Thanks anyway!
Cheers,
Pär W


RE: Output from ocpn to N2K - jim321 - 2019-11-04

you could try
sudo npm install --unsafe-perm -g signalk-server


RE: Output from ocpn to N2K - Celestine - 2019-11-16

(2019-11-04, 10:46 AM)Celestine Wrote:
(2019-11-03, 08:09 PM)tkurki Wrote:
(2019-11-03, 12:02 PM)Celestine Wrote:
(2019-11-03, 08:07 AM)tkurki Wrote: Yes, the version is old; 6.14.1
I renamed the direcory. OP still fails to start but the errors are different. See below.
Are there a way to roll back the failed install of signalk-nmea2000 ?
I don't think there is an easy way back. Furthermore my advice was (pun intended) ill advised: this is an older OpenPlotter installation and the directory /home/pi/.config/signalk-server-node/node_modules/ contains the server's libraries, not libraries for the plugins. I am not familiar enough with the way OpenPlotter used to install SK server to be able to offer much help.

For the latest server to work you must upgrade Node.js to version 10, but that won't be enough, as some of the libraries have been installed for Node 6 and will not work with a newer one.

Essentially the easiest way out is to reinstall SK Server, but I can't help you out with how to do that in OpenPlotter 1. Maybe somebody else here can?
This i my backup/spare sytem running an older version of OpenPlotter. Guess I need to start over and install v2 beta and hope the beta stage is over before next season.
Thanks anyway!
Cheers,
Pär W
Ok, so now I have OP 2 installed. Nmea2000 is successfully converted and sent to ocpn. 
Route data, for autopilot and navrepeater (Garmin GNX20), is output from ocpn to SK. The sentences looks ok when reading the log file. How can I convert from nmea0183 to nmea2000 and send the data out on the can.bus?


RE: Output from ocpn to N2K - Celestine - 2019-11-17

Hi again,
I put more questions before someone answers...  Smile
Must I convert the nmea0183 output to signalk before converting to nmea2000? How do I do that in such case?
The signalk-nmea2000 plugin is installed and activated but as I said in my last post nothing goes out on the can-bus. I want things like RMB and XTE to be converted to nmea2000 but looking at the plugin config no such things seems to be available. Is it at all possible?
A brief description of my setup so you understand what I try to achieve.
Navstation (rpi and monitor) is placed at the chart table inside the boat. Transducers and ais is connected to the rpi with an nmea0183 network. The instrument panel in cockpit contains Silva Star wind, Sea data and Nav repeater. No graphic display in cockpit.
No I'm upgrading to new transducers and cockpit displays (Garmin GNX Wind and GNX20) I still want one of the displays to show steering info but now it needs to be fed by nmea2000. I also have a new ap (Simerad TP32) that has the ability to steer to waypoint info or wind angle. Of course it would be nice to be able to use that feature too.
Hope someone can help me out!
Cheers,
Pär W


RE: Output from ocpn to N2K - verkerkbr - 2019-12-16

It is not clear if I can help you. I got a question about showing the the distance to a waypoint and heading in MXTOMMY KIP. Which is a display of SignalK.

Waypoint data is generated in OpenCPN and you have to transfer this data to the SignalK server.

This is possible. The data comes from OpenCPN in the form of NMEA183. The NMEA item for Waypoint etc  is RMB.

This how I have done it:

In OpenCPN connections, make a second connection. Network UDP localhost port 2000. Outgoing. 
Go to Input/output filers and remove all the items and take only the one you need. RMB was not on the list (right site 3 dots). So I had to add RMB.

Now go to the SignalK server. Login and go to connections. Add new connection. Give item a name (here called way) NMEA183 UDP localhost port 2000. Restart.

If i now make a waypoint in OpenCPN and give goto command. It shows up in SignalK format and can be used by MXTOMMY KIP.

Perhaps you can use this setup and change it for your purpose. If the data is available in SignalK is you can convert this to NMEA2K.

Image with an example of distance and heading to the waypoint. Data form OpenCPN to SignalK.

Bram


RE: Output from ocpn to N2K - Celestine - 2019-12-19

(2019-12-16, 11:31 AM)verkerkbr Wrote: It is not clear if I can help you. I got a question about showing the the distance to a waypoint and heading in MXTOMMY KIP. Which is a display of SignalK.

Waypoint data is generated in OpenCPN and you have to transfer this data to the SignalK server.

This is possible. The data comes from OpenCPN in the form of NMEA183. The NMEA item for Waypoint etc  is RMB.

This how I have done it:

In OpenCPN connections, make a second connection. Network UDP localhost port 2000. Outgoing. 
Go to Input/output filers and remove all the items and take only the one you need. RMB was not on the list (right site 3 dots). So I had to add RMB.

Now go to the SignalK server. Login and go to connections. Add new connection. Give item a name (here called way) NMEA183 UDP localhost port 2000. Restart.

If i now make a waypoint in OpenCPN and give goto command. It shows up in SignalK format and can be used by MXTOMMY KIP.

Perhaps you can use this setup and change it for your purpose. If the data is available in SignalK is you can convert this to NMEA2K.

Image with an example of distance and heading to the waypoint. Data form OpenCPN to SignalK.

Bram

Hi,
Thanks for your reply. 
All you write works very well except for the last bit. Getting data from ocpn into Signal K is not a problem but converting to n2k and send to the can bus is...
Currently there is no support for the sentences needed in the Signal K to NMEA2000 plug-in.
I don't think it would be impossible it's just that noone has developed it yet...
P