Cruisers Forum
 


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 25-11-2019, 12:28   #136
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,796
Re: Signal K

If you want to squeeze the navobj.xml into this context you are adding dynamite.

Keep it simple, please.

Hubert
bcn is offline   Reply With Quote
Old 25-11-2019, 14:07   #137
Registered User

Join Date: Nov 2012
Location: Nelson NZ
Boat: Novara 16.4m catamaran
Posts: 57
Re: Signal K

Quote:
Originally Posted by bcn View Post
If you want to squeeze the navobj.xml into this context you are adding dynamite.

Keep it simple, please.

Hubert

Sorry, I dont follow, whats navobj.xml?
motu42 is offline   Reply With Quote
Old 25-11-2019, 15:13   #138
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,733
Images: 2
Re: Signal K

Motu42, Please don't miss Dave's questions, because we have asked other questions. Thanks.
navobj.xml is a file that contains all routes and waypoints. navobj.xml is backed up 5 times with navobj1.xml, navobj2.xml etc.

Quote:
Originally Posted by bdbcat View Post
Motu42...
I think we are on the same wavelength.
But tell me more about:

What proved very useful in the Artemis server was exposing these as a stream over a tcp/ip port.

Do I read that you did NOT use SK/JSON as the "language" of the stream, but defined a proprietary binary package for inter-process/inter-machine communication instead? If so, this seems a step backwards from the SK idea...

Dave
rgleason is offline   Reply With Quote
Old 25-11-2019, 15:59   #139
Registered User

Join Date: Nov 2012
Location: Nelson NZ
Boat: Novara 16.4m catamaran
Posts: 57
Re: Signal K

@bdbcat - i see looking back I didnt answer your question well.


I used a binary format for efficiency to avoid constantly converting to/from strings - a problem mentioned by others. I think this is fine for iterprocess/interhost communications if those processes and hosts are in a trusted wired network. eg all on the same ethernet hub. It assumes high speed, low latency reliable connection, probably one packet per key:value etc.



Once you start connecting with arbitrary hosts across the internet the streaming binary format has its own set of problems. Since latency is usually > 100ms, it needs message buffering, etc to be viable. At that point a signalk delta (json) message is better.


Json (as a string)was chosen deliberately for signalk since we could not forsee what transport mediums would be used in the future. Binary is a problem on serial for instance. Text strings are pretty much universal. Its proven a good choice as IoT has developed (MQTT/COAP/STOMP/etc). Even email and paper works!
motu42 is offline   Reply With Quote
Old 25-11-2019, 16:07   #140
Registered User

Join Date: Nov 2012
Location: Nelson NZ
Boat: Novara 16.4m catamaran
Posts: 57
Re: Signal K

Re navobj.xml - if its designed to hold/archive waypoint and route data, then it can be replaced by signal k messages (it has keys for waypoints/routes/etc). That automatically means its also synchronised to all other interested devices.



This already works on the freeboard-sk browser based chartplotter. Create a waypoint on one browser and watch it pop up on the other :-)



Does that remove the dynamite danger? :-)


The real point is that integrating signal k as I have described above both simplifies opencpn, while opening up a whole range of future development directions for opencpn functionality
motu42 is offline   Reply With Quote
Old 25-11-2019, 16:09   #141
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,733
Images: 2
Re: Signal K

RE: bdbcat's questions to motu42, I found this project and some links:

Artemis Server
Artemis Server Design
ActiveMQ - Power Your Microservices, High-performance Messaging for Highly Scalable Microservices
Security
rgleason is offline   Reply With Quote
Old 25-11-2019, 18:49   #142
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,473
Re: Signal K

Motu42....

I remain unconvinced about the need for a private binary packet distribution model, even within one host. Are we really certain that parsing JSON on our target hardware is a back-breaking task? Has this actually been prototyped and measured?


The model that I would like to see goes something like this:
1. SK server exists somewhere, accessible by TCP/IP.
2. SK server "owns" the serial NMEA and N2K interfaces, maybe by plugins to the server.
3. OCPN core is a simple client of the SK server, subscribing to and parsing incoming JSON containing only data it cares about (a relatively small set)
4. OCPN plugins are also simple clients of the SK server, also receiving data by subscription.
5. OCPN and its plugins communicate closely for GUI interaction, easy enough since they run in the same process. But plugins manage their sensor data requirements independent of core.
6. OCPN core and plugins use whatever private internal data structure they choose.
7. OCPN core retains its currently implemented serial and network NMEA multiplexer, for legacy environments.
8. OCPN core does NOT retransmit anything received by subscription to the SK server.

I'll stop there and await comments.
Dave
bdbcat is online now   Reply With Quote
Old 25-11-2019, 21:46   #143
Registered User

Join Date: Nov 2012
Location: Nelson NZ
Boat: Novara 16.4m catamaran
Posts: 57
Re: Signal K

bdbcat,

I agree mostly with your model, thats pretty much what I see as a nice clean architecture to move forward on. What you describe with simple subscriptions to the server using the current signalk formats will work fine for most use cases.

BTW You will find that OpenCPN will need to send data out. The simple case of setting a waypoint to the autohelm will require a message to be sent to the signalk server (which will message the autohelm, etc), or acknowledging an alarm.

In Artemis server I started implementing fine grain security and found that I had to decode and test each incoming json string on a per key/per subscriber basis. I didnt want to build a connected system (like cars and phones) where you can hack into critical devices easily.

That produced the key:value binary message and worked well. I then found its way easier and faster to send that direct to plugins. And that gave me the idea to offer it over TCP/IP.

I did test the binary key:value format. It made quite a difference when I ramped up the volume on an RPi3. Individually parsing a json delta message is not much work, even for an RPi2 or 3. Lets say it takes 500ns.

When you get a higher volume of messages, eg 200/sec, 100ms/sec is required just for parsing. But you typically have to parse a larger message (many keys), filter for need and security, then recreate delta string message to pass on and it all adds up. When you push to high loads (eg 1500 msg/sec), then you cant afford any extra cost per message at all.

You will find you need a key:value format internally anyway, as has been discussed before. Using the same one is a nice win all round.

So either way will work, just a question of required performance.
motu42 is offline   Reply With Quote
Old 26-11-2019, 03:56   #144
Registered User

Join Date: Aug 2017
Posts: 16
Re: Signal K

Quote:
Originally Posted by motu42 View Post
bdbcat,


Individually parsing a json delta message is not much work, even for an RPi2 or 3. Lets say it takes 500ns.

When you get a higher volume of messages, eg 200/sec, 100ms/sec is required just for parsing. But you typically have to parse a larger message (many keys), filter for need and security, then recreate delta string message to pass on and it all adds up. When you push to high loads (eg 1500 msg/sec), then you cant afford any extra cost per message at all.

.

At 200 msg/sec and 500ns per message it is only 100µs/s (Micro, not Milli) for parsing. Or 0.01%.
Axel_G is offline   Reply With Quote
Old 26-11-2019, 07:33   #145
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,473
Re: Signal K

motu42 (or anyone)....


I have not actually worked with N2K and SK, so my practical experience is minimal.
Please describe an environment that might generate 1500 messages/second in real life.


Thanks
Dave
bdbcat is online now   Reply With Quote
Old 26-11-2019, 09:04   #146
Registered User

Join Date: Mar 2011
Posts: 724
Re: Signal K

For a NMEA 2000 network probably a bus running at 60% capacity. Very unlikely on a cruising yacht with standard speed, wind, depth, gps and autopilot and mfd devices and similarly unlikely with other toys such as all the engine, tank, hvac, entertainment & electrical sensors. About half the sensors transmit at 1 Hz the other half at 10Hz.

Possibly likely on racing yacht with higher speed wind & speed sensors coupled with gyros (heel, yaw & pitch), rate compasses, the high end autopilots and strain and compression sensors.

And lets not forget that coming down the pipe will be OneNet (all the NMEA 2000 stuff over ethernet)

I guess in reality it shouldn't be a problem with the current hardware that is in use today (including a Pi), although if poorly architected, 500ns to process a JSON string could result in dropped NMEA 2000 frames.

But let be voice my dissenting opinion yet again on using strings (be it NMEA 183 or JSON) to pass data between OpenCPN and its plugins.

Take your normal cruising yacht with perhaps 10 - 20 % load on the NMEA 2000 network and add 2 or 3 tablets or smartphones running some sort of Signsl K client. Now for a single data value (eg depth) , you're now performing the same JSON parsing 4 or 5 times. Then take an extreme case either a VHF DSC message or AIS message.
stevead is offline   Reply With Quote
Old 26-11-2019, 09:28   #147
Registered User

Join Date: Mar 2011
Posts: 724
Re: Signal K

Quote:
1. SK server exists somewhere, accessible by TCP/IP.
Making for a complex network configuration that 'Joe Boater' may have difficulty configuring.

Quote:
2. SK server "owns" the serial NMEA and N2K interfaces, maybe by plugins to the server.
Which Signal K Server implementation? An expensive iKommunicate box ? An inexpensive RaspberryPi running OpenPlotter which non Windows/Mac users may find difficult ?


Or Signal K Server running on Windows (Node JS etc) and only able to connect to NMEA 2000 networks with an Actisense NGT-1 ? And what of our poor Mac user base?

I love the idea of Signal K schema & JSON to communicate between display devices. However I'm not convinced today that a Signal K Server is the panacea.

From reading this thread there are a lot of developers implementing technology for technology's sake and not fully understanding our user's needs.
stevead is offline   Reply With Quote
Old 26-11-2019, 09:29   #148
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,473
Re: Signal K

Steve...


Take your normal cruising yacht with perhaps 10 - 20 % load on the NMEA 2000 network and add 2 or 3 tablets or smartphones running some sort of Signsl K client. Now for a single data value (eg depth) , you're now performing the same JSON parsing 4 or 5 times.



This is the part of your argument I don't get. Assuming the server is keeping up with the pace, why does a PC on the net running O care what the tablets are doing? Sure, the tablets and PC have to individually parse JSON. But why, other than overall system efficiency, do we care?


I'm suggesting trading away "overall system efficiency" in favor of "extensibility and readability".



Dave
bdbcat is online now   Reply With Quote
Old 26-11-2019, 09:38   #149
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,473
Re: Signal K

Steve...


Making for a complex network configuration that 'Joe Boater' may have difficulty configuring.


Read back some. I would like to see a new SK server implemented as a OCPN plugin, installed like any other OCPN plugin. Minimal interaction with OCPN core, just forks and runs a separate "server process", probably. Possibly interacts with other OCPN plugins (TBD) that own the serial ports and Canbus interface.



I envision this as the "entry level" SK/N2K support for OCPN. Advanced users will no doubt want to add external hardware for SK server, unloading their Nav PC. No problem...


Dave
bdbcat is online now   Reply With Quote
Old 26-11-2019, 11:07   #150
Registered User

Join Date: Feb 2016
Posts: 143
Re: Signal K

Quote:
Originally Posted by stevead View Post
Or Signal K Server running on Windows (Node JS etc) and only able to connect to NMEA 2000 networks with an Actisense NGT-1 ? And what of our poor Mac user base?
Please don't spread misinformation.

SK Node Server runs just fine on macs, on practically any modern linux system and Windows. Pick your poison.

As for NMEA2000 it supports practically any CAN device out there: NGT-1, iKonvert, YDNU-02, YDGW-02, N2K over NMEA0183 (PCDIN) and socketcan on various hardware (linux).

What we are missing is one click installers for the different systems.
teppokurki is offline   Reply With Quote
Reply


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
GPS signal too weak on Datamarine 5000 phorvati Marine Electronics 2 11-08-2009 14:26
Aqua Signal Parts Jmolan Electrical: Batteries, Generators & Solar 2 12-11-2008 06:42
Info on Signal flag Fonts ? JMRmarinero Flotsam & Sailing Miscellany 2 28-06-2007 08:54

Advertise Here


All times are GMT -7. The time now is 07:32.


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.