The Connections tab of the Settings panel includes the option to display NMEA traffic. This is useful but can be difficult to use. Data rushes by. You can pause this stream but then only see a small snapshot of what is happening.
The WhoGoesThere JavaScript provides more useable insights.
It starts by listing the active connections as seen through the plugins API.
It then listens to the traffic for 10 seconds (configurable) and reports.
It displays a list of the OpenCPN messagaes received since the plugin was started.
It displays one sample of each type of NMEA0183 sentence, prefaced by the count of that sentence type.
It displays one sample of each source of SignalK updates, prefaced by the count of that source.
The script includes the statement
var skDump = false; // dump full SignalK
If this is changed to true
, the samples will be displayed in full as JSON.
NMEA2000 uses the maximum value of a variable to indicate data not available. (maximum value - 1 indicates error and maximum value -2 is reserved). When received over SignalK, these large values are shown as numbers rather than 'undefined' or 'error'.
If you have an NMEA2000 connection, the script will have sent PGN59904 to all stations, requesting them to send PGN126996. The responses are displayed.
This reveals which devices are on the network and at which address. (Some complex devices have more than one presence and give more than one response for a given address.)
The script then lists the PGNs it has seen, including their count and originating address. Using the earlier table, you can see which device is sending which PGN.
The script includes the statement
var NMEA2000Decode = false;
If this is changed to
var NMEA2000Decode = true;
then the script will also decode the samples and display them as JSON.
This script needs JavaScript plugin v3.0.4 or later.
- Copy this URL to your clipboard (copy the link - do not follow it)
https://raw.githubusercontent.com/antipole2/WhoGoesThere/main/whogoesthere.js
- In a JavaScript console choose
Load
and thenURL on clipboard
. The script should be loaded into the script pane. - Choose
Run
to start the script.
If you want to run the script when not online, you will need to save it to a local file.
Alternatively, you can fork the repository if you want to evolve the script.
The script has an experimental arrangement for advising of and obtaining updates.
The script can be discussed in the Discussion forum above.
Issues can be reported using the Issues tab.