OpenMarine

Full Version: SignalK and Remote Displays
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,
I'm just learning about SignalK, and have just finished coding a remote temperature monitoring system that sends SignalK strings to Openplotter using UDP.

My question is about how to do remote displays. I did a display a while back that receives NMEA via MQTT and displays things like lat/lon, SOG, etc. Now I'm wanting to do a similar display that receives SignalK strings and decodes them.

I understand how this works with NMEA0183: the data is on the wire, or in the case of MQTT, it's in TCP packets. In the case of MQTT, the display subscribes to a topic on the server and gets the data. I don't know a lot about NMEA2000, but I assume that since it's a bus-based system, all data is on the bus and the displays just take what they want (I'm sure this is a huge simplification, but since I'm not doing anything with NMEA2000, I don't really care!).

So, we come to SignalK. What is the best way to send SIgnalK JSON packets to a display device? Is the data being sent like a firehose as in NMEA0182, is everything on the net like NMEA2000, or is the display requesting specific data? If it is requesting the data, do I then need another layer like MQTT or REST to request the data from the server? Is there no way to just send the data via UDP? If so, how? I'm not seeing anything in the Openplotter SignalK server that would allow me to do this.

I've been reading through the SignalK documentation, and the documentation of a few SignalK plugins, and I'm not getting it.

TIA
The sigk data is sent over a websocket
http://signalk.org/specification/0.0.1-1...g_api.html

Or if you wanted to slow things down a bit you could stick with mqtt getting sent using node red with a delay node just sending the data you're interested in, sigK has a node red app.

Sent from my SM-T813 using Tapatalk
Have you looked at the mini web examples? /usr/lib/node_modules/signalk-server/public/examples
Signal K is a server it sends all its data the client is asking for. You shoudn't change anything on the server side.
Do some tests in your browser:
http://openplotter.local:3000/signalk/v1...ssels/self
http://openplotter.local:3000/signalk/v1...sure/value
I think openweathermap etc. work nearly the same. There are many examples on the net. Search for "ESP8266-01 Based Weather Forecasting"
I've been reading and playing with example code all afternoon. I think I get it - I can do a GET and receive the JSON from the server, then just parse what I need from that. I guess what I find interesting is that it is a two-way communication between the instrument and the server, which isn't something you would see in the NMEA0183 world. I guess that's a good thing!

I'll keep hacking away. Running into silly compiling roadblocks like getting the HTTPClient library to work with ESP32, but I'll get there.

Making progress, slowly. Thanks.
Http GET is not the way to go, instead use WebSockets and subscribe to the data that you want.

This way you get only the data you need only when it changes. With http you need to be polling all the time to receive updates.

See Subscription protocol in the Signal K Soecification.

With a bit of Googling you should be able to find a project with all the plumbing already in place, for example https://github.com/joelkoz/signalk-analog-gauge


Sent from my iPhone using Tapatalk
Great. Thanks.

On to Websockets! I'm going to need an ice ax to climb this learning curve!