sk-to-nmea2000: Battery state of charge missing on n2k side?
I collect battery data via the victron plugin and have voltages, current, state of charge available in sk. I want to display this data on n2k devices (Raymarine a67 plotter, i70s display.). In the plugin sk-to-nmea2000 I configured my battery instances 0 and 1, as intended I then see voltages and currents on my nmea2000 devices. But state of charge does not show up.
As a workaround I also mapped battery state of charge to the tank level of a "dummy tank" and configured this tank in sk-to-nmea2000. Then I can see battery state of charge as tank level on my n2k devices.
What can be the problem, that I am not able to directly send battery state of charge to n2k?
41 Replies
This should definitely work. Turn on debug for the plugin so we can see what it’s sending…
here an example:
May 09 17:27:13 2024-05-09T17:27:13.548Z signalk-to-nmea2000 emit nmea2000JsonOut {"pgn":127506,"DC Instance":1,"DC Type":"Battery","Instance":1,"State of Charge":95.8,"Time Remaining":-60,"Ripple Voltage":null}
On first sight: Here, SOC is sent as 95.8, tank level ist sent as fraction of 1.
How is battery SOC defined in n2k? Fraction of 100 or fraction of 1?
fraction of 100
Tanks too
Thats what I get for tanks:
May 09 17:31:16 2024-05-09T17:31:16.553Z signalk-to-nmea2000 tanks.fuel.1.currentLevel,tanks.fuel.1.capacity:0.959,
shown as 95.9% on the n2k side
that’s the sk value
That’s not the n2k message
true
May 09 17:31:16 2024-05-09T17:31:16.553Z signalk-to-nmea2000 emit nmea2000JsonOut {"pgn":127505,"Instance":1,"Type":"Fuel","Level":95.89999999999999,"Capacity":0}
understood 😉
I know this used to work and hasn’t changed
I need to check on my i70.
You definitely don’t have any conflicts, right? Something else could be sending info or battery instance 0 or 1?
Have to check debug log, good to know at this point, that above log messages should be ok
Going to test in lab now with a garmin mfd. will check my i70 next time I’m on the boat…
no hurry, its something where I use the "tank level" workaround since two or three years since there were other priorities. Now decided, to finally try to figure out what is going on here.
Now on a completely new system, new raspbian, latest sk server, waveshare CAN hat instead of ikonvert etc. All works perfectly fine, but still this issue with the battery SOC
Garmin is seeing it. And setup similar to yours. Battery info is coming from a Cerbo.
This here is what I extracted from sk-to-n2k debug log with respect to my batteries:
May 09 17:31:17 2024-05-09T17:31:17.047Z signalk-to-nmea2000 electrical.batteries.0.voltage,electrical.batteries.0.current,electrical.batteries.0.temperature,electrical.batteries.0.capacity.stateOfCharge,electrical.batteries.0.capacity.timeRemaining,electrical.batteries.0.capacity.stateOfHealth,electrical.batteries.0.ripple:13.57,,,,,,
May 09 17:31:17 2024-05-09T17:31:17.048Z signalk-to-nmea2000 emit nmea2000JsonOut {"pgn":127508,"Battery Instance":0,"Instance":0,"Voltage":13.57,"Current":null,"Temperature":null}
May 09 17:31:17 2024-05-09T17:31:17.050Z signalk-to-nmea2000 electrical.batteries.1.voltage,electrical.batteries.1.current,electrical.batteries.1.temperature,electrical.batteries.1.capacity.stateOfCharge,electrical.batteries.1.capacity.timeRemaining,electrical.batteries.1.capacity.stateOfHealth,electrical.batteries.1.ripple:13.731,3.37,,0.959,-60,,
May 09 17:31:17 2024-05-09T17:31:17.050Z signalk-to-nmea2000 emit nmea2000JsonOut {"pgn":127508,"Battery Instance":1,"Instance":1,"Voltage":13.731,"Current":3.37,"Temperature":null}
May 09 17:31:17 2024-05-09T17:31:17.051Z signalk-to-nmea2000 emit nmea2000JsonOut {"pgn":127506,"DC Instance":1,"DC Type":"Battery","Instance":1,"State of Charge":95.89999999999999,"Time Remaining":-60,"Ripple Voltage":null}
instance 0: starter battery, only voltage. instance 1: house battery, voltage, current and SOC
next time you're on the boat it would be interesting, if your i70 sees it
Your data looks very similar to mine
Might be on the boat later today, definitely tomorrow…
My i70 sees it
They call it “Battery Charge”
That's good to see, thank you Scott
Now I have to figure out, what I'm doing wrong
I’m on the boat now, let me see exactly what my n2k output looks like.
But as you said before, essentially your log messages from the sk-to-n2k plugin look the same like what I posted before, right?
Is your i70 software up to date?
Not sure, but Raymarine says the latest version is v3.20 from September 2020, I think, I updated after that date
also the a67 plotter does not show SOC
Looks essentially identical
yep
Probably I need to sniff traffic on the n2k bus to see what is going on there
what hardware are you using for the n2k interface?
The last seasons I used an iKonvert, since this spring a Waveshare CAN hat
did not work with both, anything else that I am aware of works fine
I'm using the Waveshare
thats the one I use: https://www.waveshare.com/wiki/2-CH_CAN_HAT
Same here
I still have the iKonvert available, should allow me to sniff the n2k bus from e.g. a laptop with Linux, right?
My i70 is v3.20 also
You have the usb iKonvert?
Instructions here for installing canboatjs and dumping iKonvert stream: https://github.com/canboat/canboatjs
GitHub
GitHub - canboat/canboatjs: Native javascript NMEA 2000 decoder and...
Native javascript NMEA 2000 decoder and encoder. Contribute to canboat/canboatjs development by creating an account on GitHub.
Do you have resend set in the plugin?
Just had a look, resend is off for all enabled pgn
Should it be on?
Yes. Venus OS does not send fast enough for n2k.
But I would expect to see it show up and then disappear on the i70. Also the other data.
Worth a try…
The other data is shown just fine
I will try it next weekend, lets see if it makes a difference
Well, on the boat now. What can I say, I almost feel a bit ashamed, that I confused battery instances 1 and 2 all along. sk bat 0 is starter (no shunt), sk bat 1 is house (shunt). n2k bat 1 is starter, 2 is house. Somehow I mixed it up and always wondered why I do not see SOC of n2k bat 1...
Now I selected n2k bat 2, and there it is: SOC!
That’s my kind of solution!
😉
took me more than two years to figure this out...🙃
🤣
The "temporary" solution with mapping SOC to a virtual tank just worked way too good...