Louisvdw / dbus-serialbattery

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

Support BMS DR-JC03? #327

Closed andkirby closed 1 year ago

andkirby commented 1 year ago

Describe the bug I'm trying gather all things together for: Victron MultiPlus 48/5000/70 + Cerbo GX + Battery LiFePO4 with BMS DR-JC03.

I've installed your app, and connected Cerbo GX-USB <-> USB-RS485 Adapter with 3 pins (A/B/Ground) <-> RS485-RJ-45 on battery

On RJ-45(RS485): 1- RS485B 2- RS485B 3- GND (I made this according to this manual. It's not so suitable, but didn't find better.)

Am I wrong somewhere?

To Reproduce Steps to reproduce the behavior:

  1. Go to Cerbo GX terminal
  2. Install dbus-serialbattery
  3. Connect the battery
  4. See logs: tail -f /data/log/dbus-serialbattery.ttyUSB0/current
  5. See error
    ERROR:SerialBattery:ERROR >>> No battery connection at /dev/ttyUSB0

Expected behavior Logs shall show success connection.

Screenshots BMS

BMS DR-JC03 Photos ![image](https://user-images.githubusercontent.com/1828532/206586325-6bb86a1f-0fba-425f-8a07-caab1a6e4581.png) ![image](https://user-images.githubusercontent.com/1828532/206668152-19fa9bcd-de68-4dd3-af21-7336eec113fb.png) ![image](https://user-images.githubusercontent.com/1828532/206586362-94761304-8690-4526-a7c3-b9e293ae9761.png)
**VenusOS (please complete the following information):** - Device type: Cerbo GX - Firmware Version: 2.92 (latest firmware for 2022-12-09) **Battery/BMS (please complete the following information):** - BMS/Battery type: ??? / LFP - Cells: 16 - Interface: 2xRJ45-RS485, 1xRJ45-RS232 **Additional context**
Louisvdw commented 1 year ago

This is not a BMS that is supported by die driver. I cant's find any communication protocol information on their website, so I can't say if it would be possible to add.

andkirby commented 1 year ago

Hi @Louisvdw , Thanks for your quick response.

But how these 3 wires to RJ45 (RS495) shall be connected to a battery via RS485/RJ45? Is there some standard or something?

As the solution 1-A+ / 2-B- / 3-GND does not work, I found this adapter USB-RS485/RJ45 https://www.amazon.com/RS-485-Adapter-Serial-BCBL-01-Communication/dp/B08GLFBTZW

According to the picture: Green-GND, Red-A+, Black-B-. image

So, on RJ-45(RS485): 1) GND 6) RS485 A+ 7) RS485 B-

Error No battery connection at /dev/ttyUSB0

Full log ``` @4000000063931ee22762e4b4 INFO:SerialBattery:Starting dbus-serialbattery @4000000063931ee2276d73d4 INFO:SerialBattery:dbus-serialbattery v0.141 @4000000063931ee227773004 INFO:SerialBattery:Testing LltJbd @4000000063931ee2386c6794 ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee238a17d6c INFO:SerialBattery:Testing Ant @4000000063931ee30df17b1c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee30e328b5c ERROR:SerialBattery:>>> ERROR: Incorrect Data @4000000063931ee30e3d6c84 INFO:SerialBattery:Testing Daly @4000000063931ee31f34e24c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee31f6b2cbc INFO:SerialBattery:Testing Daly @4000000063931ee33043472c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee330843444 INFO:SerialBattery:Testing Jkbms @4000000063931ee405da67cc ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee40615bb4c INFO:SerialBattery:Testing Lifepower @4000000063931ee417b4811c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee417e82bac ERROR:SerialBattery:>>> ERROR: Incorrect Data @4000000063931ee417f3570c INFO:SerialBattery:Testing Renogy @4000000063931ee429afca84 ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee429e8050c INFO:SerialBattery:Testing Renogy @4000000063931ee43b3b0c3c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee43b6f1c5c INFO:SerialBattery:Testing Ecs @4000000063931ee5225d66c4 INFO:SerialBattery:Testing LltJbd @4000000063931ee532f0d32c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee5330541a4 INFO:SerialBattery:Testing Ant @4000000063931ee607d8db94 ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee607e7b844 ERROR:SerialBattery:>>> ERROR: Incorrect Data @4000000063931ee607f1ce4c INFO:SerialBattery:Testing Daly @4000000063931ee61972bf64 ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee61982e81c INFO:SerialBattery:Testing Daly @4000000063931ee62a3e144c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee62a4c9724 INFO:SerialBattery:Testing Jkbms @4000000063931ee63ab5888c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee63ac57a94 INFO:SerialBattery:Testing Lifepower @4000000063931ee70f9d5e2c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee70fabd934 ERROR:SerialBattery:>>> ERROR: Incorrect Data @4000000063931ee70fb589ac INFO:SerialBattery:Testing Renogy @4000000063931ee72089c3ec ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee72098892c INFO:SerialBattery:Testing Renogy @4000000063931ee730f4574c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee731036aac INFO:SerialBattery:Testing Ecs @4000000063931ee816da4dbc INFO:SerialBattery:Testing LltJbd @4000000063931ee828af2f1c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee828c0ced4 INFO:SerialBattery:Testing Ant @4000000063931ee839a1519c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee839b37624 ERROR:SerialBattery:>>> ERROR: Incorrect Data @4000000063931ee839c21454 INFO:SerialBattery:Testing Daly @4000000063931ee90ea62cec ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee90eb6421c INFO:SerialBattery:Testing Daly @4000000063931ee91f01957c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee91f10eb44 INFO:SerialBattery:Testing Jkbms @4000000063931ee92f935fec ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931ee92fa3fdd4 INFO:SerialBattery:Testing Lifepower @4000000063931eea05b2177c ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931eea05c0ffe4 ERROR:SerialBattery:>>> ERROR: Incorrect Data @4000000063931eea05cc4e6c INFO:SerialBattery:Testing Renogy @4000000063931eea161a35f4 ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931eea1628e3c4 INFO:SerialBattery:Testing Renogy @4000000063931eea270bcbd4 ERROR:SerialBattery:>>> ERROR: No reply - returning @4000000063931eea271f5ba4 INFO:SerialBattery:Testing Ecs @4000000063931eeb0cf60804 ERROR:SerialBattery:ERROR >>> No battery connection at /dev/ttyUSB0 ```

That's a web page of a similar battery like mine: 512KWH-48V-lifepo4

Louisvdw commented 1 year ago

The wires does not matter if the driver does not talk the language of that battery. If this battery can do CANbus you might not need the serial battery driver.

andkirby commented 1 year ago

I got no CANbus input, unfortunately. image

The wires does not matter

But I have to establish right connection first, right?

Louisvdw commented 1 year ago

Yes, you do need to get the correct wire connection first. But there are no standard for that. You will have to check your battery manual which pins are used. But even if the correct pins are used and the connection is valid, the driver will not know how to talk to this battery unless it use the same BMS as one of the supported BMS.

andkirby commented 1 year ago

But there are no standard for that.

That's a shame :(

You will have to check your battery manual which pins are used.

No manual from XD battery vendor. :( 🤦

Thanks for this note, L!

andkirby commented 1 year ago

Contacted with XD Battery company. I was told, it can be connected with their battery (w/o programming). They promised to help to make it work. My hands are itching to see the manual. I'll bring updates...

joggl commented 1 year ago

Diese Batterie funktioniert mit dem Treiber nicht. Du musst folgende Dinge ausführen. https://we.tl/t-pgNDHMLJ7y (the link for the battery manual, pc software, BIN code , upgrade video) 1.upgrade the battery by the BIN code first. 2.battery connect victron by CAN bus (the RJ45 cables PIN change for CAN) 3.master battery dip 5 and 6 on 4.victron setting pylon working model

andkirby commented 1 year ago

@joggl, thanks for the answer. Why it's not in english (completely)? :-/ What this link about? I see "Introducing portraits". I guess, you added wrong link.

1) Didn't get it. What does "BIN code" mean? 2,3) Yes, 5 & 6 pins must be up. For some reason it works only via CAN bus which is configured as BMS CAN.

That's the answer from the battery vendor. This manual helped me to connect my battery. image

Probably, will add detailed manual later.

joggl commented 1 year ago

Hello andkirby, i am from Germany, i try to write in english. I have a battery with the same BMS from an other battery maker. The program from louis doesn't work with this BMS. In the delivered version of my battery the BMS can not comunicate with victron and I have to install an Update on my battery ( this means bin-code). In the link are the updatefile, a PC-software to bring the update on the battery and choose some settings, a movie who show the way of update and settings and a manual (PDF). I had to go this way and now my Raspberry Pi with venus os comunicate with the battery. Best Regards

andkirby commented 1 year ago

Hello @joggl,

it looks like you did a piece of work!

So, the link either is broken or invalid or not allowed to see from my side. I see the following:

Transfer expired Sorry, this transfer has expired and is not available any more

I assume, something went wrong... =) Maybe you have another source of this video.

My questions to your comment:

  1. Where this update (installed on your battery) is coming from?
  2. How to did you install it?
  3. Which version do you have now?

BMS can not communicate with victron 4) It somehow communicates with my Cerbo. Does it work via BMS Can on your side? I have "Settings > Services > VE.Can port > Can Bus profile" = "CAN-bus BMS (500 kb/s)".

joggl commented 1 year ago

This is the manual of my battery. The update for my battery I get from my seller. I only connect 2 cables on my can-hat (CANH and CANL -> Pin 4+5). IMG_20230129_211846 NEW-48V LIFEPO4 BATTERY USER MANUAL.pdf

joggl commented 1 year ago
I don't understand how i can do the Video in GitHub. So i do it this way . 

Best Regards  

   

   

 

andkirby commented 1 year ago

I don't understand how i can do the Video in GitHub. So i do it this way .

I assume, YouTube would be the best place ;)

leowinterde commented 1 year ago

We started to collect all available information (manuals, firmware version and so on) over here https://github.com/LeoWinterDE/BMS. Feel free commit any new firmware version or guide, thanks.

This is the manual of my battery. The update for my battery I get from my seller. I only connect 2 cables on my can-hat (CANH and CANL -> Pin 4+5). IMG_20230129_211846 NEW-48V LIFEPO4 BATTERY USER MANUAL.pdf

Hello @joggl,

it looks like you did a piece of work!

So, the link either is broken or invalid or not allowed to see from my side. I see the following:

Transfer expired Sorry, this transfer has expired and is not available any more

I assume, something went wrong... =) Maybe you have another source of this video.

My questions to your comment:

  1. Where this update (installed on your battery) is coming from?
  2. How to did you install it?
  3. Which version do you have now?

BMS can not communicate with victron

  1. It somehow communicates with my Cerbo. Does it work via BMS Can on your side? I have "Settings > Services > VE.Can port > Can Bus profile" = "CAN-bus BMS (500 kb/s)".
ChristophPech commented 1 year ago

We started to collect all available information (manuals, firmware version and so on) over here https://github.com/LeoWinterDE/BMS. Feel free commit any new firmware version or guide, thanks.

I'm not allowed to commit directly, but this here seems to be an older version of the protocol: https://www.photovoltaikforum.com/core/attachment/77134-pylon-lfp-battery-communication-protocol-rs485-v2-8-20161216-pdf/

MarzaBogdan commented 1 year ago

We started to collect all available information (manuals, firmware version and so on) over here https://github.com/LeoWinterDE/BMS. Feel free commit any new firmware version or guide, thanks.

This is the manual of my battery. The update for my battery I get from my seller. I only connect 2 cables on my can-hat (CANH and CANL -> Pin 4+5). IMG_20230129_211846 NEW-48V LIFEPO4 BATTERY USER MANUAL.pdf

Hello @joggl, it looks like you did a piece of work! So, the link either is broken or invalid or not allowed to see from my side. I see the following:

Transfer expired Sorry, this transfer has expired and is not available any more

I assume, something went wrong... =) Maybe you have another source of this video. My questions to your comment:

  1. Where this update (installed on your battery) is coming from?
  2. How to did you install it?
  3. Which version do you have now?

BMS can not communicate with victron

  1. It somehow communicates with my Cerbo. Does it work via BMS Can on your side? I have "Settings > Services > VE.Can port > Can Bus profile" = "CAN-bus BMS (500 kb/s)".

Hi. After all of this information i still have a question :) I am using a raspberry pi with venus OS. So this type of bms works only with waveshare can pi hat ? I have a USB -Rs485 adapter and i failed to connect this bms with raspberry pi. So i have to buy a waveshare can pi hat ? The adapter i use right now is the one in the picture, please see the link down below. Thanks.

[https://user-images.githubusercontent.com/127730319/224959954-41155586-4ca1-456b-9dff-6ebe6ba1ebe7.jpg]

leowinterde commented 1 year ago

@MarzaBogdan i have only been able to run it with a pi Hat on the venus os, but technically it should also work with a RS485 USB adapter - but I haven't seen this yet.

MarzaBogdan commented 1 year ago

@MarzaBogdan i have only been able to run it with a pi Hat on the venus os, but technically it should also work with a RS485 USB adapter - but I haven't seen this yet.

I have to install or activate any driver on venus os ?

leowinterde commented 1 year ago

@MarzaBogdan i have only been able to run it with a pi Hat on the venus os, but technically it should also work with a RS485 USB adapter - but I haven't seen this yet.

I have to install or activate any driver on venus os ?

This pi hat from waveshare runs without any additional drivers on venus os.

MarzaBogdan commented 1 year ago

@MarzaBogdan i have only been able to run it with a pi Hat on the venus os, but technically it should also work with a RS485 USB adapter - but I haven't seen this yet.

I have to install or activate any driver on venus os ?

This pi hat from waveshare runs without any additional drivers on venus os.

Ok thanks, I will try again with my rs485 adapter and if it still not working i will buy that pi hat waveshare. The thing about my rs485 adapter is i have only 3 ping A B and GND. On wave share i see H L B A.

Thanks for your quickly response

joggl commented 1 year ago

For me it only works the can hat too. I have to Insert a few words at config.txt. See on waveshare wiki. https://www.waveshare.com/wiki/RS485_CAN_HAT

MarzaBogdan commented 1 year ago

For me it only works the can hat too. I have to Insert a few words at config.txt. See on waveshare wiki. https://www.waveshare.com/wiki/RS485_CAN_HAT

Yes. It is working for me too. Today i was able to connect the battery to the venus os. Thanks