tuxntoast / eg4-ll

Dbus-SerialBattery Driver for EG4-LL 12v BMS
0 stars 1 forks source link

LL-S (6 switch) version #1

Open waconiglio opened 3 weeks ago

waconiglio commented 3 weeks ago

I’ve forked your repo to drive my 48 volt LL-S battery. It has 6 address switches instead of 4, and address 64 is special.

1) Initial effort will be to get my single battery online and displaying properly. (50% done) 2) Factor the send string into address-command-crc to avoid a giant command table. CRC is a Modbus-style CRC16 in little endian order. CRC code is done already. 3) Document the differences between the 4 and 6 switch versions. Are there any voltage-specific differences? Can we auto-detect? 4) PR, then discuss PR to dbus-serialbattery ?) Multiple batteries? Mixed version chains? I can’t test with my current hardware.

What are your thoughts?

tuxntoast commented 3 weeks ago

Great! I only have 12v units, and wanted to try and support the 24 and 48 units if I could. Don't see why you couldn't but the ID's from 16 to 64 is a change that we will just need to handle in discovery and exceptions logic.

  1. I would be interested to see what else you need to change to have support for this. My understanding is there is different firmware running on these 24 and 48v units, and the firmware is under active dev, where the 12v is old and not under development. So there could be other differences.. would need to see the BMS client command and reply to know what else might not be in-alignment
  2. that is wonderful! I have been looking into the CRC, as I was not keen on the giant command table, but there was other logic that were more pressing then trying to make command generation with CRC suport.
  3. I really dont know, but I have been thinking a lot around this. There would be a cell difference (12v only have 4 cells; 24v 8 cell, and 48 having 16 cells) but my logic should support a different cell count (I am pulling from the BMS how many cells there are, and the reply from the BMS has spots for 16 cells, but my 12 volt only has a non 0 value for the first 4. Min volt and max voltage is all based on cell count and the config value. We should be able to catch the voltage difference in the HW command Model number would be different, or can also pull this from the BMS config value for sure, but cell status would also be sufficient to know unit the driver might be connecting to.
  4. Yes, I have been digging into this more, thinking that there might be a hook that I can use to denote more then one "Module" but hitting dead ends in code. I do have 2x 12v units, so I can test on it, but I do feel we need support from dbus-serialbattery on this topic. All the other driver I have looked over are only supporting a single BMS unit, and not doing rollup from a communication chain.
waconiglio commented 3 weeks ago

Have a look at https://github.com/waconiglio/eg4-ll-s/tree/lls_48v ; You'll have to change all those 64 addresses back to 16, but if you wait long enough I might get it done for you. I used command strings from my EG4 desktop software, so that might also be doing something different than yours. You could substitute yours back in trivially. Just leave off the address byte from beginning and CRC 2-byte from end. I didn't mess with any of the packet interpretation, so it still reads cells as if battery is 12 V battery. It ran without error all weekend. The CRC check on read was key to this.

tuxntoast commented 1 week ago

I have made some code changes, and added logic to do the CRC calculation in code, rather then having a large command tables for each of the BMS ID’s. I have also made some updates to allow you to set what the master BMS id is. This is done by defining the a list in the driver of all the BMS ID that are in your setup. The first number in the list is treated as the master.

I also pulled in the serial port setup / serial call to the driver, as I have been working on trying to stop no-reply. Made some headway there, but I am seeing that a few still happen each hour the driver is running. They don’t cause the driver to stop or to crash. Data is held in memory, and thus the stats on that units would just not be updated during that polling event (every 5 seconds right now)

This list of BMS ID is on line 67. You will need to set that correctly for your setup

Try this out, and let me know if there is other things that you are seeing that need to be address to be able to support the 48 and 24 BMS units.

Thanks!

https://github.com/tuxntoast/eg4-ll/blob/main/egll.py

On Aug 26, 2024, at 10:45 AM, William A. Coniglio @.***> wrote:

Have a look at https://github.com/waconiglio/eg4-ll-s/tree/lls_48v https://github.com/waconiglio/eg4-ll-s/tree/lls_48v ; You'll have to change all those 64 addresses back to 16, but if you wait long enough I might get it done for you. I used command strings from my EG4 desktop software, so that might also be doing something different than yours. You could substitute yours back in trivially. Just leave off the address byte from beginning and CRC 2-byte from end. I didn't mess with any of the packet interpretation, so it still reads cells as if battery is 12 V battery. It ran without error all weekend. The CRC check on read was key to this.

— Reply to this email directly, view it on GitHub https://github.com/tuxntoast/eg4-ll/issues/1#issuecomment-2310737227, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6JR7SOXSLONDU2GNGI3HTZTNSR7AVCNFSM6AAAAABM6TCBN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJQG4ZTOMRSG4. You are receiving this because you commented.