Skip to content

Can't control MOSFETs with bms.set_mosfet_control #5

Description

@airy77

Looking at the bms.cpp file and specifically the function definition "OverkillSolarBms::set_mosfet_control(bool charge, bool discharge)", I see the following call:

write(true, BMS_REG_CTL_MOSFET, length, data);

The first parameter "true" is used to indicate that the BMS will be read, why isn't this set to "false" indicating a write to the BMS to control the FETs? I changed the line in the code as follows:

write(false, BMS_REG_CTL_MOSFET, data, length);

I changed the first parameter from true to false (should change the old read to a write), and I swapped the data and length fields as others have noted, but it still doesn't work. I've seen others swapping data bytes (https://www.reddit.com/r/OverkillSolarBMS/comments/mmosr0/overkillsolarbmsarduinolibrary_mosfets_onoff/) to try and fix the issue but I am hesitant to arbitrarily write different registers within the BMS without knowing. Are the BMS registers defined somewhere so I can determine the proper way to write and control the FETs?

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