SK
Signal K7mo ago
chris

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
Scott Bender
Scott Bender7mo ago
This should definitely work. Turn on debug for the plugin so we can see what it’s sending…
chris
chrisOP7mo ago
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?
Scott Bender
Scott Bender7mo ago
fraction of 100 Tanks too
chris
chrisOP7mo ago
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
Scott Bender
Scott Bender7mo ago
that’s the sk value That’s not the n2k message
chris
chrisOP7mo ago
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 😉
Scott Bender
Scott Bender7mo ago
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?
chris
chrisOP7mo ago
Have to check debug log, good to know at this point, that above log messages should be ok
Scott Bender
Scott Bender7mo ago
Going to test in lab now with a garmin mfd. will check my i70 next time I’m on the boat…
chris
chrisOP7mo ago
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
Scott Bender
Scott Bender7mo ago
Garmin is seeing it. And setup similar to yours. Battery info is coming from a Cerbo.
chris
chrisOP7mo ago
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
Scott Bender
Scott Bender7mo ago
Your data looks very similar to mine Might be on the boat later today, definitely tomorrow… My i70 sees it
Scott Bender
Scott Bender7mo ago
No description
Scott Bender
Scott Bender7mo ago
They call it “Battery Charge”
chris
chrisOP7mo ago
That's good to see, thank you Scott Now I have to figure out, what I'm doing wrong
Scott Bender
Scott Bender7mo ago
I’m on the boat now, let me see exactly what my n2k output looks like.
chris
chrisOP7mo ago
But as you said before, essentially your log messages from the sk-to-n2k plugin look the same like what I posted before, right?
Scott Bender
Scott Bender7mo ago
Is your i70 software up to date?
chris
chrisOP7mo ago
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
Scott Bender
Scott Bender7mo ago
May 12 15:03:33 wilhelm4 signalk-server[272630]: 2024-05-12T19:03:33.091Z signalk-to-nmea2000 emit nmea2000JsonOut {"pgn":127506,"DC Instance":1,"DC Type":"Battery","Instance":1,"State of Charge":99.80000305175781,"Time Remaining":null,"Ripple Voltage":null}
May 12 15:03:33 wilhelm4 signalk-server[272630]: 2024-05-12T19:03:33.091Z signalk-to-nmea2000 emit nmea2000JsonOut {"pgn":127506,"DC Instance":1,"DC Type":"Battery","Instance":1,"State of Charge":99.80000305175781,"Time Remaining":null,"Ripple Voltage":null}
chris
chrisOP7mo ago
Looks essentially identical
Scott Bender
Scott Bender7mo ago
yep
chris
chrisOP7mo ago
Probably I need to sniff traffic on the n2k bus to see what is going on there
Scott Bender
Scott Bender7mo ago
what hardware are you using for the n2k interface?
chris
chrisOP7mo ago
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
Scott Bender
Scott Bender7mo ago
I'm using the Waveshare
chris
chrisOP7mo ago
Scott Bender
Scott Bender7mo ago
Same here
chris
chrisOP7mo ago
I still have the iKonvert available, should allow me to sniff the n2k bus from e.g. a laptop with Linux, right?
Scott Bender
Scott Bender7mo ago
My i70 is v3.20 also You have the usb iKonvert?
Scott Bender
Scott Bender7mo ago
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.
Scott Bender
Scott Bender7mo ago
Do you have resend set in the plugin?
Scott Bender
Scott Bender7mo ago
No description
chris
chrisOP7mo ago
Just had a look, resend is off for all enabled pgn Should it be on?
Scott Bender
Scott Bender7mo ago
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…
chris
chrisOP7mo ago
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!
Scott Bender
Scott Bender7mo ago
That’s my kind of solution!
chris
chrisOP7mo ago
😉 took me more than two years to figure this out...🙃
Scott Bender
Scott Bender7mo ago
🤣
chris
chrisOP7mo ago
The "temporary" solution with mapping SOC to a virtual tank just worked way too good...
Want results from more Discord servers?
Add your server