SK / Node Red / Digital Switching Maretron DCR-100
I am traying to get digital switching working via SignalK and Node Red.
I have installed the following plugins:
- @signalk/signalk-node-red (operational)
- signalk-n2k-switching (configured - all on)
- signalk-maretron-proprietary (configured - all on)
I try to set electrical.switches.bank.11.3.state on a Maretron DCR 100
My node red dashboard:
[{"id":"89afe19b71f08c67","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"fc56aacc.889408","type":"signalk-subscribe","z":"89afe19b71f08c67","name":"","mode":"sendAll","flatten":true,"context":"vessels.self","path":"electrical.switches.bank.11.3.state","source":"","period":1000,"x":280,"y":120,"wires":[["4e791c49bf5180ba","a8c1e2500c85d9a1"]]},{"id":"64686842.76ea18","type":"signalk-send-put","z":"89afe19b71f08c67","name":"","path":"electrical.switches.bank.11.3.state","source":"","x":900,"y":120,"wires":[]},{"id":"4e791c49bf5180ba","type":"debug","z":"89afe19b71f08c67","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":580,"y":220,"wires":[]},{"id":"a8c1e2500c85d9a1","type":"change","z":"89afe19b71f08c67","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":120,"wires":[["64686842.76ea18","ba1d0728653a5e38"]]},{"id":"ba1d0728653a5e38","type":"debug","z":"89afe19b71f08c67","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":880,"y":220,"wires":[]}]
The error message I get is:
put error 400 there are multiple sources for the given path, but no source was specified in the request
If I change $source in signalk-sent-put to "node-red" than I get:
put error 405 PUT not supported for electrical.switches.bank.11.3.state
Any hint would be helpful.
Thanks a lot!
66 Replies
Can you show what the switches look like in the Data Browser?
Hello Scortt, thanks for your quick reply.
Here the requested information
Try making $source NGT1.73
Thank you for your feedback. I did this for the signalk-sent-put node.
Looking at the flow I see "pending" for the signak-sent-put followed by this error in the debug log:
put error 502 Did not receive change confirmation
Console out is:
[error] [signalk-send-put:64686842.76ea18] put error 502 Did not receive change confirmation
And the switch doesn’t actually “switch”?
Have you confirmed that you’re able to send n2k messages at all?
What’s you n2k Data Connection look like?
Yes, this is correct, it does not switch.
I am using a RPI 4B with kernel 6.6.31+rpt-rpi-v8.
node v18.20.4, SignalK 2.8.3, canboatjs /dev/ttyUSB0, 115200 baud USB-NGT1 N2k Interface from Actisense with latest FW
I used the same NGT1 for TimeZero Professional on a Windows 10 machine and it was able to sent XTR to my Furuno autopilot.
Is there a way I can test that N2k data is transmitted under RPi/SK?
I have a 2nd workstation on the bus with a own NGT1 where I can read N2k using Actisense NEMAReader and I also have a Maretron IPG-100 where I use the N2KAnalyzer.
Thank you so much,
Dirk
I think you need to enable send for pgn 127502 using the Actisense windows software.
Ok, will try and give feedback
I enabled pgn 127501 and 127502 for TX. I verified this with another PC an "update from hardware" showed the setting enabled. Nevertheless the error is still the same.
Aug 16 09:32:27 16 Aug 09:32:27 - [error] [signalk-send-put:64686842.76ea18] put error 502 Did not receive change confirmation
Aug 16 09:32:42 16 Aug 09:32:42 - [error] [signalk-send-put:64686842.76ea18] put error 502 Did not receive change confirmation
Hmm
Let’s try turning on debug for the n2 switching plugin.
Also turn off the Maretron plugin for now
After disabling the Maretron Plugin I see a lot of this messages in the Log:
Aug 17 20:33:18 2024-08-17T08:33:18.299Z signalk-n2k-switching register action handler for path electrical.switches.bank.211.6.state source NGT1.212
Aug 17 20:33:18 2024-08-17T08:33:18.741Z signalk-n2k-switching register action handler for path electrical.switches.bank.213.1.state source NGT1.228
Aug 17 20:33:18 2024-08-17T08:33:18.741Z signalk-n2k-switching register action handler for path electrical.switches.bank.213.2.state source NGT1.228
Aug 17 20:33:18 2024-08-17T08:33:18.742Z signalk-n2k-switching register action handler for path electrical.switches.bank.213.3.state source NGT1.228
Aug 17 20:33:18 2024-08-17T08:33:18.743Z signalk-n2k-switching register action handler for path electrical.switches.bank.213.4.state source NGT1.228
Aug 17 20:33:18 2024-08-17T08:33:18.743Z signalk-n2k-switching register action handler for path electrical.switches.bank.213.5.state source NGT1.228
Aug 17 20:33:18 2024-08-17T08:33:18.744Z signalk-n2k-switching register action handler for path electrical.switches.bank.213.6.state source NGT1.228
Aug 17 20:33:19 2024-08-17T08:33:19.185Z signalk-n2k-switching register action handler for path electrical.switches.bank.215.1.state source NGT1.211
Aug 17 20:33:19 2024-08-17T08:33:19.186Z signalk-n2k-switching register action handler for path electrical.switches.bank.215.2.state source NGT1.211
Aug 17 20:33:19 2024-08-17T08:33:19.187Z signalk-n2k-switching register action handler for path electrical.switches.bank.215.3.state source NGT1.211
Aug 17 20:38:49 2024-08-17T08:38:49.722Z signalk-n2k-switching setting electrical.switches.bank.11.3.state to 1
Aug 17 20:38:49 2024-08-17T08:38:49.778Z signalk-n2k-switching sending {"pgn":127502,"dst":255,"Switch Bank Instance":11,"Instance":11,"Switch3":"On"}
Aug 17 20:38:50 2024-08-17T08:38:50.781Z signalk-n2k-switching sending command {"pgn":126208,"dst":73,"prio":3,"fields":{"Function Code":"Command","PGN":127501,"Priority":8,"# of Parameters":2,"list":[{"Parameter":1,"Value":11},{"Parameter":4,"Value":"On"}]}}
Aug 17 20:38:50 2024-08-17T08:38:50.782Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T08:38:48.717Z","pgn":127501} should be 1
Aug 17 20:38:51 2024-08-17T08:38:51.783Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T08:38:48.717Z","pgn":127501} should be 1
Aug 17 20:38:52 2024-08-17T08:38:52.783Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T08:38:48.717Z","pgn":127501} should be 1
Aug 17 20:38:53 2024-08-17T08:38:53.783Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T08:38:48.717Z","pgn":127501} should be 1
Aug 17 20:38:54 2024-08-17T08:38:54.783Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T08:38:48.717Z","pgn":127501} should be 1
Aug 17 20:38:55 2024-08-17T08:38:55.783Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T08:38:48.717Z","pgn":127501} should be 1
Aug 17 20:38:56 2024-08-17T08:38:56.783Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T08:38:48.717Z","pgn":127501} should be 1
Aug 17 20:38:56 17 Aug 20:38:56 - [error] [signalk-send-put:64686842.76ea18] put error 502 Did not receive change confirmation
Here the full log signalk-server > sk.log
I wonder if you need to enable send for 126208
sorry I didn't think f this before... enable debug for
signalk:actisense-out
The 126208 TX was enabled by default. I also enabled 126208 RX now.
Is Jeremy out there?!
Aug 18 07:09:50 2024-08-17T19:09:50.260Z signalk-n2k-switching setting electrical.switches.bank.11.3.state to 1
Aug 18 07:09:50 2024-08-17T19:09:50.291Z signalk-n2k-switching sending {"pgn":127502,"dst":255,"Switch Bank Instance":11,"Instance":11,"Switch3":"On"}
Aug 18 07:09:50 2024-08-17T19:09:50.294Z signalk:actisense-out sending 2024-08-17T19:09:50.293Z,2,127502,0,255,8,0b,df,ff,ff,ff,ff,ff,ff
Aug 18 07:09:50 2024-08-17T19:09:50.296Z signalk:actisense-out <Buffer 10 02 94 0e 02 0e f2 01 ff 08 0b df ff ff ff ff ff ff 70 10 03>
Aug 18 07:09:51 2024-08-17T19:09:51.298Z signalk-n2k-switching sending command {"pgn":126208,"dst":73,"prio":3,"fields":{"Function Code":"Command","PGN":127501,"Priority":8,"# of Parameters":2,"list":[{"Parameter":1,"Value":11},{"Parameter":4,"Value":"On"}]}}
Aug 18 07:09:51 2024-08-17T19:09:51.299Z signalk:actisense-out sending 2024-08-17T19:09:51.299Z,2,126208,0,73,10,01,0d,f2,01,f8,02,01,0b,04,01
Aug 18 07:09:51 2024-08-17T19:09:51.300Z signalk:actisense-out <Buffer 10 02 94 10 02 00 ed 01 49 0a 01 0d f2 01 f8 02 01 0b 04 01 0d 10 03>
Aug 18 07:09:51 2024-08-17T19:09:51.301Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T19:09:49.242Z","pgn":127501} should be 1
Aug 18 07:09:52 2024-08-17T19:09:52.301Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T19:09:49.242Z","pgn":127501} should be 1
Aug 18 07:09:53 2024-08-17T19:09:53.301Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T19:09:49.242Z","pgn":127501} should be 1
Aug 18 07:09:54 2024-08-17T19:09:54.301Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{
},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T19:09:49.242Z","pgn":127501} should be 1
Aug 18 07:09:55 2024-08-17T19:09:55.302Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T19:09:49.242Z","pgn":127501} should be 1
Aug 18 07:09:56 2024-08-17T19:09:56.302Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T19:09:49.242Z","pgn":127501} should be 1
Aug 18 07:09:57 2024-08-17T19:09:57.302Z signalk-n2k-switching checking electrical.switches.bank.11.3.state {"meta":{},"value":0,"$source":"NGT1.73","timestamp":"2024-08-17T19:09:49.242Z","pgn":127501} should be 1
Aug 18 07:09:57 18 Aug 07:09:57 - [error] [signalk-send-put:64686842.76ea18] put error 502 Did not receive change confirmation
It does not switch - the additional actisense log above
everything looks good
I don't know why it is not responding.
Or the actisense is not letting it through
did you have two of them?
can you see those messages on the bus?
I have a very busy bus. Will try to catch them from a 2nd workstation.
Aug 18 07:09:51 2024-08-17T19:09:51.298Z signalk-n2k-switching sending command {"pgn":126208,"dst":73,"prio":3,"fields":{"Function Code":"Command","PGN":127501,"Priority":8,"# of Parameters":2,"list":[{"Parameter":1,"Value":11},{"Parameter":4,"Value":"On"}]}}
Aug 18 07:09:51 2024-08-17T19:09:51.299Z signalk:actisense-out sending 2024-08-17T19:09:51.299Z,2,126208,0,73,10,01,0d,f2,01,f8,02,01,0b,04,01
I have struggled with getting the NTG-1 to send data outMaretron N2k Analyser (connected via TCPIP to the IPG-100 sees the Packages sent from the RPI/SK Actisense
This is the one I want to switch:
The DCR-100 has Instance 11 and Data Instance 11 - Is that a problem?
Is the switch instance wrong?
#4
In the Log I saw:
Aug 18 07:28:08 2024-08-17T19:28:08.314Z signalk-n2k-switching sending {"pgn":127502,"dst":255,"Switch Bank Instance":11,"Instance":11,"Switch3":"On"}
Aug 18 07:28:08 2024-08-17T19:28:08.315Z signalk:actisense-out sending 2024-08-17T19:28:08.315Z,2,127502,0,255,8,0b,df,ff,ff,ff,ff,ff,ff
Aug 18 07:28:08 2024-08-17T19:28:08.316Z signalk:actisense-out <Buffer 10 02 94 0e 02 0e f2 01 ff 08 0b df ff ff ff ff ff ff 70 10 03>
So I assume Instance and Data Instance should not matter (at least inside SK). I can't debug the NMEA sent by Actisense
I think it’s 126208 that matters
Which do you mean?
Aug 18 07:09:51 2024-08-17T19:09:51.298Z signalk-n2k-switching sending command {"pgn":126208,"dst":73,"prio":3,"fields":{"Function Code":"Command","PGN":127501,"Priority":8,"# of Parameters":2,"list":[{"Parameter":1,"Value":11},{"Parameter":4,"Value":"On"}]}}
Aug 18 07:09:51 2024-08-17T19:09:51.299Z signalk:actisense-out sending 2024-08-17T19:09:51.299Z,2,126208,0,73,10,01,0d,f2,01,f8,02,01,0b,04,01
Is 4 wrong?
Oh. Wait.Hmm. In the Picture above you see that the Actisense of SK is sending 127502.
Ok Parameter #4
That’s switch #4
Actually. No. That’s Switch 3
lol
No Problem. I am just thinking how I can dump the "raw" NMEA Traffic. Will look into the Actisense tools for thew Windows PC and see what I can Capturte. Maybe their EBL tool
Are you able to control the switch with anything else on n2k? Like an mfd?
With Maretron N2K-View I can switch everything.
Capture those messages
OK, will do
You can turn on logging on the sk connection. That should get it.
That will capture the raw messages coming in.
It won’t capture what we are sending.
This is a dump for EBL reader using only SK/RPI - don't see PGN 126208 in the List (RX is enabled for 126208)
TX?
In this log I switched 3x successfull on & off using Maretrons N2KView SW
I have:
a) RPI/SK with NGT-1 and TX enabled
b) Win11 Workstation with NGT-1 for NMEA-Reader Logging
In total I have 3x NGT1 here
To understand the Logs a bit better in Actisense EBL Tool:
SRC 2 - Actisense Connected to RPI/SK
SRC 73 -The Maretron DCR 100 I try to switch
SRC 40 - The Maretron IPG-100 used by the N2kView Software
Comparing the logfiles I don't see SRC2 (RPI/SK) sending 126208 - only SRC 40 (Maretron IPG-100). I will doublecheck the NGT1 settings.
I verified the NGT-1 HW settings for the RPI/SK machine and they are ok. I captured a additional log to check for 126208 but the log doesn't show it sending anything.
dirk@dirkpi:~ $ sudo cat /dev/ttyUSB0 -> file.txt
Here a log at the RPI.
I think you did. But did you verify that TX for 126208 is enabled.
And it stays enabled after powering it off?
yes, can verify again
BTW. This is why I gave up on the NGT-1. I could not get it to reliably send out data.
I verified it again.
Which Gateway do you recommend? Best would be one with a Ethernet LAN-Port for me.
Hardware like the Waveshare 2 is the best IMHO. It just works all the time.
The yacht devices stuff is good too.
When I google "Waveshare 2" than I only get display offers.
Super, thank you. I am currently in Fiji, so sourcing won't be easy. So will take a while till I can com back to you on this topic. Thank you very very much for your effort so far.
I will come back to you once I have a other device. Could take 2-3 Month maybe...
I have not looked at your logs. On my phone. I will take a look this week…. Might find something.
FYI - I opened a Ticket at Actisense. Let's see if they might have some useful information.
@Scott Bender I just saw that SK 2.9.0 is out with data fiddler beeing able to sent N2k. Would it be worth a try?
Would not hurt to try, but it works the same way as the plugin.
@Scott Bender I am struggeling to find any documentation how the String needs to be formated in data fiddler. Do you know where I can read about it?
I know it’s hard to see, but there’s a link at the top
“here”. lol. I need to fix that.
I tried to build the HEX sentance but quickly found out with all the frames etc it is beyond what I find easy available on google. So I tried the JSON approach from the docu.
When I copy & paste your sample I am not able to sent it to NMEA 2000 bus:
The button is "grayed out" and error message in red.
You need to break that down into json. That’s js code.
And I need to give some better examples…
Just some easy once or references how to build them would be helpful. I have the logs from the EBL Reader but can't use them 1:1
Your sample:
app.emit(
'nmea2000out',
'2017-04-15T14:57:58.468Z,0,262384,0,0,14,01,0e,00,88,b6,02,00,00,00,00,00,a2,08,00');
Captured:
Line,Time,Type,PGN,Name,Src,Dest,Pri,Size,Data
2,19:49:06.360,N2K,126208,"NMEA - Request group function",40,73,3,10,1,13,242,1,248,2,1,11,4,1,
3,19:49:06.360,N2K,126208,"NMEA - Request group function",73,40,3,7,2,13,242,1,0,2,0,
4,19:49:06.360,N2K,126208,"NMEA - Request group function",40,73,3,10,1,13,242,1,248,2,1,11,4,1,
So your sample has much more "," separated elements then what I captured.
Unsure how to match this for me as a "newbee" 😉
example:
sorry, complicated
GitHub
signalk-n2k-switching/index.js at 9c8b23325e3474e0540f8517383443dff...
Contribute to sbender9/signalk-n2k-switching development by creating an account on GitHub.
I don’t have time now, but I can get you the exact json for your switches later…
Good Morning,
The only reason the NGT would not be able to transmit a specific PGN would be because it was not enabled within the NMEA Reader Hardware config.
As we know that it has been enabled, there is not much that can be done on the NGT-1 end.
Have you contacted support at SignalK incase there is an issue with sending the specific PGN?
Best Regards,
Steve Drane
Technical Support Engineer
Actisense, 21 Harwell Road, Poole, BH17 0GE, UK
T: +44 (0) 1202 746682
[email protected]
https://www.actisense.com
Yeah, I didn’t figure they would be much help…
@Scott Bender I just wanted to let you know that I am now using the YDEN-02 FW 1.72 and the digital switching works! Thank you very much for your support!
cool. good to know.
I need to follow up with Actisense, something is definintely off and they don't seem to weant to admit it.