Skip to content

Alpha Smile B3 BMS CAN bus #36

Description

@spiderdijon

I have started to explore the BMS CAN bus on my Smile B3. I'm using SocketCAN with a baud rate of 250000 and have made some progress. I have noticed the cell voltages for the single 2.9KWh battery I have:

`import can
import time

bus = can.Bus(channel='can0', interface='socketcan')

while True:
message = bus.recv()

if (message.arbitration_id == 0x181E17F3):
    print(hex(message.arbitration_id))
    print("Cell X: " + str(((message.data[1] & 0xFF) << 8)|(message.data[2])) + " mV")
    print("Cell Y: " + str(((message.data[3] & 0xFF) << 8)|(message.data[4])) + " mV")
    print("Cell Z: " + str(((message.data[5] & 0xFF) << 8)|(message.data[6])) + " mV")
if (message.arbitration_id == 0x182417F3):
    print(hex(message.arbitration_id))
    print("Cell 0: " + str(((message.data[1] & 0xFF) << 8)|(message.data[2])) + " mV")
    print("Cell 1: " + str(((message.data[3] & 0xFF) << 8)|(message.data[4])) + " mV")
    print("Cell 2: " + str(((message.data[5] & 0xFF) << 8)|(message.data[6])) + " mV")
if (message.arbitration_id == 0x182517F3):
    print(hex(message.arbitration_id))
    print("Cell 3: " + str(((message.data[1] & 0xFF) << 8)|(message.data[2])) + " mV")
    print("Cell 4: " + str(((message.data[3] & 0xFF) << 8)|(message.data[4])) + " mV")
    print("Cell 5: " + str(((message.data[5] & 0xFF) << 8)|(message.data[6])) + " mV")
if (message.arbitration_id == 0x182617F3):
    print(hex(message.arbitration_id))
    print("Cell 6: " + str(((message.data[1] & 0xFF) << 8)|(message.data[2])) + " mV")
    print("Cell 7: " + str(((message.data[3] & 0xFF) << 8)|(message.data[4])) + " mV")
    print("Cell 8: " + str(((message.data[5] & 0xFF) << 8)|(message.data[6])) + " mV")
if (message.arbitration_id == 0x182717F3):
    print(hex(message.arbitration_id))
    print("Cell 9: " + str(((message.data[1] & 0xFF) << 8)|(message.data[2])) + " mV")
    print("Cell 10: " + str(((message.data[3] & 0xFF) << 8)|(message.data[4])) + " mV")
    print("Cell 11: " + str(((message.data[5] & 0xFF) << 8)|(message.data[6])) + " mV")
if (message.arbitration_id == 0x182817F3):
    print(hex(message.arbitration_id))
    print("Cell 12: " + str(((message.data[1] & 0xFF) << 8)|(message.data[2])) + " mV")
    print("Cell 13: " + str(((message.data[3] & 0xFF) << 8)|(message.data[4])) + " mV")
    print("Cell 14: " + str(((message.data[5] & 0xFF) << 8)|(message.data[6])) + " mV")
if (message.arbitration_id == 0x182917F3):
    print(hex(message.arbitration_id))
    print("Cell 15: " + str(((message.data[1] & 0xFF) << 8)|(message.data[2])) + " mV")        

`
It seems the CAN bus may have additional information that is not available over the Modbus. Has anyone one else looked into this? Smile B3 batteries seem hard to acquire so I'm considering writing a BMS bridge to use readily available batteries.

Apologies again for posting it as an issue rather than discussion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions