This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Static data from SignalK
#1
Hi all. I'm using the node-red  embedded in signalK.  All good. 
I will now try to experiment with/create an alternative "navigation Autopilot", following  a route with waypoints. Hopefully somewhat better than the OpenCPN version, which has a tendency to "cut corners" when approaching a waypoint. 
I will need (for now) three parameters to work with. Current position (updating 1Hz) , as well as two waypoints along the route (next, previous). 
For retrieving these input data I have installed the node-red-contrib-signalk v1.2.0

My initial problem is that the two (quasi) static WP are not updating in signalK, and the signalk-subscribe block in node-red only receives messages when the values change. The current position streams nicely into my stream, but the two waypoints do not even receive their initial value (apparently).

So my question is: In node-red; Is there a way to request the current value for all of these inputs, irrespective of whether they are changing or not?

Or alternatively. Is there a more clever way to handle tis in node-red? My only requirement is synchronized sets of the three positions, that I can send into my Python block for further processing...

Thanks in advance.
Leif
Reply
#2
(2026-08-27, 08:48 AM)kniven Wrote: Hi all. I'm using the node-red  embedded in signalK.  All good. 
I will now try to experiment with/create an alternative "navigation Autopilot", following  a route with waypoints. Hopefully somewhat better than the OpenCPN version, which has a tendency to "cut corners" when approaching a waypoint. 
I will need (for now) three parameters to work with. Current position (updating 1Hz) , as well as two waypoints along the route (next, previous). 
For retrieving these input data I have installed the node-red-contrib-signalk v1.2.0

My initial problem is that the two (quasi) static WP are not updating in signalK, and the signalk-subscribe block in node-red only receives messages when the values change. The current position streams nicely into my stream, but the two waypoints do not even receive their initial value (apparently).

So my question is: In node-red; Is there a way to request the current value for all of these inputs, irrespective of whether they are changing or not?

Or alternatively. Is there a more clever way to handle tis in node-red? My only requirement is synchronized sets of the three positions, that I can send into my Python block for further processing...

Thanks in advance.
Leif

***
Wouldn't the 'on delta' node do exactly that?
Reply
#3
(2026-08-27, 08:48 AM)kniven Wrote: So my question is: In node-red; Is there a way to request the current value for all of these inputs, irrespective of whether they are changing or not?

This in a function node does that
Code:
let _ = global.get('lodash');
let app = global.get('app');
let radarArchCurrent = app.getSelfPath('electrical.solar.arch.chargingCurrent');
let railsCurrent = app.getSelfPath('electrical.solar.rails.dc.current');
let shuntCurrent = app.getSelfPath('electrical.batteries.house.current');
let houseCurrent =  shuntCurrent.value - railsCurrent.value - radarArchCurrent.value;
msg.rails = railsCurrent;
msg.shunt = shuntCurrent;
msg.arch = radarArchCurrent;
msg.payload = houseCurrent;
msg.topic = "electrical.house.current";
return msg;

For retrieving these input data I have installed the node-red-contrib-signalk v1.2.0 >>
Sounds odd, if you install the node-red signalk app that node should be there already. 

Does the signalk autopilot route plugin do what you want already? I use it with pypilot but just left it at the defaults, prefer the radius it takes round waypoints so not sure if it can steer very tight.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)