question

Holger Blume avatar image
Holger Blume asked

how can i emulate a bmv700 with input from a votronic smartshunt

Hi

i have a raspi 4 with the large Venus OS image on it and a connected mppt100/30 .

output is a 7inch ips touch panel. This works very well.

Node red is activated and i use this to decode the serial output from a vortronic 400A Shunt so i have now following values in node-red at the moment:

- Voltage from the Board and Starter battery in V

- strength of the electrical current in A

-Battery level of the board battery in %

-size of the Boardbattery in AH

now i would like to send this as input to emulate a bmv7xx to the venus os to show it on the display as a bmv.


has someone a idea , best of would be directly in node-red itself

thanks in advance



SmartShuntNode-RED
2 |3000

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

1 Answer
iv4n avatar image
iv4n answered ·

Hello Holger! Did you have any advance or made any discovery on this topic?

2 comments
2 |3000

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

Holger Blume avatar image Holger Blume commented ·
hi, yes it works , my way is to take the converted data in node-red and send it to a small driver over tcp. this driver put it on the dbus and it works well . the better way would be to design a direct driver for that , but i have not the time to spend it in this topic
0 Likes 0 ·
Holger Blume avatar image Holger Blume Holger Blume commented ·

here the code from the node-red function, input is serialconnect , works for the triplecharger from votronic

here a sample of the message for testing:

[170,202,100,5,193,4,99,1,96,0,100,0,132,71,253,54,170,218,0,0,0,0,222,13,94,20,0,0,86,4,2,19,170,250,86,0,10,0,11,3,0,36,0,0,70,208,0,28]



var checksum = 0
var check = false
var signed = 0

//ID
//sync begin of the message
if (msg.payload[1]==202){
  
ID = msg.payload[1]
//voltage bordbattery U16
u_bord = msg.payload.readUInt16LE(2)
u_bord_mv = u_bord*10
u_bord_v = u_bord_mv/1000

//voltage starterbattery U16
u_start = msg.payload.readUInt16LE(4)
u_start_mv = u_start*10
u_start_v = u_start_mv/1000

if (msg.payload[14] >1)
{
  
  signed = 0xFF;
}else
{
  
  signed = 0x00;
}
 
const buf = Buffer.from([msg.payload[12], msg.payload[13], msg.payload[14], signed]);
current = buf.readInt32LE(0)/1000
//fuel of the battery
fuel = msg.payload[10]
 
// fuel in AH
batt_ah = msg.payload.readInt16LE(6)
 
//checksum calculate
for (var i=1;i<15;i++){
  
checksum = checksum ^ msg.payload[i]
}
 
//checksum check
if (checksum == msg.payload[15]){
  
check = true
}
 
msg.payload = {
  
ID: ID,
u_bord_v: u_bord_v,
u_start_v: u_start_v,
batt_ah: batt_ah,
fuel: fuel,
current: current,
checksum_calc: checksum,
cecksum_rx: msg.payload[15],
check: check
}
 
if (check === true){
  
return msg;
}}
0 Likes 0 ·