Distributed Signal K (New User)

Good afternoon! Can I install multiple SignalK instances aboard, and have them communicate/merge data over the TCP/IP network? My idea is that I would have a Raspi Zero 2 W at my NMEA/Seatalk bridge, and then run Signal K on a Raspi 4b somewhere else. Is this how SignalK works? Or is it more a system built around a single primary host? Is there a way to multiplex data? I'm about to install SignalK aboard, and I'm curious about how SignalK works, and how it communicates between various devices (is it like Mqtt?). I'm new to Signal K, but I have a lot of experience with microcontrollers and Home Assistant (but not so much that I'm sure that HA runs on Node Red, though I think they're similar?) Thanks for your help!
34 Replies
Scott Bender
Scott Bender6mo ago
Short answer is “Yes”. You can have have multiple sk servers, and a server can bring in data from another sk server. This would use WebSockets
joshgraff
joshgraffOP6mo ago
What's the integration like? Does signalk auto-discover? I've seen NMEA and openCPN work shockingly well together, so part of me is thinking I should just try it and see what happens.
Scott Bender
Scott Bender6mo ago
It does auto discover, but it won’t automatically load data. You have to do some setup in the admin ui.
joshgraff
joshgraffOP6mo ago
Interesting! Thanks for your help! While I have you, is this a typical method? Or do most people just use one host?
Scott Bender
Scott Bender6mo ago
Most just use one host, but some people do have setups similar to your proposal
joshgraff
joshgraffOP6mo ago
Cool. I'll give it a shot. Thanks for your time.
Scott Bender
Scott Bender6mo ago
You’re welcome
Teppo Kurki
Teppo Kurki6mo ago
add a signalk connection from rpi4 to your zero. the connection is over websocket. unlike mqtt there are no options for delivery guarantees, it works if tcp works
joshgraff
joshgraffOP6mo ago
Nice. I'll give it a shot. So I got signal k on a raspi working and talking to my sea talk devices. And I have signal k installed on my laptop and added the web socket connection to the raspi. None of my data is coming across, though. Is there a step I need to take to select which data is forwarded?
Tony
Tony6mo ago
By default everything without passing a subscription json. Did you check the checkbox ‘act as self ? All paths should show up in your data browser
joshgraff
joshgraffOP6mo ago
Act as self... I'll read the manual about that, I wasn't familiar with its use. I worked around it by using the apps as hosted on the raspi instance, which may be as was intended.
doug
doug6mo ago
I'm doing something similar, I have 2 N2K networks onboard one for nav devices and one for digital switching. So I've set up two rPi's with hats to get the data. I've created the connections and the switching one works just fine. I've subscribed to one data path, when I activate the connection on the other server the cpu and temp go through the roof and I end up needing to reboot. Am I somehow creating a loop there is only a few bits of data that I want to pull over so I set up the subscription to only one path from each server.
Tony
Tony6mo ago
I would not have them subscribe to each other and allow all paths. Limit the paths to only what you need by adding a subscription json with intervals for updating each path
joshgraff
joshgraffOP6mo ago
Paths are a bit of a new concept to me. Is there a place in the docs you could recommend? I'm not sure if it could be focused, but my current roadblock is getting NMEA 0183 OUT of signalk on the same FTDI that's feeding it in, to control an ST4000 (and interface openCPN to the plotter I have on the 0183 circuit) I can't really seem to find the place in the docs for such an issue.
Teppo Kurki
Teppo Kurki6mo ago
GitHub
Events and Outputting Data
An implementation of a Signal K central server for boats. - SignalK/signalk-server
joshgraff
joshgraffOP6mo ago
I think it might! It looks really promising, thank you!
doug
doug6mo ago
Thanks yes I am subscribing to just one path of data from each server. I didn't have a period on there so I tried adding a long period of 10 mins (600000ms) That did seem to help a bit but even then each server is displaying about 800 deltas being processed each second. As soon as I disable one of the connections that drops right down to about 1 delta/s . I'll keep trying different things.
Teppo Kurki
Teppo Kurki6mo ago
Sorry, i am not really getting how you are setup. Cpu 100% when you activate the connection is most probably a loop
doug
doug6mo ago
I have two rPi's on two different N2K nets, one for digital switching one for nav data. CPU doesn't go to 100% but it does double from normal 15% to 30 or 40% as soon as I enable the second connection. One connection from the navNet subscribed to the powerNet single path subscription 600000ms period. CPU 15% deltas/s 1. Enabling the connection from the powerNet to the navNet for one path and 600000ms period instantly doubles the CPU on both servers and each show the connections of 800 deltas/s in the dashboard.
Teppo Kurki
Teppo Kurki6mo ago
What paths are you subscribing at each end? Or share your subscriptions
doug
doug6mo ago
From the navNet to to the powerNet { "context": "vessels.self", "subscribe": [ { "path": "electrical.batteries.240.voltage", "period": 600000 } ] } from the powerNet to the navNet { "context": "vessels.self", "subscribe": [ { "path": "environment.sun", "period":600000 } ] }
Teppo Kurki
Teppo Kurki6mo ago
That makes zero sense, something’s off here
doug
doug6mo ago
That's what I thought too
Teppo Kurki
Teppo Kurki6mo ago
Will try to verify similar setup
doug
doug6mo ago
Thank you I'm kinda new to this and trying to learn as much as I can
Teppo Kurki
Teppo Kurki6mo ago
beat you! 🤣
No description
Teppo Kurki
Teppo Kurki6mo ago
there's a "hidden" subscription to notifiations.* that I was not aware of. with a similar setup, crosslinked servers with one different path subscription each everything is ok - until I manually trigger a notification, and then the loop gets going hidden = I was not aware of it a quick fix is to throw all the notifications in the trash, for example with a node-RED flow. but this needs a fix, just not going to be able to work on it for some days or you can map all notifications to nottifications with path mapper plugin
Teppo Kurki
Teppo Kurki6mo ago
oh, the fix is actually really simple https://github.com/SignalK/signalk-server/pull/1736
GitHub
fix: don't subscribe to notifications in sk connections by tkurki ·...
@signalk/client subscribes by default to notifications.*. This is confusing in the first place if the user enters an explicit subscription and gets more than they subscribed. Furthermore this wreak...
Teppo Kurki
Teppo Kurki6mo ago
if you can find the mdns-ws.js file in your installation you can turn the notifications off there and verify if this will fix your problem
doug
doug6mo ago
Great thank you. I'm not able to find that file on either of my servers. I found it and changed it all good now no more looping. Thank you sooooo much
juans#0046
juans#00464mo ago
Hi, did you get it work? I'm waiting ftdi USB to try it.
joshgraff
joshgraffOP4mo ago
Nope. Did not get it to work. Let me know if you figure out how to get it to work. I pivoted to making an mqtt-Seatalk bridge
juans#0046
juans#00464mo ago
what was was the problem?
joshgraff
joshgraffOP4mo ago
My setup is mostly Seatalk, but I have an nmea bridge (an old one) in the system. The bridge outputs nmea no problem. It didn't seem to like any of the nmea input from the RPI. I tried porting the serial out directly into the bridge, no joy. I tried using optoisolators to change the voltage, no joy. So I presume either my bridge is toast on the nmea input, or I'm messing something up with the serial output. Either way, I further presume that autohelm control characters (which aren't standard nmea sentences) wouldn't be passed through and so I figured a different approach might be more fruitful.
Want results from more Discord servers?
Add your server