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]



  1. var checksum = 0
  2. var check = false
  3. var signed = 0
  4.  
  5. //ID
  6. //sync begin of the message
  7. if (msg.payload[1]==202){
  8. ID = msg.payload[1]
  9. //voltage bordbattery U16
  10. u_bord = msg.payload.readUInt16LE(2)
  11. u_bord_mv = u_bord*10
  12. u_bord_v = u_bord_mv/1000
  13.  
  14. //voltage starterbattery U16
  15. u_start = msg.payload.readUInt16LE(4)
  16. u_start_mv = u_start*10
  17. u_start_v = u_start_mv/1000
  18.  
  19. if (msg.payload[14] >1)
  20. {
  21. signed = 0xFF;
  22. }else
  23. {
  24. signed = 0x00;
  25. }
  26. const buf = Buffer.from([msg.payload[12], msg.payload[13], msg.payload[14], signed]);
  27. current = buf.readInt32LE(0)/1000
  28. //fuel of the battery
  29. fuel = msg.payload[10]
  30. // fuel in AH
  31. batt_ah = msg.payload.readInt16LE(6)
  32. //checksum calculate
  33. for (var i=1;i<15;i++){
  34. checksum = checksum ^ msg.payload[i]
  35. }
  36. //checksum check
  37. if (checksum == msg.payload[15]){
  38. check = true
  39. }
  40. msg.payload = {
  41. ID: ID,
  42. u_bord_v: u_bord_v,
  43. u_start_v: u_start_v,
  44. batt_ah: batt_ah,
  45. fuel: fuel,
  46. current: current,
  47. checksum_calc: checksum,
  48. cecksum_rx: msg.payload[15],
  49. check: check
  50. }
  51. if (check === true){
  52. return msg;
  53. }}
0 Likes 0 ·