jmibk / BMS-LIB-CAN-Victron

ESP32 CAN communication with Victron systems
MIT License
9 stars 1 forks source link

Isit possible to get more dbus path values? #1

Open xury77 opened 1 year ago

xury77 commented 1 year ago

Hi Michael. Its not a really issue just only a newbie question. Your sketch is awesome! Im curious It would be possible to get/set more data as described at https://github.com/victronenergy/venus/wiki/dbus#battery ? Especially like: /Alarms/LowCellVoltage /System/NrOfBatteries /System/BatteriesParallel /System/BatteriesSeries /System/NrOfCellsPerBattery /System/MinCellVoltage /System/MaxCellVoltage /Io/AllowToCharge /Io/AllowToDischarge Were did you get Victron CAN BMS description ? It will work with multiple battery connected to BMS CAN bus?

jmibk commented 1 year ago

Hi, thank you for your message.

I gained access to the data, that is sent via CAN by reverse engineering, catching waveforms with an analyzer and comparing them with the rare information on the internet. Victron said, that the CAN protocol is not open and they can't give some information about it.

Attached a file with the addresses that are be sent through CAN (that are already part of the lib). Maybe there are more, but I think, thats not the case. CAN Bus should work with a lot of inverter brands, I checked Victron, SMA and some more. Most difference is the pinout of the RJ45 cable, there may be at least 3 different pinouts on the market.

We build big storage batteries and we have the same issue you described - more than one battery and only one CAN connection. No - you can't connect multiple batteries via CAN to the inverter system. We solved the problem by engineering a own BMS system that is capable of managing more than one stack of cells. We are in development of a system that supports 8 rows of cells up to 100 cells per row (in total 800 cells). In software you can select if the 8 rows are in series (high voltage battery) or in parallel (multiple batteries in parallel).

I can't give you the firmware of that system because thats our business thing and we sell the system to our customers - it is not open source.

Greetings.

Am Do., 17. Aug. 2023 um 19:07 Uhr schrieb xury77 @.***

:

Hi Michael. Its not a really issue just only a newbie question. Your sketch is awesome! Im curious It would be possible to get/set more data as described at https://github.com/victronenergy/venus/wiki/dbus#battery ? Especially like: /Alarms/LowCellVoltage /System/NrOfBatteries /System/BatteriesParallel /System/BatteriesSeries /System/NrOfCellsPerBattery /System/MinCellVoltage /System/MaxCellVoltage /Io/AllowToCharge /Io/AllowToDischarge Were did you get Victron CAN BMS description ? It will work with multiple battery connected to BMS CAN bus?

— Reply to this email directly, view it on GitHub https://github.com/jmibk/BMS-LIB-CAN-Victron/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5R35VIZSFNCEZ3EOJ7BY3XVZFWJANCNFSM6AAAAAA3UL64OQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Ing. Michael Juen B.Eng. Technische Leitung & Office

Audiowerk >> Veranstaltungstechnik Pembaurstrasse 41 A-6020 Innsbruck

Tel. +43 699 81324871 www.audiowerk.at ATU62717536

xury77 commented 1 year ago

Tanks for the answer. I understand that you cannot share the fw. Even I wouldn't even dare ask :) I just found similar project: https://github.com/dfch/BydCanProtocol I it could be possible add some missing info to your project as described on README.md in above project: message_379 - BatterySize: Installed Ah message_378 - History: Charged / Discharged Energy I'm curious these frames are dependent of battery manufacturer. Or perhaps is common? BYD and SMA protocol looks very similar. I think battery modules is not a cell numbers, but amount of battery banks. It's can be handy to determine with banks are allowed to charge/discharge and how many banks are online and aggregate multiple battery banks to one.

Best regards. Sebastian.

jmibk commented 1 year ago

Hi,

thanks for the information of the additional packets sent via CAN. I updated the lib that you can use the following things:

set_onlinecapacityinAh() changed to set_installedcapacityinAh() new: set_availablecapacityinAh() set_energychargedinWh() //takes float values set_energydischargedinWh() //takes float values

What are you trying to do with the lib? Maybe there is a benefit of combining knowledge for everyone?

Greets!

Am Mo., 21. Aug. 2023 um 19:20 Uhr schrieb xury77 @.***

:

Tanks for the answer. I understand that you cannot share the fw. Even I wouldn't even dare ask :) I just found similar project: https://github.com/dfch/BydCanProtocol I it could be possible add some missing info to your project as described on README.md in above project: message_379 - BatterySize: Installed Ah message_378 - History: Charged / Discharged Energy I'm curious these frames are dependent of battery manufacturer. Or perhaps is common? BYD and SMA protocol looks very similar. I think battery modules is not a cell numbers, but amount of battery banks. It's can be handy to determine with banks are allowed to charge/discharge and how many banks are online and aggregate multiple battery banks to one.

Best regards. Sebastian.

— Reply to this email directly, view it on GitHub https://github.com/jmibk/BMS-LIB-CAN-Victron/issues/1#issuecomment-1686731878, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5R35QXPU3PKFZEPFMCMH3XWOKE5ANCNFSM6AAAAAA3UL64OQ . You are receiving this because you commented.Message ID: @.***>

jmibk commented 1 year ago

Tested and worked with a cerbo device (see attached screenshots)

Am Mo., 21. Aug. 2023 um 20:10 Uhr schrieb jmibk @.***>:

Hi,

thanks for the information of the additional packets sent via CAN. I updated the lib that you can use the following things:

set_onlinecapacityinAh() changed to set_installedcapacityinAh() new: set_availablecapacityinAh() set_energychargedinWh() //takes float values set_energydischargedinWh() //takes float values

What are you trying to do with the lib? Maybe there is a benefit of combining knowledge for everyone?

Greets!

Am Mo., 21. Aug. 2023 um 19:20 Uhr schrieb xury77 < @.***>:

Tanks for the answer. I understand that you cannot share the fw. Even I wouldn't even dare ask :) I just found similar project: https://github.com/dfch/BydCanProtocol I it could be possible add some missing info to your project as described on README.md in above project: message_379 - BatterySize: Installed Ah message_378 - History: Charged / Discharged Energy I'm curious these frames are dependent of battery manufacturer. Or perhaps is common? BYD and SMA protocol looks very similar. I think battery modules is not a cell numbers, but amount of battery banks. It's can be handy to determine with banks are allowed to charge/discharge and how many banks are online and aggregate multiple battery banks to one.

Best regards. Sebastian.

— Reply to this email directly, view it on GitHub https://github.com/jmibk/BMS-LIB-CAN-Victron/issues/1#issuecomment-1686731878, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5R35QXPU3PKFZEPFMCMH3XWOKE5ANCNFSM6AAAAAA3UL64OQ . You are receiving this because you commented.Message ID: @.***>

xury77 commented 1 year ago

I trying to build a battery pack for Victron with my "own diy BMS" because I tested a few commercial and opensource solutions and no one satisfy me. Tried Chinese DalyBMS, 123electric smartBMS, DIYBMS with LiFePo4 cells. My prototype works well (in my point of view :) )but using MQTT based on https://github.com/mr-manuel/venus-os_dbus-mqtt-battery witch is a little complicated to configure. So I looking for a simpler configuration such as your lib based on CAN-bus. I have no experience with CAN (even as software engineer too) so looked for an examples on github. I am currently wondering if multiple batteries can be aggregated using CAN. You wrote is not possible, but Pylontech has done it. A few more questions: Where is hardcoded a Product ID ? Is B007 but I've seen on some screenshots B017 (BYD), B009 etc. Maybe is correlated with 0x35e , 0x35f batterymodel? Or 0x382 (PREMIUM on BYD batteries). Tomorrow I will check it.

xury77 commented 1 year ago

I think the dbus paths below also have their messages over CAN: /Io/AllowToCharge /Io/AllowToDischarge But it still not discovered.

xury77 commented 1 year ago

Another discovery: I'm added _message_382 to your lib And if I send this message with "PREMIUM" and "BYD" as name I got ProductID B019 - without "PREMIUM I got B015 In both cases nr of modules blocking charge/discharge is -- --

jmibk commented 1 year ago

Hi,

I tried to figure out which values these blockings are, and I discovered, that they are already implemented:

set_numberofmodulesblockingcharge() set_numberofmodulesblockingdischarge()

They are part of message 0x372.

Greetings.

Am Mi., 23. Aug. 2023 um 16:09 Uhr schrieb xury77 @.***

:

Another discowery: I'm added _message_382 to your lib And if I send this message with "PREMIUM" and "BYD" as name I got ProductID B019 - without "PREMIUM I got B015 In both cases nr of modules blocking charge/discharge is -- --

— Reply to this email directly, view it on GitHub https://github.com/jmibk/BMS-LIB-CAN-Victron/issues/1#issuecomment-1690035900, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5R35RH4BR67WZMLCTI4OTXWYFKJANCNFSM6AAAAAA3UL64OQ . You are receiving this because you commented.Message ID: @.***>

xury77 commented 1 year ago

Yes Right. Looks like BYD doesn't use it, and ignore it even I set and send it. And you were right - I can't connect more than one battery even with different names and product IDs

jmibk commented 1 year ago

I use the CVL, CCL and DCL to limit charging. For discharge limits you can deal with the SOC level.

Am Mi., 23. Aug. 2023 um 17:51 Uhr schrieb xury77 @.***

:

Yes Right. Looks like BYD doesn't use it, and ignore it even I set and send it.

— Reply to this email directly, view it on GitHub https://github.com/jmibk/BMS-LIB-CAN-Victron/issues/1#issuecomment-1690211646, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5R35W36D4SLWV2CATR273XWYRIFANCNFSM6AAAAAA3UL64OQ . You are receiving this because you commented.Message ID: @.***>

xury77 commented 1 year ago

Oh gosh. I thought VenusOS would automatically stop charging the battery when it reached CVL? So I have to send CVL CCL when I want to finish charging the battery? So I have to do e.g. If (my_battvoltage == voltageCVL) { currentCCL = 0 } Do I also need to send e.g. CVL == 0.1? I read something about it in diyBMS sources. [edited] Sorry I read more about DVCC and now I know all I wanted.

jmibk commented 1 year ago

Hi,

CVL is the maximum charge voltage level, that the battery reports to the inverter CCL is the maximum charge current, that the battery reports to the inverter DCL is the maximum discharge current, ....

Its for the battery manufacturer, in that case You, to report the battery settings to the inverter. You can change the values in your bms dynamically and the inverter will follow them.

You can find these values in the Venus in the Settings => DVCC setting. There you can activate or disable these functions and you can also override the values. DVCC has to be ON to work with CVL, CCL and DCL!

Am Mi., 23. Aug. 2023 um 23:22 Uhr schrieb xury77 @.***

:

Oh gosh. I thought VenusOS would automatically stop charging the battery when it reached CVL? So I have to send CVL CCL when I want to finish charging the battery? So I have to do e.g. If (my_battvoltage == voltageCVL) { currentCCL = 0 } Do I also need to send e.g. CVL == 0.1? I read something about it in diyBMS sources.

— Reply to this email directly, view it on GitHub https://github.com/jmibk/BMS-LIB-CAN-Victron/issues/1#issuecomment-1690658563, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5R35TXTSSXVWPGRTOLRTTXWZYBJANCNFSM6AAAAAA3UL64OQ . You are receiving this because you commented.Message ID: @.***>

Uksa007 commented 1 year ago

@xury77 Hi, I have a working solution for JK-BMS and JBD/Overkill, including hardware. It has all the hardware/software needed to communicate with BMS and Inverter or in Victrons case Venus/cerbo. I also support Multiple BMS, currently up to 10 BMS. It currently working using Pylon protocol, I'm just adding native Victron support Hardware kits: https://github.com/Uksa007/esphome-jk-bms-can/discussions/16

Regards