Sending NMEA messages from Node Red plugin.

727 views
Skip to first unread message

Brian Scally

unread,
Mar 17, 2021, 2:53:35 AM3/17/21
to Signal K
Now Scott helped me get the Fusion data into the Signal K server. I have made a dashboard displaying all the status of the Fusion systems.

It would be nice to be able to hit 'mute' and change volume and sources from the 'media' tab of my Node Red Dashboard.

Clearly you can't modify the server data for volume as these are broadcast on a different pgn.
So you need to talk to the head unit directly.
Scott's signalk-fusion-stereo server plug manages this, and I have verified by throwing alarms in and getting them out of the speakers.

Taking the example of a single volume slider.

The approach I am taking is :
image.png
Use a subscribe node to set the volume slider to the present value.
Movement events of the slider are formatted into Actisense format and sent to the N2K network through the YDEN-2 interface configured in bidirectional TCP mode.

I picked the Actisence format over the JSON format as I could not work out how to include the network address of the Fusion head unit in that format.

However .. though the volume slider tracks the rotation of the volume knob, the set volume fails.

The format function is based on my reading od Scott's implementation,
I haven't got the NMEA analyser out to see what is actually being fired, that is my next step.

A review and  comments that get this working would ease along the next great chunk of integration work.

Thanks
Mub

-- The Node Red code is:

[{"id":"171ac3d3.4166fc","type":"signalk-subscribe","z":"af015e98.b4011","name":"","mode":"sendAll","flatten":true,"context":"vessels.self","path":"entertainment.device.fusion1.output.zone1.volume.master","source":"","period":"5000","x":300,"y":280,"wires":[["844810fc.ec8e7"]]},{"id":"844810fc.ec8e7","type":"ui_slider","z":"af015e98.b4011","name":"","label":"Volume","tooltip":"","group":"7067103.e483bf","order":1,"width":0,"height":0,"passthru":true,"outs":"end","topic":"topic","topicType":"msg","min":0,"max":"26","step":1,"x":480,"y":280,"wires":[["5d478867.733f78"]]},{"id":"2e72b1e5.6f160e","type":"signalk-send-nmea2000","z":"af015e98.b4011","name":"","nmea2000Event":"nmea2000out","nmea2000JsonEvent":"nmea2000JsonOut","x":850,"y":280,"wires":[]},{"id":"5d478867.733f78","type":"function","z":"af015e98.b4011","name":"","func":"n2k_msg= (new Date()).toISOString()+\",6,126720,1,28,8,a3,99,19,00,\"+msg.payload.toString(16)+\",\"+msg.payload.toString(16)+\",\"+msg.payload.toString(16)+\",\"+msg.payload.toString(16);\n\n\nmsg.payload = n2k_msg;\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":640,"y":280,"wires":[["2e72b1e5.6f160e"]]},{"id":"7067103.e483bf","type":"ui_group","name":"Fusion Volume","tab":"a30ce661.173488","order":1,"disp":true,"width":"6","collapse":false},{"id":"a30ce661.173488","type":"ui_tab","name":"Media","icon":"dashboard","disabled":false,"hidden":false}]

--

sc...@scottbender.net

unread,
Mar 17, 2021, 9:17:24 AM3/17/21
to Signal K

You can actually just use the fusion plugin to this (and other things, like change the source, prev/next track, etc.).

I'm going to write some documentation today. (and update the API's to make them current, this has been on my list anyway)

-=Scott

Brian Scally

unread,
Mar 17, 2021, 10:23:22 AM3/17/21
to Signal K
Scott

Thankyou.

If you have an early draft of either the documentation, examples or the new plugin I will happy review and test.


Brian

--
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/b94ae956-db30-4247-8c8e-2e184649084cn%40googlegroups.com.

sc...@scottbender.net

unread,
Mar 17, 2021, 10:42:24 AM3/17/21
to Signal K

sc...@scottbender.net

unread,
Mar 17, 2021, 10:44:18 AM3/17/21
to Signal K
I haven't done much with the dashboard in node-red, so not sure how to do this, but in theory you can use the "send put" node?

sc...@scottbender.net

unread,
Mar 17, 2021, 11:58:54 AM3/17/21
to Signal K
It's working with the Dashboard:

[{"id":"fc56aacc.889408","type":"signalk-subscribe","z":"bad78a56.9becb8","name":"","mode":"sendAll","flatten":true,"context":"vessels.self","path":"entertainment.device.fusion1.output.zone1.volume.master","source":"","period":1000,"x":150,"y":500,"wires":[["e9b11cf1.0e7c88"]]},{"id":"e9b11cf1.0e7c88","type":"ui_slider","z":"bad78a56.9becb8","name":"","label":"Volume","tooltip":"","group":"54bae0f1.50cc","order":1,"width":0,"height":0,"passthru":false,"outs":"end","topic":"entertainment.device.fusion1.output.zone1.volume.master","min":0,"max":"24","step":1,"x":380,"y":400,"wires":[["64686842.76ea18"]]},{"id":"64686842.76ea18","type":"signalk-send-put","z":"bad78a56.9becb8","name":"","path":"entertainment.device.fusion1.output.zone1.volume.master","source":"","x":620,"y":400,"wires":[]},{"id":"f134fd23.ed3748","type":"ui_button","z":"bad78a56.9becb8","name":"","group":"54bae0f1.50cc","order":2,"width":0,"height":0,"passthru":false,"label":"Play","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":380,"y":580,"wires":[["e675e69d.c52088"]]},{"id":"e675e69d.c52088","type":"signalk-send-put","z":"bad78a56.9becb8","name":"","path":"entertainment.device.fusion1.play","source":"","x":620,"y":580,"wires":[]},{"id":"8eb7f418.71dcd","type":"signalk-send-put","z":"bad78a56.9becb8","name":"","path":"entertainment.device.fusion1.pause","source":"","x":640,"y":660,"wires":[]},{"id":"14b19cdf.100673","type":"ui_button","z":"bad78a56.9becb8","name":"","group":"54bae0f1.50cc","order":3,"width":0,"height":0,"passthru":false,"label":"Pause","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":380,"y":660,"wires":[["8eb7f418.71dcd"]]},{"id":"54bae0f1.50cc","type":"ui_group","name":"Fusion","tab":"664f4aec.a81b34","order":1,"disp":true,"width":"6","collapse":false},{"id":"664f4aec.a81b34","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Brian Scally

unread,
Mar 17, 2021, 1:16:47 PM3/17/21
to Signal K
Scott

Testing now.

THANKYOU.

One thing I noted in the documentation is that in the documentation the JSONs are not properly formed.
You have trailing commas after the value fields in all the single line JSONs
I think the volume example should read..  At least my parser barfs..

PUT http://localhost:3000/signalk/v1/api/vessels/self/entertainment/device/fusion1/output/zone1/volume/master
{
  "value": 12
}

sc...@scottbender.net

unread,
Mar 17, 2021, 1:20:23 PM3/17/21
to Signal K
Yep. Thanks! fixed

sc...@scottbender.net

unread,
Mar 17, 2021, 1:23:46 PM3/17/21
to Signal K
Make sure you look at my dashboard example above. With node-red, you don't have to mess with JSON or real HTTP PUTs. Just use the send-put node.

Brian Scally

unread,
Mar 17, 2021, 2:41:03 PM3/17/21
to Signal K
Yes the flow is functional!

It took a little messing to get it to work.

Initially I did not \get functionality..

Looking at the debug log I get...

Mar 17 11:14:21 2021-03-17T18:14:21.248Z signalk-fusion-stereo path: entertainment.device.fusion1 deviceid: null command: {"action":"setVolume","device":"entertainment.device.fusion1","zone":"zone1","value":5}
Mar 17 11:14:21 2021-03-17T18:14:21.250Z signalk-fusion-stereo n2k_msg: 2021-03-17T18:14:21.250Z,6,126720,1,null,6,a3,99,18,00,00,05
Mar 17 11:14:26 2021-03-17T18:14:26.172Z signalk-fusion-stereo looking for a stereo
Mar 17 11:14:31 2021-03-17T18:14:31.171Z signalk-fusion-stereo looking for a stereo
Mar 17 11:14:36 2021-03-17T18:14:36.172Z signalk-fusion-stereo looking for a stereo
Mar 17 11:14:41 2021-03-17T18:14:41.171Z signalk-fusion-stereo looking for a stereo

I have data populated from the stereo, and when I wiggle the volume knob the subscribe nodes updated the volume dashboard slider.

Of course If I then knock the dashboard slider it attempts to send a message to null.. and the bridge between the service NMEA and nav NMEA screams.
(WHY I put an alarm on it I will never know)

If I populate the address field with 38, turn of discovery, restart .. it finds the stereo and then if I switch on discovery and it functions finding the other head units.
I restarted the NMEA network and forced the fusion unit to a different address by having a fast boot device on 38 I get the same behaviour.
However the RA770 really likes to be on 38.

I do not know if the autodiscovery is struggling with the YDEN-2 bridge or...

I am happy to run more debug - if you can suggest what you would like done.
--
Also it looks like the Fusion ethernet control protocol is fairly close to the N2K protocol and looks like the packets are just ethernet wrapped N2K.
It appears that they might actually be requiring the correct N2K address for the device in the packet.
I will spend some more time with wireshark later.  But now the day job calls.

--
Also
I have a more expansive flow written that works from a 'remote' node red node.  I get twitchy about running 'user programs' on data servers that multiple systems rely on.
I am just adding some comments and cleaning my breakfast hack and will share soon.

Brian


sc...@scottbender.net

unread,
Mar 17, 2021, 2:53:48 PM3/17/21
to Signal K
Oh. You have multiple head units? This stuff is definitely not setup to handle that.

Definitely turn off discovery and maybe filter out message from all but one head unit. (That's under the "Data Connection").

I can start working on support for multiple head units. That's going to take some time...

-=Scott

Brian Scally

unread,
Mar 17, 2021, 3:20:23 PM3/17/21
to Signal K
Yes  that was my solution
This is good progress.  
 
On the full system there are 2 NMEA units ( MS-RA770 - MS- RA670 ) and units and 3 ethernet only MS-SRX400    ( Do I spend too much on boat electronics ? )

I was interested that they did pick up and sync to the AVB time server on the network. 

I also have access to some alternate brands such as the JL Audio and some PMX5?  That should work with the default profiles.  They will just bark on the Fusion check in the code as is.

If you really want a job list...

Brian

Clive Wright

unread,
Nov 29, 2025, 9:49:52 PM (3 days ago) Nov 29
to Signal K
Hey great thread. 
I am trying to get it working on a Cerbo GX but I get a PUT error:
"put error 405 PUT not supported for entertainment.device.fusion1.output.zone1.volume.master"

The GET request works.
Screenshot 2025-11-30 154847.jpg
Any thoughts on how I may be able to get it to work?
cheers,
Clive.
Reply all
Reply to author
Forward
0 new messages