diy solar

diy solar

Victron VenusOS driver for serial connected BMS - JBD / Daly / ANT / JKBMS / Heltec / Renogy / Tian / ECS

Does anyone use the Venus "large" image
The large image is fine to use. Those just have Node Red and SignalK as part of the image and set up to work out of the box. With firmware 2.90+ currently in beta the large image will be part of the normal distribution and can just choose which one to use or upgrade to.

Regarding which versions to use with the driver v2.73 is the most stable.
If you only use 1 BMS connected and you don't have many other devices like an Carlo meter in your setup, then the newer firmwares will be fine (normal or large) to use.
If you use multiple BMS or serial devices it is best to stay on v2.73
 
I'm waiting on a couple of adapters and cables etc before I can install Venus and use the PI tomorrow. I'm hoping to link both of my batteries. Both LLT 4S BMS. So I'll use the 2.73 version. ?

Just reading through your source code etc on github, and some of the VenusOS documentation.
Thanks a million. It's brilliant work!

I have written Python code, but I am a civil engineer, not an applications engineer or whatever you might call someone that writes stuff properly like yourself. My applications are dirty, with sections of code lifted and adapted till it works.

I am hoping to control the charge voltage as the SoC varies. I see you have already implemented this using DVCC.

If i can pick your brain for 5 minutes, a couple of questions ?

1) DVCC allows max current and max voltage to be specified. Does Venus decide on the fly which is the limiting factor and behaves according?

I see you use a current limited approach when the battery is nearing full. It's not an approach I would have thought of, but I can see the benefit.

2) If more than 1 battery/BMS is on the system and requesting DVCC parameters, how does Venus decide on the parameters? Maybe the lowest of the requested charge voltages? and the sum of the requested charge currents?

I'm studying what I think is the relevant source code here - https://github.com/victronenergy/dbus-systemcalc-py/blob/master/delegates/dvcc.py
 
Last edited:
I am hoping to control the charge voltage as the SoC varies. I see you have already implemented this using DVCC.

1) DVCC allows max current and max voltage to be specified. Does Venus decide on the fly which is the limiting factor and behaves according?

I see you use a current limited approach when the battery is nearing full. It's not an approach I would have thought of, but I can see the benefit.

2) If more than 1 battery/BMS is on the system and requesting DVCC parameters, how does Venus decide on the parameters? Maybe the lowest of the requested charge voltages? and the sum of the requested charge currents?
The Victron system is a voltage base system. So it aims for the voltage you set for it and try to reach that with all the power (current) in it has available.
What you will see is that your batteries will pull down the voltage to it's level, and then the system will charge it until it reach the voltage you want to get too. When it start to get close to your aimed for voltage, it will use less current to get to it.

DVCC allows the battery to communicate with the system and tell it what it needs, instead of that being set up on initial configuration. In short this makes the set up easier (or plug and play), but it also allow for fine tuning if the battery has that capability (which is what the driver does).

I'm not sure what you plan to do by controlling the CVL based on the SOC. The Charge Voltage limit is what you aim for, so if the battery is at 10% or 90% that would be the same aim.

The charge limit I have is something that comes in when cells are inbalanced or you have wrong capacity settings for your BMS. This just also slow down the current and that way the balancers and BMS have more time to react.

Your spesific questions:
1) Both limits are used. The Max voltage is what the charger is trying to get your battery too, but the amount of max charge current is how much current the BMS allows to be push in.
2) You choose which device is the Battery Monitor inside the GX device. Which one you choose will be the one used and all others will be ignored. In the case of the driver if you have 2 BMS the one will override the other. There is some work being done to handle both batteries in the driver and give a combined result to the GX device, but that is not yet complete.

Let me give an example:
If you have a charger capable of charging your battery at 50A (MPPT or inverter does not matter) and your inverter can use(discharge) at 70A, but your battery can only handle a 30A charge and a 55A discharge and are 16 sells (3.45V x 16 = 55.2V).
Then the BMS and driver will send (after correct set up) the DVCC limits as 30A CCL, 55A DCL, 55.2V CVL.
The inverter will only charge the battery using a max of 30A even though it could give 50A (so it will take a bit longer to charge)
The inverter will only discharge the battery to give power up to max of 55A. Any more power required will come from the grid if grid-tied, but if off grid the inverter would try and get more power from the battery to keep the output stable until the battery will protect and cut it off giving you power trip.
When the battery is depleted it's voltage would be around 49V and the chargers will try to get it to 55.2V which it will only reach when the battery gets full. Once the battery reach 55.2V the chargers will stop charging the battery and the current flow will go to 0A.
 
Ah ok.
The work you are doing -
The BMS that's nominated as battery monitor in the GX will read information on the other batteries from the GX?

I didn't know if the GX can handle multiple batteries natively.
 
Last edited:
My driver run on the GX. So yes it will all be combined on the GX.
Normally multiple batteries will have one set as master with all the rest slaves that supply their data to the master and then the master will give the GX the data once for all the banks. We don't have that, so each will be read and then combined into a master set inside the GX.
 
My driver run on the GX. So yes it will all be combined on the GX.
Normally multiple batteries will have one set as master with all the rest slaves that supply their data to the master and then the master will give the GX the data once for all the banks. We don't have that, so each will be read and then combined into a master set inside the GX.
I see. Yes I meant the Victron GX code. You're driver will pull info from the victron code as well as supplying info.
 
No changes to the GX code. It will all be handled in the driver code.
Yes I understand. At the moment your driver code is supplying info to the main victron code. To get info on the other batteries, the "slave" battery drivers will supply info to the victron code, then the "master" battery driver will pull that info from the victron code?

What do multiple batteries look like in the remote console at the moment? Are both SOC displayed?
 
At the moment (if you are on 2.73 or less) then both BMS will have their details in the remote console.
But only the values from one will be used as the SOC and published to VRM.

Yes, the slaves will store their values on the GX and the master will process this for updating.
 
At the moment (if you are on 2.73 or less) then both BMS will have their details in the remote console.
But only the values from one will be used as the SOC and published to VRM.

Yes, the slaves will store their values on the GX and the master will process this for updating.
Thanks. I have it working (single battery for now) on 2.73, 2.80 and now 2.90beta.

I am getting to grips with how Victron deal with dc loads - the inverter uses an imprecise version of the AC load which is a noting as the DC current is something else due to inefficiency and standby current. Bit annoying, hence why I upgraded to see if there was any improvement. I wonder if the inverter drivers are open source? Actually I've seen that DC current is not one of the DBUS fields for an inverter, so would require a shunt, and the GX to use the value correctly.

Anyway I digress - quick question - Do you have the total consumption panel showing to the right of AC loads? I don't have it and more to the point - it isn't logging consumption in historical info. Only the solar information is available.

My system is a Victron MPPT and Inverter. Serial battery. Nothing else at present.

1653648050478.png
 
Consumption is only for some batteries at this stage. I'll expand it to all at some stage.
 
Consumption is only for some batteries at this stage. I'll expand it to all at some stage.
Ah ok.
Really sorry to keep bothering you -

Which DBus object is missing? And which BMS's have it coded and working?

EDIT - is it this section of code for the Ant BMS?

1653736319448.png

and this updates the DBus object /History/TotalAhDrawn

1653736454089.png

I see in the DBus API these objects that look relevant but I don't find them in your code.

1653737198354.png

Thanks a million for all your work, it must have taken some time
 
Last edited:
Release v0.12 is available
The big changes are for fixing issues experienced with the driver on 2.80/2.90 firmware interfering with other devices, Tian/Revov BMS support and fixes for Daly BMS values.
 
Release v0.12 is available
The big changes are for fixing issues experienced with the driver on 2.80/2.90 firmware interfering with other devices, Tian/Revov BMS support and fixes for Daly BMS values.
Nice one ?
 
Hello,

i have connected JKBMS to my Venus but become this message after installation the driver. Venus OS is 2.87. I have also tested V2.73. But it was not running.



root@raspberrypi2:/data/log/dbus-serialbattery.ttyUSB0# tail -f current
@4000000062cbe7bb19c39a9c INFO:SerialBattery:Testing Revov
@4000000062cbe7bb299c2344 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7bb29af16d4 ERROR:SerialBattery:read_serial_data_revov::Serial Data is Bad
@4000000062cbe7bc0bf608dc ERROR:SerialBattery:ERROR >>> No battery connection at /dev/ttyUSB0
@4000000062cbe7bc0c137bec Traceback (most recent call last):
@4000000062cbe7bc0c138f74 File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 115, in <module>
@4000000062cbe7bc0c13a2fc main()
@4000000062cbe7bc0c13aacc File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 90, in main
@4000000062cbe7bc0c13be54 os.exit(1)
@4000000062cbe7bc0c13c23c AttributeError: module 'os' has no attribute 'exit'
@4000000062cbe7da30858c04 INFO:SerialBattery:Starting dbus-serialbattery
@4000000062cbe7da30905d8c INFO:SerialBattery:dbus-serialbattery v0.12
@4000000062cbe7da30adad74 INFO:SerialBattery:Testing LltJbd
@4000000062cbe7db0503c294 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7db051b367c INFO:SerialBattery:Testing Ant
@4000000062cbe7db1500b38c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7db15160c64 ERROR:SerialBattery:>>> ERROR: Incorrect Data
@4000000062cbe7db151ed27c INFO:SerialBattery:Testing Daly
@4000000062cbe7db250b352c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7db252262c4 INFO:SerialBattery:Testing Daly
@4000000062cbe7db35051114 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7db351caff4 INFO:SerialBattery:Testing Jkbms
@4000000062cbe7dc09e0c53c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7dc09f6b66c INFO:SerialBattery:Testing Sinowealth
@4000000062cbe7dc19ec0e14 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7dc1a09274c INFO:SerialBattery:Testing Renogy
@4000000062cbe7dc29e5cea4 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7dc29fc92c4 INFO:SerialBattery:Testing Revov
@4000000062cbe7dc39e9283c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7dc3a009454 ERROR:SerialBattery:read_serial_data_revov::Serial Data is Bad
@4000000062cbe7dd1c48a384 INFO:SerialBattery:Testing LltJbd
@4000000062cbe7dd2c2e2864 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7dd2c43bfbc INFO:SerialBattery:Testing Ant
@4000000062cbe7de00902c34 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7de00a5f26c ERROR:SerialBattery:>>> ERROR: Incorrect Data
@4000000062cbe7de00aef704 INFO:SerialBattery:Testing Daly
@4000000062cbe7de10937244 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7de10a8d6d4 INFO:SerialBattery:Testing Daly
@4000000062cbe7de208caa1c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7de20a3d7b4 INFO:SerialBattery:Testing Jkbms
@4000000062cbe7de308b19e4 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7de30a36c74 INFO:SerialBattery:Testing Sinowealth
@4000000062cbe7df04fd6994 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7df0519cb34 INFO:SerialBattery:Testing Renogy
@4000000062cbe7df14f2dc94 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7df1508b26c INFO:SerialBattery:Testing Revov
@4000000062cbe7df24e751ac ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7df24fa29e4 ERROR:SerialBattery:read_serial_data_revov::Serial Data is Bad
@4000000062cbe7e0073f79f4 INFO:SerialBattery:Testing LltJbd
@4000000062cbe7e0171b7954 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7e0172d5f5c INFO:SerialBattery:Testing Ant
@4000000062cbe7e0270c50a4 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7e0271ea024 ERROR:SerialBattery:>>> ERROR: Incorrect Data
@4000000062cbe7e0272552fc INFO:SerialBattery:Testing Daly
@4000000062cbe7e03705f1f4 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7e0371956cc INFO:SerialBattery:Testing Daly
@4000000062cbe7e10b6194f4 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7e10b751524 INFO:SerialBattery:Testing Jkbms
@4000000062cbe7e11b4e49ac ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7e11b61068c INFO:SerialBattery:Testing Sinowealth
@4000000062cbe7e12b3c5a0c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7e12b4f1ebc INFO:SerialBattery:Testing Renogy
@4000000062cbe7e13b28bcbc ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7e13b3b5e44 INFO:SerialBattery:Testing Revov
@4000000062cbe7e20f76fdf4 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe7e20f8a10c4 ERROR:SerialBattery:read_serial_data_revov::Serial Data is Bad
@4000000062cbe7e22d6af20c ERROR:SerialBattery:ERROR >>> No battery connection at /dev/ttyUSB0
@4000000062cbe7e22d87dc64 Traceback (most recent call last):
@4000000062cbe7e22d87efec File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 115, in <module>
@4000000062cbe7e22d880374 main()
@4000000062cbe7e22d880b44 File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 90, in main
@4000000062cbe7e22d881ecc os.exit(1)
@4000000062cbe7e22d88269c AttributeError: module 'os' has no attribute 'exit'
@4000000062cbe80113bb0c5c INFO:SerialBattery:Starting dbus-serialbattery
@4000000062cbe80113c26b14 INFO:SerialBattery:dbus-serialbattery v0.12
@4000000062cbe80113dd9fec INFO:SerialBattery:Testing LltJbd
@4000000062cbe80123c441f4 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe80123d66a64 INFO:SerialBattery:Testing Ant
@4000000062cbe80133bb8d9c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe80133cd584c ERROR:SerialBattery:>>> ERROR: Incorrect Data
@4000000062cbe80133d3ff6c INFO:SerialBattery:Testing Daly
@4000000062cbe802081b012c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe802082dcdac INFO:SerialBattery:Testing Daly
@4000000062cbe8021807543c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe8021819a7a4 INFO:SerialBattery:Testing Jkbms
@4000000062cbe802280ff564 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe802282365f4 INFO:SerialBattery:Testing Sinowealth
@4000000062cbe80237fd9094 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe80238108424 INFO:SerialBattery:Testing Renogy
@4000000062cbe8030c54557c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe8030c67f4ec INFO:SerialBattery:Testing Revov
@4000000062cbe8031c44e67c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe8031c56d454 ERROR:SerialBattery:read_serial_data_revov::Serial Data is Bad
@4000000062cbe8033a376f4c INFO:SerialBattery:Testing LltJbd
@4000000062cbe8040e7d4c14 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe8040e9062cc INFO:SerialBattery:Testing Ant
@4000000062cbe8041e7a353c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe8041e8d403c ERROR:SerialBattery:>>> ERROR: Incorrect Data
@4000000062cbe8041e93cc04 INFO:SerialBattery:Testing Daly
@4000000062cbe8042e75a37c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe8042e892b7c INFO:SerialBattery:Testing Daly
@4000000062cbe80502c8d654 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000062cbe80502dd4c9c INFO:SerialBattery:Testing Jkbms
 
i have connected JKBMS to my Venus but become this message after installation the driver. Venus OS is 2.87.
It does not look like your JKBMS is correctly connected using the cable. Is the comms light on your RS485->USB cable flashing as data is trasmitted? Try to switch the A and B data lines. Also try a different converted cable.

progress towards ECS-BMS support
Still busy. I will publish any updates on the ECS ticket if you want to test any beta versions before a release is built if you want to subscribe to that.
 
Hello, first post...

I'm desperately trying to get the driver running but no success so far.
JBD BMS connected with original JBD UART to USB box. Connects flawlessly to JBD Tools in Windows so I don't think it's a matter of cabling.
Running a PI with Venus v2.87. Version 2.72 no success either.
SerialBatteryDriver 0.12.
Perhaps useful to know: homebrew 4s Powerwall with Li-ion (Laptop) cells. Range 3.1V-4.1V (12.4 - 16.4 total). Voltages in Utils.py adjusted.
Anyone a hint what the last line of the logs wants to say? Problem with cellcount?

root@raspberrypi2:~# tail /data/log/serial-starter/current
@4000000062d2f76829b19f44 INFO: Start service dbus-fzsonick-48tl.ttyUSB0 once
@4000000062d2f76b360de9dc INFO: Start service dbus-imt-si-rs485tc.ttyUSB0 once
@4000000062d2f76f084acb8c INFO: Start service dbus-modbus-client.serial.ttyUSB0 once
@4000000062d2f7721532b454 INFO: Start service dbus-serialbattery.ttyUSB0 once
@4000000062d2f775212c6c8c INFO: Start service gps-dbus.ttyUSB0 once
@4000000062d2f77e323a1dbc INFO: Start service vedirect-interface.ttyUSB0 once
@4000000062d2f77f10e8e544 *** starting serial-starter ***
@4000000062d2f77f186c6b24 serstart starting
@4000000062d2f77f18b2614c INFO: loading config file /etc/venus/serial-starter.conf
@4000000062d2f780085edc44 INFO: loading config file /data/conf/serial-starter.d
root@raspberrypi2:~# tail /data/log/dbus-serialbattery.ttyUSB0/current
@4000000062d2f77318840a04 INFO:SerialBattery:DeviceInstance = 1
@4000000062d2f7731890d374 INFO:SerialBattery:com.victronenergy.battery.ttyUSB0
@4000000062d2f773209f8254 Traceback (most recent call last):
@4000000062d2f773209f99c4 File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 115, in <module>
@4000000062d2f773209fb134 main()
@4000000062d2f773209fb51c File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 100, in main
@4000000062d2f773209fc8a4 if not helper.setup_vedbus():
@4000000062d2f773209fd45c File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 76, in setup_vedbus
@4000000062d2f773209febcc self._dbusservice.add_path('/Info/BatteryLowVoltage', self.battery.min_battery_voltage, writeable=True)
@4000000062d2f77320a1726c AttributeError: 'LltJbd' object has no attribute 'min_battery_voltage'
 
Last edited:
Voltages in Utils.py adjusted
Hi
It seems that the driver can either not read the cell count, or that the min max cell voltage setting has an issue.

Can you paste the values you have set for min and max cell voltages.

Also how did you make the edit? Did you change the file perhaps in Windows and copy the file it over to the GX? Windows use other line endings in files and this can sometimes cause and issue if you did a newline(Enter) in Windows editor. Try installing the driver again and then using the nano editor inside the GX system to make the same edits to see if that helps.
 
Back
Top