tcp server: why does it always output everything

182 views
Skip to first unread message

Marco Bergman

unread,
Jan 19, 2021, 10:33:23 AM1/19/21
to Signal K
It seems as if tcpserver always outputs just about everything: not only regular nmea0183 messages, but also ais messages and messages generated by a plugin. There is no output filter (like Output Events in the data connection, or "toStdout" in the pipeElement).

First: if I want a filtered tcpserver, is there a plugin for that? a) I don't want flood some of my clients with e.g. AIS messages, and b) if I get multiple sources of heading, for instance, I want to decide centrally what heading goes out.

Second: what is "suppress0183event" for? It defaults to true, but I still get to see nmea1data events, and slightly more annoying, the tcpserver0183data event.

BTW: I cannot update this default Data Connection in the SignalK gui; it gives me an error "<pre> Cannot PUT /skServer/providers/TCP/10110/</pre>". This seems to be because of the slash "/" in the default providerId "TCP/10110". Is this intended?

Thanks!

/Marco

Teppo Kurki

unread,
Jan 19, 2021, 4:09:39 PM1/19/21
to signalk
NMEA0183 routing support is not really the raison d'etre for SK server, but it is so useful that is has grown feature by feature. Yet it is not very easy to use nor can it do everything.

Why does it output everything? Because that is a sensible default. And this is the very first time somebody has reported a problem with that.

On Tue, Jan 19, 2021 at 5:33 PM Marco Bergman <marcob...@gmail.com> wrote:
It seems as if tcpserver always outputs just about everything: not only regular nmea0183 messages, but also ais messages and messages generated by a plugin. There is no output filter (like Output Events in the data connection, or "toStdout" in the pipeElement).

See https://github.com/SignalK/signalk-server/wiki/Events-and-Outputting-Data for instructions for filtering nmea0183 events.

Then you can create a new NMEA0183 connection as TCP Server (sounds like you already fiddled with that) and connect your filtered event to that. If you disable the default 10110 tcp server the port will be free for this connection to operate there.


First: if I want a filtered tcpserver, is there a plugin for that? a) I don't want flood some of my clients with e.g. AIS messages, and b) if I get multiple sources of heading, for instance, I want to decide centrally what heading goes out.

See also Source Priorities Settings in Connections, if you want to prioritise inputs system wide, but that works in Signal K, so you'll have to convert back to 0183 if you use that.

Second: what is "suppress0183event" for? It defaults to true, but I still get to see nmea1data events, and slightly more annoying, the tcpserver0183data event.

Suppress 0183 event is for suppressing the nmea0183 event that is generated from all nmea0183 data entering the server via a connection. If you use TCP server only for output it has no effect.

I don't quite get why you are annoyed by extra events inside the server. Where do you "see" them?


BTW: I cannot update this default Data Connection in the SignalK gui; it gives me an error "<pre> Cannot PUT /skServer/providers/TCP/10110/</pre>". This seems to be because of the slash "/" in the default providerId "TCP/10110". Is this intended?

I can't remember a default naming mechanism for connections (providers). Not intended, sounds like a bug.  

Thanks!

/Marco

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/signalk/718713c7-2634-4c6b-a70e-39eb3d5062a8n%40googlegroups.com.

Marco Bergman

unread,
Jan 20, 2021, 6:33:35 AM1/20/21
to sig...@googlegroups.com
On Tue, Jan 19, 2021 at 10:09 PM Teppo Kurki <t...@iki.fi> wrote:
NMEA0183 routing support is not really the raison d'etre for SK server, but it is so useful that is has grown feature by feature. Yet it is not very easy to use nor can it do everything.
 
That's fair deal; I'd like to jump full monty into signalk adaptation but I am running into some problems *) that I'm trying to solve in the old way for the time being.   

Why does it output everything? Because that is a sensible default. And this is the very first time somebody has reported a problem with that.
 
My question was whether it was some configuration setting, but it seems to be hardcoded (see below), which in the light of the above is fine with me. 

It seems as if tcpserver always outputs just about everything: not only regular nmea0183 messages, but also ais messages and messages generated by a plugin. There is no output filter (like Output Events in the data connection, or "toStdout" in the pipeElement).

See https://github.com/SignalK/signalk-server/wiki/Events-and-Outputting-Data for instructions for filtering nmea0183 events.

Then you can create a new NMEA0183 connection as TCP Server (sounds like you already fiddled with that) and connect your filtered event to that. If you disable the default 10110 tcp server the port will be free for this connection to operate there.

If I make a new TCP Server, it does not have Output Events in the UI, like the TCP Client has, so I cannot set up the described filtering mechanism this way.
 
First: if I want a filtered tcpserver, is there a plugin for that? a) I don't want flood some of my clients with e.g. AIS messages, and b) if I get multiple sources of heading, for instance, I want to decide centrally what heading goes out.

See also Source Priorities Settings in Connections, if you want to prioritise inputs system wide, but that works in Signal K, so you'll have to convert back to 0183 if you use that.

Second: what is "suppress0183event" for? It defaults to true, but I still get to see nmea1data events, and slightly more annoying, the tcpserver0183data event.

Suppress 0183 event is for suppressing the nmea0183 event that is generated from all nmea0183 data entering the server via a connection. If you use TCP server only for output it has no effect.
 
  I still see the incoming events even though suppress is on.  
 
I don't quite get why you are annoyed by extra events inside the server. Where do you "see" them?
 
I only said slightly more annoying ;-) but decimal representation of ascii text seems a bit out of place between more functional log entries:
   signalk-server:events:tcpserver0183data [ <Buffer 24 45 43 52 4d 42 2c 41 2c 38 2e 36 33 39 2c 4c 2c 30 30 31 2c 30  

I'd rather see something like  signalk:streams:udp (signalk:streams:tcp - simply rename the event?); then I can omit it from the signalk-server:events. Understand, at this point in my learning curve, the Server Log is what brings all bits of information together, so an uncluttered view on the logging gives me a smoother learning curve.
 
BTW: I cannot update this default Data Connection in the SignalK gui; it gives me an error "<pre> Cannot PUT /skServer/providers/TCP/10110/</pre>". This seems to be because of the slash "/" in the default providerId "TCP/10110". Is this intended?

I can't remember a default naming mechanism for connections (providers). Not intended, sounds like a bug.  
 
I'm referring to the default providers that -I believe- come with OpenPlotter 2.0. If you make a provider and name it xxx/xxx, save it, open it and save it, then you get the same error. 

Please let me know if these remarks are suitable to put in a github issue, and where exactly, with regard to whether it concerns a plugin or the server itself. Or, should I raise them on slack first.

Also, I'd like to know how I can adapt the Data Browser myself, so it shows knots and degrees, instead of m/s and radians. Seems like a nice contribution for me to attempt.

Thanks again!

*) The OpenCPN Dashboard and Tactics plugins seem to have issues with signalk integration, which issues they don't have with a nmea interface. Furthermore, I had some problems resulting from multiple sources of heading, but I understand now I should be able to fix that with source priorities.

Teppo Kurki

unread,
Jan 21, 2021, 4:08:05 PM1/21/21
to signalk
Then you can create a new NMEA0183 connection as TCP Server (sounds like you already fiddled with that) and connect your filtered event to that. If you disable the default 10110 tcp server the port will be free for this connection to operate there.

If I make a new TCP Server, it does not have Output Events in the UI, like the TCP Client has, so I cannot set up the described filtering mechanism this way.

Oh right, my mistake. Using it as a real output with configurable events is easy to add. If you want to advance this please add an issue for it in Github. 

Suppress 0183 event is for suppressing the nmea0183 event that is generated from all nmea0183 data entering the server via a connection. If you use TCP server only for output it has no effect.
 
  I still see the incoming events even though suppress is on. 

What incoming events? Do you have a client that is connecting to the TCP server and sending data to the server with it? That is what it suppresses: nmea0183 event generated from nmea0183 data that is received from a TCP Server connection.
 
 
I don't quite get why you are annoyed by extra events inside the server. Where do you "see" them?
 
I only said slightly more annoying ;-) but decimal representation of ascii text seems a bit out of place between more functional log entries:
   signalk-server:events:tcpserver0183data [ <Buffer 24 45 43 52 4d 42 2c 41 2c 38 2e 36 33 39 2c 4c 2c 30 30 31 2c 30  

Oh I see. This is what I was after when I asked "where you see them". That should be a string, not a Buffer. https://github.com/SignalK/signalk-server/issues/1254
 

I'd rather see something like  signalk:streams:udp (signalk:streams:tcp - simply rename the event?); then I can omit it from the signalk-server:events.

The various 0183 events are exactly that  - 0183 data. UDP and TCP may very well be other stuff, N2K or Signal K messages, not NMEA0183 sentences. For example on my boat my engine temps are sent over UDP as Signal K.
 
I'm referring to the default providers that -I believe- come with OpenPlotter 2.0. If you make a provider and name it xxx/xxx, save it, open it and save it, then you get the same error. 

 
Please let me know if these remarks are suitable to put in a github issue, and where exactly, with regard to whether it concerns a plugin or the server itself. Or, should I raise them on slack first.

Also, I'd like to know how I can adapt the Data Browser myself, so it shows knots and degrees, instead of m/s and radians. Seems like a nice contribution for me to attempt.

Data Browser is really meant as a debugging tool, not a user interface you'd actually use on a regular basis. User defined units is a bit of a can of worms - we should first create a user interface for configuring the system's preferred units, then we can adapt Data Browser. Check out InstrumentPanel, Kip and if on iOS WilhelmSK.

 

Thanks again!

*) The OpenCPN Dashboard and Tactics plugins seem to have issues with signalk integration, which issues they don't have with a nmea interface.

OpenCPN's internal architecture / the way plugins receive data is very dependent on 0183 sentences. O is slowly but surely making progress, but today things are the way they are.
 
Furthermore, I had some problems resulting from multiple sources of heading, but I understand now I should be able to fix that with source priorities.

Again: source priorities work on Signal K data. If you are only routing NMEA0183 data that won't help you. 
Reply all
Reply to author
Forward
0 new messages