Louisvdw / dbus-serialbattery

Battery Monitor driver for serial battery in VenusOS GX systems
MIT License
516 stars 164 forks source link

Renogy - Multi battery setup documentation #1099

Open mr-manuel opened 1 month ago

mr-manuel commented 1 month ago

Is your feature request related to a problem? Please describe.

Create a documentation on how to connect multiple Renogy batteries to one serial adapter.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

mr-manuel commented 1 month ago

@TheVodden could you do that?

  1. Describe how you need to prepare the batteries, to get the correct addresses
  2. How to connect the batteries correctly
  3. How to setup the driver correctly

Please add some pictures/screenshots, so that others could follow more easily. I will add this then to the documentation.

mr-manuel commented 1 month ago

https://github.com/Louisvdw/dbus-serialbattery/issues/142#issuecomment-2181082259

https://github.com/Louisvdw/dbus-serialbattery/issues/142#issuecomment-2198648326

TheVodden commented 1 month ago

I’m currently on vacation without a laptop but I’ll do my best to explain how it’s done. When I get back, I can post more comprehensive instructions with pics etc.

My batteries were auto addressed by the Renogy rs485 battery monitor. I’ve made the assumption that the BT2 addresses them in the same manner but can’t confirm. 0x30 was the battery closest to the monitor and +1 each battery getting further away from the controller/monitor. Batteries are wired as per Renogy instructions here. See page 8. Because the Cerbo will act as the master, you will need to unplug the BT2/battery monitor so communication collisions don’t occur.

I confirmed addresses using a modbus program called QModMaster. Im quite familiar with this program but its fairly straightforward. You can connect to each battery individually with a laptop and the same cable you use to connect to the Cerbo. Connect to each battery individually, (485 ports on batteries not wired together) using function code 0x03, polling slave address 255 (broadcast address), and start address 5223 (1467 HEX) setting number of registers to 1. This will return each battery address you plug into. A full list of battery registers is found here if you want to poll additional data (handy for troubleshooting) Optionally, if different addresses are returned, you can write a new address to the device by changing the function code to write holding registers, but it seems unlikely you should need to do this.

That is basic setup. In general, follow the manufacturers instructions and everything should work out.


From: Manuel @.> Sent: Sunday, July 14, 2024 1:01:57 PM To: Louisvdw/dbus-serialbattery @.> Cc: TheVodden @.>; Mention @.> Subject: Re: [Louisvdw/dbus-serialbattery] Renogy - Multi battery setup documentation (Issue #1099)

@TheVoddenhttps://github.com/TheVodden could you do that?

  1. Describe how you need to prepare the batteries, to get the correct addresses
  2. How to connect the batteries correctly
  3. How to setup the driver correctly

Please add some pictures/screenshots, so that others could follow more easily. I will add this then to the documentation.

— Reply to this email directly, view it on GitHubhttps://github.com/Louisvdw/dbus-serialbattery/issues/1099#issuecomment-2227467771, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJI35IFASKIBWOS42QVN2ODZMLKLLAVCNFSM6AAAAABK3NJKQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRXGQ3DONZXGE. You are receiving this because you were mentioned.Message ID: @.***>

Quadron commented 1 month ago

I had used the BT2 first, not the RS485 battery monitor. To check the addresses I used the CASModbusScanner program (from https://store.chipkin.com/products/tools/cas-modbus-scanner) to scan all the adresses while connected with the usb cable to my windows laptop. Batteries daisychained together as they were connected to the BT2. It gave me responses "not available, Device exists but does not support this function" on 4 addresses: 48, 49, 50 and 51. Which translate to 0X30, 0X31, 0X32 and 0X33 so that does correlate with what others have reported. All other addresses reported "time out". I reinstalled dbus-serialbattery to make sure I had not fumbled up my config.ini. Then inserted the 4 addesses. The logfile now says: ++ Testing Renogy at address "\x30" Renogy RBT100LFP12SH-G1 ++ After each of the four addresses In the end it says ++ DRIVER STOPPED! Another battery with the same serialnumber/unique identifier "RBT100LFP12SHG1_100.0Ah" Change battery capacities to be unique. ++ But how do I do that?

EDIT: I've poked around the code and found in renogy.py line 44 the batteries apperently do not return a unique serial number, therefore the conventional way of naming type_capacity is used. To test I have changed the option USE_PORT_AS_UNIQUE_ID to true logfile then reports: four times: INFO:SerialBattery:Changed CustomName = SerialBattery(Renogy) And then: WARNING:SerialBattery:Polling took too long. Set to 4.000 s And nothing more. So that option will not work as it is now.

I have no idea why my batteries do not report their serial numbers. I do not know enough of modbus to even contemplate trying to connect directly to the batteries to try to figure that out. My guess would be to modify the USE_PORT_AS_UNIQUE_ID function to append the modbus address to the port address or modify the renogy unique identifier function to append the modbus address or a sequential number to the generic type_capacity naming. But my coding skills are absolutely inadequate to pull that off.

@TheVodden do you have the same batteries? and if so, what firmware are they on. Mine are v1.31 according to the Renogy app. I have not been able to find a different firmware on the renogy site, so updating would probably not be an option anyway.

Quadron commented 1 month ago

This is the USB to RJ45 RS485 cable pinout that is working for me: Victron FTDI to Renogy RJ45 pinout

mr-manuel commented 1 month ago

Hi, I will change that for Renogy batteries to use the port as unique identifier by default. They seem to not provide this info or do you see the serial number in their software?

mr-manuel commented 1 month ago

The port is now used for the unique identifier for the Renogy battery as default. See https://github.com/mr-manuel/venus-os_dbus-serialbattery/commit/ed1950ba61384e22cd118e91ef510bc86bfde505.

Quadron commented 1 month ago

"do you see the serial number in their software?"

I have not been alle to find anything in the renogy app that provides a unique number of each battery. Only a numbering 1 through 4 (in my case) based on the rs485 daisychain connection.