Skip to content

Daly BMS via can bus #167

Closed
Closed

Description

@SamuelBrucksch

Hi,

Some of the Daly BMS support a connection via can bus. That should be considerably faster than the serial connection. The protocol is also open.

So i was wondering if - technically - this could be implemented into this library as well. I could work on it and try it myself as I have such a Daly BMS with can bus, i just want to know if there could be any problems I did not see yet.

Each BMS has its own implementation of the communication (protocol), so a new BMS type Daly_CAN could be added that gets the data via can bus instead of serial, however some logic needs to detect/search for the can bus too, right?

As the cerbo for example already has VE.Bus hardware, do you by chance know, if that could be used directly? Then a RJ45 to Daly cable would be enough and I could start working on this...

Activity

  1. SamuelBrucksch commented on Jul 31, 2022

    @SamuelBrucksch
    ContributorAuthor

    Hm looks like CAN on daly is a gamble as noone really knows if they have CAN or not. Read from some guys, that only RS485 is available but not can bus, although it is printed on the case and also marked on the cables...

  2. geromd commented on Jul 31, 2022

    @geromd

    @SamuelBrucksch Yes, some Daly BMS also have CAN-Bus. Before I decided for the RS485 way and driver of Louisvdw, I already connected the Daly CAN Port with RJ45 to the Vicron BMS CAN, because Daly tld me the BMS can communicate with Victron. (I think this was fake news). Due that communication packages were counted, I know that the CAN-Connection was working, but the Victron did not recognizied the Daly BMS on CAN due to missing driver.

    Over all, I was fighting with a lot of issues with Daly BMS, and sooner or later I will follow the recomendation of Louisvdw and use any other BMS but not the Daly anymore, to get a better performance of SOC calculation and cell management. I think a JK BMS with active balancer will be a good substitution.

  3. SamuelBrucksch commented on Aug 1, 2022

    @SamuelBrucksch
    ContributorAuthor

    How did you know CAN was working if you could not see anything except counting packages?

    As soon as you connect, Venus OS sends out messages on CAN that fit to the selected CAN profile. Those should be counted on TX.

    Did you also see messages on RX?

    Venus OS has some CAN CLI tools like cansend, candump that you can use to send messages and see the traffic. When I tried it, i could only see the outgoing messages but could not get any reply from the Daly even when I sent requests to it via cansend.

    Also how did you do the cabling? Maybe there is something wrong at my setup. I chose pins 3,7,8 as somewhere described for VE.Can.

  4. SamuelBrucksch commented on Aug 1, 2022

    @SamuelBrucksch
    ContributorAuthor

    Ok can now connect to Daly BMS via canbus. Here a sample for cells voltage:

      candump can0
      can0  18950140   [0] 
      can0  18954001   [8]  01 0D 7D 0D 7E 0D 7E 58
      can0  18954001   [8]  02 0D 7E 0D 7F 0D 7E 58
      can0  18954001   [8]  03 0D 7E 0D 7F 0D 7E 58
      can0  18954001   [8]  04 0D 7E 0D 7E 0D 7E 58
      can0  18954001   [8]  05 0D 7E 0D 7F 0D 7F 58
      can0  18954001   [8]  06 0D 7F 0D 7F 0D 7F 58
    

    Can needs to be set to 250000, requests look like this:

    cansend can0 18950140#
    

    So the request ID is 18 + Data ID + BMS ID (01) + Uplink ID (40)

  5. SamuelBrucksch commented on Aug 1, 2022

    @SamuelBrucksch
    ContributorAuthor

    Looking good, first try with python-can lib:

    INFO:SerialBattery:Starting dbus-serialbattery
    INFO:SerialBattery:dbus-serialbattery v0.12
    INFO:SerialBattery:No Port needed
    INFO:SerialBattery:Testing DalyCAN
    18944001: bytearray(b'\x10\x01\x00\x00\x02\x00\x00\x00')
    INFO:SerialBattery:DalyBMS 16 cells
    INFO:SerialBattery:Connection established to DalyCAN
    INFO:SerialBattery:DeviceInstance = 2
    INFO:SerialBattery:com.victronenergy.battery.USB9
    INFO:SerialBattery:Battery connected to dbus from /dev/tty/USB9
    INFO:SerialBattery:DeviceInstance = 2
    INFO:SerialBattery:Changed DeviceInstance = 2
    INFO:SerialBattery:read_soc_data
    18904001: bytearray(b'\x02\x12\x00\x00t\x9b\x03O')
    INFO:SerialBattery:voltage: 530, current: -14.9, soc: 847
    

    All data requested is from can bus

  6. SamuelBrucksch commented on Aug 1, 2022

    @SamuelBrucksch
    ContributorAuthor

    Oh yeah:
    image

    It's fully working now. Needs some cleanup, but will create a PR soon, so we can check if everything is ok. Adoption of Daly to Daly CAN was actually quite easy as the protocol behind is still the same.

    Will test over night to see if it is stable enough and the voltages are reported more correctly.

  7. geromd commented on Aug 1, 2022

    @geromd

    Wow, this would really be great if it can be added to the driver, to work with the CAN-Bus.

  8. SamuelBrucksch commented on Aug 1, 2022

    @SamuelBrucksch
    ContributorAuthor

    PR with working code: #169

  9. SamuelBrucksch commented on Aug 2, 2022

    @SamuelBrucksch
    ContributorAuthor

    Cell voltages from last 6h:
    image
    Seems to be stable and also the values look very nice now. No weird values anymore.

  10. pau1phi11ips commented on Aug 30, 2022

    @pau1phi11ips

    @SamuelBrucksch That looks good! What are you using to generate the cell voltages graph?

  11. SamuelBrucksch commented on Aug 30, 2022

    @SamuelBrucksch
    ContributorAuthor

    I use openhab which has Grafana integrated for visualization of the values that openhab gets. Requires influxdb additionally to that:
    https://community.openhab.org/t/influxdb-grafana-persistence-and-graphing/13761

  12. pau1phi11ips commented on Aug 31, 2022

    @pau1phi11ips

    Thanks @SamuelBrucksch, it gave me a head start. Found the Victron Grafana docker and it was super simple to install that and get the stats.

    https://github.com/victronenergy/venus-docker-grafana

    Thanks again @Louisvdw for this awesome driver!

    image

  13. RedCross0815 commented on Sep 16, 2022

    @RedCross0815

    Sorry for my stupididi but i need help. Iam reading and trying for hours now to get the daly bms via can to run.

    I get these meassage via can bus, as in the thread before:
    putty

    But how do i get the bms into the device List like this?

    grafik

    I did all the installation shown in the video and the text, but i wont work...

  14. SamuelBrucksch commented on Sep 18, 2022

    @SamuelBrucksch
    ContributorAuthor

    You need two terminals to test if the CAN connection works. One for candump and one for cansend. Your cansend snippet does not show any Daly messages. Also you need to execute the dbus-serialbattery code manually, as there is no CAN auto detection yet.

  15. mr-manuel commented on Apr 14, 2023

    @mr-manuel
    Collaborator

    What is the current state of this?

  16. self-assigned this
    on Apr 20, 2023
  17. Repository owner locked and limited conversation to collaborators on Apr 25, 2023
  18. converted this issue into a discussion #561 on Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions