SignalK and OpenCPN under Windows - a trial

930 views
Skip to first unread message

Hubert

unread,
May 24, 2015, 12:28:40 PM5/24/15
to sig...@googlegroups.com
Trying to set up a workflow under Windows 8.1 64 in order to get N2K data into OCPN using Signal K the following things are running:

  • Actisense NGT-1 with Canboat (Cygwin version) is running and pipes CANBOAT JSON data into a file:

Rem NGT has to be at 115200 Bd
actisense-serial -r -p /dev/ttyS9 | analyzer -json >> can-jason.txt

{"timestamp":"2015-05-24-11:04:45.054","prio":0,"src":0,"dst":0,"pgn":262161,"description":"Actisense: Operating mode","fields":{"SID":1,"Model ID":14,"Serial ID":110741,"Error ID":0,"Operating Mode":2}}
{"timestamp":"2015-05-24-11:04:45.056","prio":0,"src":0,"dst":0,"pgn":262384,"description":"Actisense: Startup status","fields":{"SID":1,"Model ID":14,"Serial ID":110741,"Error ID":0,"Firmware version":2.196,"Reset status":0}}
{"timestamp":"2015-05-24-11:04:45.056","prio":4,"src":43,"dst":255,"pgn":129039,"description":"AIS Class B Position Report","fields":{"Message ID":18,"Repeat Indicator":"Initial","User ID":211585630,"Longitude":01.9211100,"Latitude":41.2587983,"Position Accuracy":"High","RAIM":"in use","Time Stamp":"29","SOG":0.00,"Communication State":"393222","AIS Transceiver information":"Own information not broadcast","Regional Application":0,"Regional Application":0,"Unit type":"CS","Integrated Display":"No","DSC":"Yes","Band":"entire marine band","Can handle Msg 22":"Yes","AIS mode":"Autonomous","AIS communication state":"ITDMA"}}
{"timestamp":"2015-05-24-11:04:45.056","prio":2,"src":35,"dst":255,"pgn":130306,"description":"Wind Data","fields":{"SID":142,"Wind Speed":1.95,"Wind Angle":159.6,"Reference":"Apparent"}}
{"timestamp":"2015-05-24-11:04:45.056","prio":2,"src":35,"dst":255,"pgn":127251,"description":"Rate of Turn","fields":{"SID":102,"Rate":-0.0097000}}
{"timestamp":"2015-05-24-11:04:45.056","prio":2,"src":35,"dst":255,"pgn":127250,"description":"Vessel Heading","fields":{"SID":223,"Heading":61.6,"Deviation":0.0,"Variation":-0.2,"Reference":"Magnetic"}}
......

  • The Signal-K server is running on the same PC and delivers NMEA data from the demo file via tcp into OpenCPN where those are correctly rendered.

The following will not work under Windows (not even with the complete correct path to n2k-signalk):
actisense-serial /dev/actisense | analyzer -json 2>/dev/null | n2k-signalk

So the missing links for me:
  • getting the n2k-signalk part running
  • pumping this stream into the server

Eager to learn!

Hubert

rob...@42.co.nz

unread,
May 24, 2015, 6:49:55 PM5/24/15
to sig...@googlegroups.com
Hi Hubert,

Are you running the node or java server? The java server currently echos NMEA to the TCP port, and converts it to signalk which it also puts out. But at present it doesnt convert incoming signalk back to NMEA and output it.

So in the java server you will get the n2k json from Canboat being converted to signalk but not NMEA. Sorry havent had time to add that yet :-)
You can use the REST api to explore the servers internal signalk model. on the java server http://...:8080, and follow the instructions.

The java server reads from a variety of sources, but all are assumed external IO (serial/tcp/etc) at present. Have to think about how to support the Canboat output which is preseumably a Linux pipe in your case...

Rob

Hubert

unread,
May 25, 2015, 4:41:17 AM5/25/15
to sig...@googlegroups.com
Rob,

yes running the java server - shows up fine.
And as mentioned it pipes NMEA0183 data via tcp correctly into OPCN.

Why did we use the Signal-K server and not Kees implemented N2K-->0183 stream?
First to show that SignalK is running and can do reasonable things in a working environment for a "normal user" already and second to use the instrument panel as a bonus - this is attractive for somebody who runs a network and wants to control some data (remotely) just with a browser. .

Once we have this package running we can publish it for donload on the OCPN forum so that SignalK gets more inputs from different users and environments/suage cases..

So looking forward to see more. If I can help testing just give me a shout.

There is a sketch attached how we explained what SignalK is about in svg and pdf format - comments very welcome. Use it or trash it...

Hubert
Signal-K.svg
Signal-K.pdf

rob...@42.co.nz

unread,
May 25, 2015, 8:22:54 PM5/25/15
to sig...@googlegroups.com
Hubert,

I just pushed a new java server version up to github. It supports listening to remote TCP servers, so it can listen to gpsd or canboats TCP server. (Also supports MQTT client but thats for Tim)

To configure have a look in conf/signalk.cfg and follow the comments. The Canboat wiki shows how to make the canboat server available over TCP. The signalk server only needs the json output from Canboat to work.

Let me know if it works for you, (I have no N2k devices to test with)

Rob

On Monday, May 25, 2015 at 4:28:40 AM UTC+12, Hubert wrote:

Hubert

unread,
May 26, 2015, 1:08:14 PM5/26/15
to sig...@googlegroups.com

Rob,

thanks - downloaded the new version, tested first with the demo files and OCPN (ok)  and changed the following lines in the configs:

signalk.demo=false
#signalk.stream.demo.file=plaka.nmea

and

signalk.client.tcp.connect=localhost:2598   Rem matching with Canboat n2kd JSON stream server

The Canboat part looks like this:
actisense-serial -r -p /dev/ttyS9 | analyzer -json | n2kd

but the two don´t talk to each other. Or better the Java server´s client does not get JSON data on port 2598.
n2kd is running and when dumping the stream into a text file this looks fine. A short excerpt is attached.

There are some netstat outputs attached. Any idea how I can assure that n2kd is alive on port 2598?
I would expect to see the n2kd ports 2597, 2598 and 2599 but there is just 2598 and "waiting" ("hergestellt" means "established")
There are three parties involded: the Canboat processes, SigK-Java-Server and OCPN.
How can we know who fails? OPCP is reading correctly from SigK´s Java at TCP 5557

Can run more tests tomorrow. Any ideas or proposals?

netstat-out-2.txt
JSONfromN2Kd-short.txt

rob...@42.co.nz

unread,
May 26, 2015, 5:43:57 PM5/26/15
to sig...@googlegroups.com
Hi Hubert,

First thing is to prove the n2kd is outputting tcp. On linuc I use the 'ncat' command, I dont know if thats in windows or cygwin. So

'ncat localhost 2598' in linux will stream the n2kd to the screen.

Assuming thats working the next thing is message delimiters, on screen it should do one per line.

You can turn debug on on the server by editing conf/log4j.properties.
Change to:
log4j.logger.nz.co.fortytwo.signalk.processor.InputFilterProcessor=DEBUG
log4j.logger.nz.co.fortytwo.signalk.processor.N2KProcessor=DEBUG
log4j.logger.nz.co.fortytwo.signalk.handler.N2KHandler=DEBUG

That should give some (verbose) output to console or log file


Rob

On Monday, May 25, 2015 at 4:28:40 AM UTC+12, Hubert wrote:

rob...@42.co.nz

unread,
May 26, 2015, 11:56:21 PM5/26/15
to sig...@googlegroups.com
Hi Hubert,
Just uploaded a version that generates basic NMEA0183 to tcp from the signalk data. This means that there will be some duplication if you have NMEA0183 coming in, as it will be echoed to tcp, and converted to signalk. Then later the server will also create and send the same NMEA0183 data out again.

If the incoming data is N2K or signalk then this wont be a problem.

Rob

Teppo Kurki

unread,
May 27, 2015, 1:36:35 AM5/27/15
to signalk
Hubert: is there some specific setup you are trying to reach in terms of inputs & applications? 

If you want to have nmea0183 and N2K inputs available as Signal K the Node Signal K server can provide that out of the box with Canboat actisense-serial and analyzer doing the N2K part, no n2kd required.

Hubert

unread,
May 27, 2015, 2:03:23 AM5/27/15
to sig...@googlegroups.com, t...@iki.fi
Teppo,

how would that look like? How do I feed the analyzer output into The Server?
The idea is is
- to establish a access of N2K data into OCPN via SignalK (it's clear that Analyzer will feed some NMEA0183 data if configured this way) to showcase SigK works with OCPN
- and (not possible just with Analyzer) to have Virtual Instruments based on SigK

Teppo Kurki

unread,
May 27, 2015, 3:06:41 AM5/27/15
to signalk
On Wed, May 27, 2015 at 9:03 AM, Hubert <hub...@gmail.com> wrote:
Teppo,

how would that look like? How do I feed the analyzer output into The Server?

Add actisense-serial and analyzer to your PATH and  start the server with 

bin/signalk-server -s settings/actisense-serial-settings.json

(see settings file for path to your settings)
 
The idea is is
- to establish a access of N2K data into OCPN via SignalK (it's clear that Analyzer will feed some NMEA0183 data if configured this way) to showcase SigK works with OCPN

Converting N2K to NMEA0183 is really not Signal K, but demonstrates interoperability. It is not analyzer but n2kd that translates N2K to NMEA0183.

With a little tweak/addition to the server software you could have both: have analyzer output piped to n2kd and to Signal K server. Then you could have the same N2K input available as NMEA0183 from n2kd over tcp and Signal K from Signal K over websocket and http.

I'll get back to you on this.
 
- and (not possible just with Analyzer) to have Virtual Instruments based on SigK

Teppo Kurki

unread,
May 27, 2015, 1:28:15 PM5/27/15
to signalk
With a little tweak/addition to the server software you could have both: have analyzer output piped to n2kd and to Signal K server. Then you could have the same N2K input available as NMEA0183 from n2kd over tcp and Signal K from Signal K over websocket and http.

I'll get back to you on this.


I just committed an additional configuration to the node server that afaik does what you are after: input from actisense NGT-1 is available both as Signal K and nmea0183 via n2kd.


Instead of just launching actisense serial this configuration launches a separate script that runs

actisense-serial /dev/tty.usbserial-1FD34 | analyzer -json | tee >(n2kd)

which pipes the analyzer output to both n2kd and stdout. Stdout is captured by the server, parsed as json and converted to Signal K.

Launch with 

bin/signalk-server -s settings/actisense-serial-n2kd-settings.json

I don't have any N2K devices at home (hint: any readers who wish to send me some to make sure Signal K server works with it, please contact me in private ;-) so I can't test with actual data. However I was able to verify that the Signal K server receives the Actisense diagnostic messages (so getting analyzer json off the stdout works) and I was able to get the same messages off the n2kd json port like so:

~ $ telnet localhost 2598
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"timestamp":"2015-05-27-17:13:15.961","prio":"0","src":"0","dst":"0","pgn":"262386","description":"Actisense: System status","fields":{"SID":"1","Model ID":"14","Serial ID":"130356","Error ID":"0","Indi channel count":"2","Ch1 Rx Bandwidth":"0","Ch1 Rx Load":"0","Ch1 Rx Filtered":"0","Ch1 Rx Dropped":"0","Ch1 Tx Bandwidth":"0","Ch1 Tx Load":"0","Ch2 Rx Bandwidth":"0","Ch2 Rx Load":"0","Ch2 Rx Filtered":"0","Ch2 Rx Dropped":"0","Ch2 Tx Bandwidth":"1","Ch2 Tx Load":"0","Uni channel count":"2","Ch1 Bandwidth":"0","Ch1 Deleted":"0","Ch1 BufferLoading":"0","Ch1 PointerLoading":"0","Ch2 Bandwidth":"0","Ch2 Deleted":"0","Ch2 BufferLoading":"0","Ch2 PointerLoading":"0"}}

so I assume everything is working. There are probably issues with the path to the script and I have no idea how this works in Windows.

I'm not really happy with using a separate script, but it serves as a nice example of how to integrate _any_ script as a source of data. The real reason for the script is that I can not Google how to pipe the analyzer output to separate process in sh.

Hubert

unread,
May 27, 2015, 1:54:35 PM5/27/15
to sig...@googlegroups.com, t...@iki.fi


Teppo,

I didn´t make to the boat today so the test will have to wait until tomorrow afternoon...

Thanks

Hubert

Hubert

unread,
May 27, 2015, 2:11:17 PM5/27/15
to sig...@googlegroups.com, t...@iki.fi


Teppo,

just downloaded the last signal-server

bin/signalk-server -s settings/actisense-serial-n2kd-settings.json

will not work from the command line under Windows as the files under /bin are not recognized as executables. Any idea?

Hubert

Teppo Kurki

unread,
May 27, 2015, 2:29:13 PM5/27/15
to signalk
I haven't used Windows for years. I guess the best solution would be to create the equivalent .bat files? Also the trick that I used to direct analyzer output to n2kd in addition to stdout will not work, but 


mentions PowerShell's tee command.

Can anybody else on the list offer assistance?



--
You received this message because you are subscribed to the Google Groups "Signal K" group.
To unsubscribe from this group and stop receiving emails from it, send an email to signalk+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hubert

unread,
May 4, 2016, 9:22:51 AM5/4/16
to Signal K, t...@iki.fi
Question,

did anybody got the combination actisense N2K gateway --> SK under Windows running in the meanwhile?
A "recipe" or update would be appreciated.

Hubert

Axel HH

unread,
Jul 11, 2016, 10:03:18 AM7/11/16
to Signal K, t...@iki.fi
Also very interested in this. Has anyone figured it out yet?
Reply all
Reply to author
Forward
0 new messages