• Have you tried out dark mode?! Scroll to the bottom of any page to find a sun or moon icon to turn dark mode on or off!

diy solar

diy solar

a new uart protocol for a Daly Smart 150A BMS?

russt

New Member
Joined
Jun 27, 2024
Messages
6
Location
New Jersey, USA
I just tried connecting a UART to my DALY Smart BMS, and things didn't work, so I started debugging the signals with a logic analyzer. It looks to me like there might be a new protocol being used? All the open source implementations I've seen have 0xA5 as a start byte and a request packet length of 13 bytes, whereas when I eavesdrop on the communication between the bluetooth dongle and the BMS what I see is a start byte of 0xD2 and a request packet length of 8 bytes.

It feels very strange to me! Has anyone seen something similar?

The BMS I'm trying to talk to is this one (amazon link https://www.amazon.com/gp/product/B0CXTBS7VH):
DALY Smart 16S BMS 48V with WiFi Module and CAN 485 Communication Protection Board for LifePO4 Lithium Battery Pack(16S 48V Smart BMS+RS485+CAN+WiFi Module,150A)
battery serial number 20240523
software version: 11_240518_K00T
SN code: 226JD150403780
Firmware Version: 3.3.0

When looking at the bluetooth dongle traffic in the logic analyzer I see requests that look like these:
Code:
# d2 03 00 80 00 29 96 5f
# d2 03 00 00 00 3e d7 b9
# d2 03 00 a9 00 20 87 91
# d2 03 00 c9 00 03 c6 56
# d2 03 00 cc 00 02 17 97
# d2 03 00 3e 00 09 f7 a3
# d2 03 00 57 00 0c e7 bc
# d2 03 00 d7 00 01 27 91
and I see much longer strings of data coming back. I can also replicate this without the dongle, by programming an esp32s2 to send a "d2 03 00 00 00 3e d7 b9" request, and I get back a longer string of bytes that seems similar to what I see with the dongle.

If I look at the traffic when connected to an esp32s2 running esphome and the daly_bms component, I can see that the esp32 is sending out requests with the "a5" start byte, but I can't see any response from the BMS.

I've asked Daly about this, but haven't gotten a response yet. Thought I'd also ask here, as you all seem to have a hotbed of diy innovation going on :)
 
So as an update to this, it turns out that the Daly BMS is communicating using the modbus protocol, which is totally separate from the RS485 and CAN bus protocols. Daly tech support came through for me and gave me pretty complete documentation on the protocol, which I translated into English using google translate and am attaching here.

As a really nice side benefit, esphome has great support for the modbus protocol. Using their modbus components, I can interface to the BMS without doing any programming at all (well, barely any :)).
 

Attachments

Here is the esphome configuration that I'm using... hope it helps anyone who runs into something similar.

Code:
### the main esphome configuration file, leaving out everything except the modbus specific sections
uart:
  - id: uart_1
    baud_rate: 9600
    tx_pin: GPIO7
    rx_pin: GPIO9
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
         timeout: 100ms
      sequence:
        - lambda: UARTDebug::log_hex(direction, bytes, ' ');

modbus:
  - id: modbus_client
    uart_id: uart_1

modbus_controller:
- id: modbus_device
  address: 0xd2
  modbus_id: modbus_client
  #setup_priority: -10
  update_interval: 10s
 
sensor:
  -platform: modbus_controller
    modbus_controller_id: modbus_device
    name: cell1
    register_type: holding
    address: 0x00
    unit_of_measurement: "V"
    value_type: U_WORD
    accuracy_decimals: 3
    lambda: return .001 * (float)x;

  -platform: modbus_controller
    modbus_controller_id: modbus_device
    name: temperature1
    register_type: holding
    address: 0x20
    unit_of_measurement: "C"
    value_type: U_WORD
    accuracy_decimals: 0
    lambda: return x-40

  -platform: modbus_controller
    modbus_controller_id: modbus_device
    name: voltage
    register_type: holding
    address: 0x28
    unit_of_measurement: "V"
    value_type: U_WORD
    accuracy_decimals: 1
    lambda: return .1 * (float)x;

  -platform: modbus_controller
    modbus_controller_id: modbus_device
    name: current
    register_type: holding
    address: 0x29
    unit_of_measurement: "A"
    value_type: U_WORD
    accuracy_decimals: 1
    lambda: return .1 * (float)x;

  -platform: modbus_controller
    modbus_controller_id: modbus_device
    name: faultBitmap1
    register_type: holding
    address: 0x3a
    unit_of_measurement: ""
    value_type: U_WORD
 
As one further note, I don't think I can recommend attaching a device to the UART for a Daly BMS like mine. What is happening is that the ground on the UART port is tied to B-, not to P-. Most of the time this is fine, since the BMS is shorting P- to B-. But when the BMS cuts out (for example if a cell goes under or over voltage), then B- goes -50V relative to P-, and that's not so good for any electronics that are using P- as ground. It seems fine for the Daly bluetooth/wifi dongle, because that doesn't have any kind of external ground.

For me specifically, I managed to fry two esp32 chips this way, and have destroyed both UART ports on my BMS :) So not super happy about the whole situation. The CAN bus / RS485 port doesn't appear to suffer from this problem, so that's probably where I'll end up.

Cheers!
 
Howdy russt,

I was going to post a thread up about my issue but it looks like you may already have at least part of it solved, so I'll ask.

I'm trying to interface my Daly Smart BMS to a PowMr 5000W inverter.

The Daly came with a five lead CAN bus / RS485 port lead. The leads read: ABGND, 485A, 485B, CAN_H, CAN_L.

The PowMR has an 8 pin RS485 communication port (looks like a double wide telephone cord plug).
Instruction manual states the following about the port:
SR485-1 Pin 1 is 5V power supply, Pin 2 is ground, Pin 7 is RS485-A1, Pin 8 is RS485-B1
SR485-2 Pin 1 is 5V power supply, Pin 2 is ground, Pin 7 is RS485-A1, Pin 8 is RS485-B1
No other pins (3 through 6) are listed.

Any thoughts on what connects to what? I'm not seeing any 5V out on the Daly lead. Both have 485 A and B pins and what do I do with the CAN H & L leads?

I want to extend the BMS lead and adapt it to the PowMr port, just need to know the correct wiring. Once I have that I'll work on getting the two to talk to each other.

Thanks in advance for any info you can pass on.
 
I don't know why and how, but it works without connecting the ground from UART, just with the RX and TX.

I seems that the ground from UART face issue like you said, I fried ESP too ...

Did you manage to use write_lambda ?
 
As one further note, I don't think I can recommend attaching a device to the UART for a Daly BMS like mine. What is happening is that the ground on the UART port is tied to B-, not to P-. Most of the time this is fine, since the BMS is shorting P- to B-. But when the BMS cuts out (for example if a cell goes under or over voltage), then B- goes -50V relative to P-, and that's not so good for any electronics that are using P- as ground. It seems fine for the Daly bluetooth/wifi dongle, because that doesn't have any kind of external ground.

For me specifically, I managed to fry two esp32 chips this way, and have destroyed both UART ports on my BMS :) So not super happy about the whole situation. The CAN bus / RS485 port doesn't appear to suffer from this problem, so that's probably where I'll end up.

Cheers!
Good to know as I was about to connect two Heyo clones to my raspberry Solar Assistent .... I ordered rs485 but understand that will not work as it is not implemented on my BMS ( thx to another thread ) I suspected as much but though I would try - now I know the lack of a lable on the port really does mean Not present. Will look at using the actual bluetooth already on them if there is a clean way to pull the data from linux ( I assume yes cause a apple Ipod is thier flavor of unix under the hood ) Just probably take some hard looking ...
 
As a quick follow up, I'm now using rs485 and am very happy with it. The specific board is one of these TTL to rs485 converters (http://www.aliexpress.us/item/3256806450639454.html), and I'm connecting the A, B, and ground wires from the Daly BMS connector to it (and leaving the CANBus wires unattached).

For rs485 interfacing, this thread is an absolute gold mine of information: https://diysolarforum.com/threads/decoding-the-daly-smartbms-protocol.21898/
Thank you @tanoshimi !

I also tried CANBus, and things mostly worked, but reading the cell voltages was flaky. I couldn't reliably get readings for all 16 cells; some would appear, others would disappear, etc...
 
Last edited:
Hey 9 like to use this thread about my problem using ESP32 UART 1 and UART2 for two BMS. The battpacks working parallel on busbar. Communication both BMS via wnt and can to deye Inverter.
After half year using my common gnd from esp to both UART gnd begin burning.
Why there was a high current?
Any solution about reading on one UART for both devices? Via UART directly or using wnt board via rs485 or rs232?
 

Attachments

  • 17341245146121112496975999324947.jpg
    17341245146121112496975999324947.jpg
    68.6 KB · Views: 20

diy solar

diy solar
Back
Top