question

sveinungkb avatar image
sveinungkb asked

BMV Data on VE.CAN no response to VREQ

I have a system setup where I'm trying to read VE.Can data off of a Cerbo that's connected to a BMV SmartShunt (on one of the Cerbo's VE.Direct ports). The Cerbo is setup to output NMEA2000 with "VE.Can & Lynx Ion BMS" profile.

I'm able to read the periodically published messages like SOC and consumed AH, but I'm unable to read single registers like voltage or current of the BMV.

I'm able to request product ID, product version so my communication works both ways as far as I can tell.

Sample code requesting FW ID (works) (0x0102 using VREQ 0x001):

can_bus.send(Message(id=VictronEncoder.identifier(src=0x40, dst=0xff), 
        data=bytearray([0x66, 0x99, 0x01, 0x00, 0x02, 0x01, 0xFF, 0xFF]), extended=True

In response I get 0x01 0x02 messages with reasonable values for FW version from the Cerbo.


When I try to read either the 0xEFxx registries (either single registry or using a mask) using the example message in this document BMV Nmea 2000, but there's no response for these values from any devices.

can_bus.send(Message(id=VictronEncoder.identifier(src=0x40, dst=0xff), 
        data=bytearray([0x66, 0x99, 0x01, 0x00, 0x00, 0xEF, 0xE0, 0xFF]), extended=True))

I've also tried reading the 0x1001 registry using a 0xFF 0xFF mask (Charged Voltage in VE Can Registers Public) hoping maybe that would hold the current and voltage registries I'm hoping to read, without success.



I hope there's something fundamental I'm missing here and the forum can unblock me! Thanks in advance!


screen-shot-2023-06-04-at-213413.png


VE.DirectVE.CanVE.Direct Bluetooth Smart Dongle
2 |3000

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

2 Answers
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered ·
2 |3000

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

Martin (Victron Energy) avatar image
Martin (Victron Energy) answered ·

Hi @sveinungkb,

I'm afraid that VREG 0x0FFF (SoC) is not available for the N2K-out function of the battery monitor. The Cerbo responds with a NACK when non-existing VREGs are requested. See this example for requesting register 0x0FFF.

root@einstein:~# vreg -n 0x3D -d --get 0x0FFF
000.001 > 7.0.0.EF.3D.FE| 0x66 0x99 0x01 0x00 0xFF 0x0F 0xFF 0xFF <- request
134.047 { 7.0.0.EF.3D.FE| 0x66 0x99 0x01 0x00 0xFF 0x0F 0xFF 0xFF <- loopback
000.003 [ 7.0.0.EF.FE.3D| 0x66 0x99 0x02 0x00 0xFF 0x0F 0x00 0x80 <- response
# ERROR NAD 0x3D, reg=0xFFF code=0x8000
# register cannot be requested 8000

Also, you seem to send a broadcasted request, as dst=0xff. Which is fine, but all devices will respond. But they will not send response (=NACK) when a non-existing VREG is requested.

We could add VREG 0x0FFF, but that will take some time.

In the mean time you could look at N2K PGN 0x1F212. But I'm afraid I can't share the details of that PGN here. However, you could have a look at the canboat project.

2 |3000

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

Related Resources

Additional resources still need to be added for this topic

VE.Direct protocol FAQ