Read and dispaly JBD BMS using Arduino

Hello All ,

Kindly , I have JBD BMS and also I need to communicate toit by arduino and display the voltage , current and capacity . I used the library in the below link JdbBms.h and the code ( basic.ino ) but I didnt get anything on the serial monitor . I connected the JBD BMS ( gnd , tx & rx ) to the arduino pin ( 6 & 7 ) as the code , Could please anyone help

link : GitHub - rakhmaevao/JbdBms: Library for working with JBD BMS

code ( basic )

type or paste code here

#include "JbdBms.h"

JbdBms myBms(6, 7); // RX, TX

void setup()
{
Serial.begin(9600);
Serial.println("JBD bms driver");
}

void loop()
{
if (myBms.readBmsData() == true)
{
Serial.print("This capacity: ");
Serial.println(myBms.getChargePercentage());
Serial.print("This current: ");
Serial.println(myBms.getCurrent());
Serial.print("Protection state: ");
Serial.println(myBms.getProtectionState());
Serial.println();
}
else
{
Serial.println("Communication error");
}
delay(1000);
}


Welcome to the forum

Did you forget to use myBms.begin(); in setup() ?

Hello and thanks for fast reply

no I didnt put it in the code

You mean make the code like this

type or paste code here
#include "JbdBms.h"
// read basic info from JBD BMS
JbdBms myBms(6, 7); // RX, TX

void setup()
{
  Serial.begin(9600);
  Serial.println("JBD bms driver");
myBms.begin();
}

void loop()
{
  if (myBms.readBmsData() == true)
  {
    Serial.print("This capacity: ");
    Serial.println(myBms.getChargePercentage());
    Serial.print("This current: ");
    Serial.println(myBms.getCurrent());
    Serial.print("Protection state: ");
    Serial.println(myBms.getProtectionState());
    Serial.println();
  }
  else
  {
    Serial.println("Communication error");
  }
  delay(1000);
}

It gave me the following error

'class JbdBms' has no member named 'begin'

The SoftwareSerial instance that you have created named myBms needs to run at the correct baud rate. This is usually set in the begin() function, just like Serial.begin() in your sketch

However, looking at the JdBms,cpp file I see

JbdBms::JbdBms(SoftwareSerial * t_softwareSerial){
  m_port = t_softwareSerial;
  m_hwserial = false;
  static_cast<SoftwareSerial*>(m_port)->begin(9600);
}

So it seems that the library sets the baud rate to 9600 for you, but I don't see how the library knows that you are using SoftwareSeriial or what the name of the SS object is

Sorry, but I cannot be of any more help at the mement

Many thanks any way for your reply and consern , I'll try to search a find a solution
Best Regards

Hello!

I have the same isue with the library!

Have you fixed it?

Hello
Do u have JBD BMS and you want to read it its data from the arduino ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.