question

bathnm avatar image
bathnm asked

Node Red, Signal K and NMEA 2000 Devices

Just wondering if anyone has looked at how to get Node Red to send a message to a NMEA 2000 device. I am looking to install a yacht devices YSDC-04, and want to to switch the switches within Node Red flows.

Just asking if anyone has any pointers.

I am aware of the @signalk/node-red-embedded for when node-red is embedded in Signal

Venus OSNode-REDSignalK
18 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Hi @Bathnm,

I don't know of any way other than using the nodes from node-red-embedded within SignalK. Unfortunately their nodes are working only when embedded.


I've two YDCC-04 and switch them remotely using SignalK -> signalk-n2k-switching-plugin -> WilhelmSK

0 Likes 0 ·
bathnm avatar image bathnm Stefanie (Victron Energy Staff) ♦♦ commented ·

Looks like you an do it, but requires a fair amount of work.

watched this Youtube Video. Open a session to port 8375, then parse the msg payload for what is required. Not sure how to push data back to SignalK,

Wonder if we just load the Victron contrib into the embedded node red?

0 Likes 0 ·
Stefanie (Victron Energy Staff) avatar image Stefanie (Victron Energy Staff) ♦♦ bathnm commented ·

Not really much work. But I use WilhelmSK for visualisation and control. This makes things a lot easier.

Have been following his channel on youtube for quite a while. Parsing msg.payload is the easy part, push into N2K is not because it's RAW data and needs to be converted.

Yes, installing @victronenergy/node-red-contrib-victron into SignalK Node-Red embedded should work.

0 Likes 0 ·
bathnm avatar image bathnm Stefanie (Victron Energy Staff) ♦♦ commented ·

Do you know if we can install the Victron components into the embedded node red. If so then we just do that and turn the main node red off...

0 Likes 0 ·
Stefanie (Victron Energy Staff) avatar image Stefanie (Victron Energy Staff) ♦♦ bathnm commented ·

I could try, but currently I have wrecked my node-red installation from the large image. But I'm pretty sure that this will work.

0 Likes 0 ·
bathnm avatar image bathnm Stefanie (Victron Energy Staff) ♦♦ commented ·

I have node red embedded in SignalK with the Victron palette installed.

So it comes down to which node do you build flows in! Both could be a bit confusing.

0 Likes 0 ·
Stefanie (Victron Energy Staff) avatar image Stefanie (Victron Energy Staff) ♦♦ bathnm commented ·

It depends on what you want.

For switching the YDCC-04 via node-red, you don't need the Victron nodes.

Provided that your n2k network is connected to signalk, n2k raw data is converted to signalk paths. Then use the signalk-input-handler node to read the state of the switching device channel, change the state with a change node and send it back to n2k with signals-send-nmea2000 node.

bildschirmfoto-2021-01-25-um-223035.png

0 Likes 0 ·
bathnm avatar image bathnm Stefanie (Victron Energy Staff) ♦♦ commented ·

Do you have a further example of switching a data channel on the YDCC-04

0 Likes 0 ·
Stefanie (Victron Energy Staff) avatar image Stefanie (Victron Energy Staff) ♦♦ bathnm commented ·

You mean from within node-red? No, sorry. As said earlier, I'm doing this via Signalk Server.

What exactly you are looking for?

0 Likes 0 ·
bathnm avatar image bathnm Stefanie (Victron Energy Staff) ♦♦ commented ·

Just wondering how you are using SignalK to switch a channel on or off.

0 Likes 0 ·
Stefanie (Victron Energy Staff) avatar image Stefanie (Victron Energy Staff) ♦♦ bathnm commented ·

As I told you above, I'm using WilhelmSK for switching.

  • Get your switching device connected to n2k.
  • Make sure n2k is connected to your GX device, which will act as a n2k bridge between n2k and signalk (large image).
  • Setup a new data connection in signalk for n2k with source Canbus (canbusjs)
  • Install signalk-n2k-switchin-plugin into signalk and enable it from the plugin config in the GUI.
  • Install WilhelmSK onto your iPhone or iPad and set it up to connect to your signalk server.
  • Set up your gauges in WilhelmSK.
  • Choose Switch or Switch Bank as a gauge and browse the paths (they automatically appear when connected to the sk server) for the corresponding path.

Now you should be able to switch whatever you want.


bildschirmfoto-2021-01-27-um-101035.png


bildschirmfoto-2021-01-27-um-101343.png


0 Likes 0 ·
Stefanie (Victron Energy Staff) avatar image Stefanie (Victron Energy Staff) ♦♦ bathnm commented ·

But you might run into a bit of trouble with the victron nodes. At least for the moment until the issue is fixed. I just got the same problem:

https://github.com/victronenergy/node-red-contrib-victron/issues/66

0 Likes 0 ·
mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ Stefanie (Victron Energy Staff) ♦♦ commented ·

Hey @Stefanie, that issue was fixed by sbender in v1.4.0 or v1.4.1 - so I'm not sure how you can run into that.

0 Likes 0 ·
Stefanie (Victron Energy Staff) avatar image Stefanie (Victron Energy Staff) ♦♦ mvader (Victron Energy) ♦♦ commented ·

Yes I know, Matthijs.

NPM is showing 1.4.1, but when installing the nodes into a SignalK installation without Venus, they show up as 1.3.2.

I don't know how to check node-red-contrib-victron version, but I'm pretty sure they install as 1.3.2. At least that's what the screenshots and duplicate nodes message suggest.

I

bildschirmfoto-2021-01-26-um-103722.png



bildschirmfoto-2021-01-26-um-103834.png


bildschirmfoto-2021-01-26-um-103916.png

bildschirmfoto-2021-01-26-um-104216.png


0 Likes 0 ·
bathnm avatar image bathnm Stefanie (Victron Energy Staff) ♦♦ commented ·

@Stefanie, I have managed to get 1.4.1 installed in the embedded node-red.

1611667804777.png


I tried running this command in the directory /data/conf/signalk/red which is the embedded node red

npm install /usr/lib/node_modules/\@victronenergy/node-red-contrib-victron


This should have created a link to the installed version, and it kept failing. I then ran this command

npm i @victronenergy/node-red-contrib-victron


in the same directory and all sorted. I now have 2 node red's, one that has no knowledge of the NMEA2000 capabilities of signalK and one that does.

Making the embedded the one accessible via port 1880 would be brilliant as it means only one is installed.


0 Likes 0 ·
1611667804777.png (518.1 KiB)
Stefanie (Victron Energy Staff) avatar image Stefanie (Victron Energy Staff) ♦♦ bathnm commented ·

Nice!

But in my opinion it would be much better to have @signalk-node-red-embedded nodes working in the large image node-red installation.

I'll ask one of the developers.

You should think about joining @Signalk-dev on Slack. It's much easier to ask and get great support. If you want, I can send you an invite. Just pm me your email or leave it in your reply so that only I can see it.

0 Likes 0 ·
bathnm avatar image bathnm Stefanie (Victron Energy Staff) ♦♦ commented ·

It would be good to have the @signalk-node-red-embedded nodes working in the large image node-red installation.

0 Likes 0 ·
bathnm avatar image bathnm mvader (Victron Energy) ♦♦ commented ·

@mvader (Victron Energy) Unfortunately when you search in the palette for nodes, it is only giving you the option to install 1.3.2.

0 Likes 0 ·
0 Answers