diy solar

diy solar

For those of you looking to monitor your ANT-BMS with Pi3 via Bluetooth.

No guessing ?. . I monitored my bluetooth communication with a built in tool in android, but little tricky to set up and many instructions are outdated with android 10 and higher. When finally had some bluetooth communcation with my bms with the android app I used wireshark, that can decode communication,identify all bluetooth overhead, just leaving a string that was left over. There I could see what my phone was sending and the answer from bms. I can find the links if hyou need more information.
 
Super cool, and clever :)

Are you optimistic about this whole communication issue we encounter? or should we go in another direction? I don't know, switch the bms brand eventually, or there is another way to get the data from this? I made my decision to buy this BMS because my friend bought this brand (older model), about a year ago and he managed to get data easy and preety straightforward. I am willing to pay for a code that works, just to resolve this problem.
 
Ok. I have response from the seller. They don't have the protocol, but they send me a new (updated) link for the android app. Right now there are (or at least I have) 3 versions of the app - The best, full working version is "MY-APP-1116.apk". The rest of the apps "mybms_v1.2.4_20210803.apk" and "mybms_v1.3.25_20210926(2).apk" are not fully functional, for example I don't have the MOS, balance and cell temperatures displayed.

I was wondering if you can, install the MYApp1116, and try with this app to find that string, because this is may be more accurate, and has all the data.
Or if you dont have the time, tell me what software (links) you used to find that string.

Here is the link that the seller gaved me:

http://mysharegadget.com/947324863
 
Last edited:
Ok. I have response from the seller. They don't have the protocol, but they send me a new (updated) link for the android app. Right now there are (or at least I have) 3 versions of the app - The best, full working version is "MY-APP-1116.apk". The rest of the apps "mybms_v1.2.4_20210803.apk" and "mybms_v1.3.25_20210926(2).apk" are not fully functional, for example I don't have the MOS, balance and cell temperatures displayed.

I was wondering if you can, install the MYApp1116, and try with this app to find that string, because this is may be more accurate, and has all the data.
Or if you dont have the time, tell me what software (links) you used to find that string.

Here is the link that the seller gaved me:

http://mysharegadget.com/947324863
That is the same app (MYApp) I was working with. I have been looking on the wireshark from my usb communcation, it is similar to Bluetooth, but manyb more cells are populated with a reasonable values(15 of 16). The cellvoltage are on other places than the standard protocol. But I cannot find eg total voltage .
 
OK now at least I can figure out the response. I monitored the communication between the Display and the BMS. That follows the protocol I got from a dealer attached as pdf (but I got it as excel). The bluetooth sniff and pythonscript via bluetooth seems not be according the protocol , why I don't know and strange. But the serial port speaks according the protocol. I will test if I can get my computer to communicate that way also.
 

Attachments

  • 140byteprotocol.pdf
    346.5 KB · Views: 75
Interesting... I don't mind talking to the BMS by serial. Just want to know how, and what adapters/converters are necesarry like RS485/TTL or so.
I've changed the SOC value for example, by raising the total Ah value of the pack. The result was that in the app was updated accordingly, but the pyhton output is the same. I got different response at every query for battery temp sensor 4... and that value should be the same, since the temp is constant...
 
Well, I guess my BMS is broken, all of the suden. Today I wired the battery bank to the inverter and I've installed the BMS too. After power on, it says DisMosError and it beeps continuosly. Attached you have a picture to see the error. Besides the Dismos error, the SOC is at 100% from 15% Why? It is broken already?
 

Attachments

  • Screenshot_20220120_181032_com.mayi.bms.jpg
    Screenshot_20220120_181032_com.mayi.bms.jpg
    160.8 KB · Views: 37
Well, I guess my BMS is broken, all of the suden. Today I wired the battery bank to the inverter and I've installed the BMS too. After power on, it says DisMosError and it beeps continuosly. Attached you have a picture to see the error. Besides the Dismos error, the SOC is at 100% from 15% Why? It is broken already?
What a unluck. What happens if you disconnect inverter? The voltage seems reasonable for about 100%. Why was it 15% before?. What is connected to give the high current of16A?
 
What a unluck. What happens if you disconnect inverter? The voltage seems reasonable for about 100%. Why was it 15% before?. What is connected to give the high current of16A?
Hello! It's been quite a long time since I visit the forum, and this topic in particular.
I want you to know what it happened to my BMS. Well, I completely understand now, why it has been damaged, and lets say it's my fault.

So, somewhere in the docs, manuals that I received from the seller, I've read that before connecting the bms to the system, I must close the mosfets in the app, which I did. Then I connect the bms to the system, and with a precharge resistor, I charge the inverter capacitors to avoid sparks when connecting the load. (at least that was my intention :) And then I connect the battery to the inverter and power on the system.
Since the BMS had the mosfets in close position, the procedure of precharging the inverter capacitors has not occured (obviously, since there has been no current flow to the inverter). When I switched the power on, a large flow of current passed and at that moment the bms broke. So, I realized this latter on.

I spoked to the seller, and it confirmed that it is short circuit when connecting the load, and he suggested to me to send back the unit for a repair.
I did not wanted that, since the shipping costs and wait time is too long.
A friend of mine, says that if I open the BMS, I can inspect with a multimeter every mosfet (there are 36), and I can easily see what mosfet is broken.
So I open the BMS, I find the problematic mosfet, and I cut it's pins from the PCB. (I was too lazy to unsolder it nicely).
I want to tell you that the BMS is alive again (without 1 mosfet, It's power is reduced by about 15% - no bother).

Now, I am back from where I started it. It is very very frustrating not having the data from it to my dashboard.
Tell me that you have made some progress regarding the BT communication ?
 

Attachments

  • resizeIMG_20220204_151447.jpg
    resizeIMG_20220204_151447.jpg
    273 KB · Views: 40
  • resizeIMG_20220204_154927.jpg
    resizeIMG_20220204_154927.jpg
    202.9 KB · Views: 40
Hello! It's been quite a long time since I visit the forum, and this topic in particular.
I want you to know what it happened to my BMS. Well, I completely understand now, why it has been damaged, and lets say it's my fault.

So, somewhere in the docs, manuals that I received from the seller, I've read that before connecting the bms to the system, I must close the mosfets in the app, which I did. Then I connect the bms to the system, and with a precharge resistor, I charge the inverter capacitors to avoid sparks when connecting the load. (at least that was my intention :) And then I connect the battery to the inverter and power on the system.
Since the BMS had the mosfets in close position, the procedure of precharging the inverter capacitors has not occured (obviously, since there has been no current flow to the inverter). When I switched the power on, a large flow of current passed and at that moment the bms broke. So, I realized this latter on.

I spoked to the seller, and it confirmed that it is short circuit when connecting the load, and he suggested to me to send back the unit for a repair.
I did not wanted that, since the shipping costs and wait time is too long.
A friend of mine, says that if I open the BMS, I can inspect with a multimeter every mosfet (there are 36), and I can easily see what mosfet is broken.
So I open the BMS, I find the problematic mosfet, and I cut it's pins from the PCB. (I was too lazy to unsolder it nicely).
I want to tell you that the BMS is alive again (without 1 mosfet, It's power is reduced by about 15% - no bother).

Now, I am back from where I started it. It is very very frustrating not having the data from it to my dashboard.
Tell me that you have made some progress regarding the BT communication ?
Nice to see you again. I was busy installing the batteries in our Melex 252 a golfchart. It runs super on the batteries (48V, 130Ah). I have prepared a RPI Zero W and will try connect it directly to the cable (with some protection circuits).
 
Golfchart? Cool! Nice :)
Please post back any update you have regarding the communication with our model of ANT BMS. I don't know where to look anymore, for protocol or some more information regarding this :(
Thanks in advance.

Adrian.
 
Hello again!

Good news! Thanks to "MrLaptop" - he gaved me his working code for our 2021 bms model. Initially it was for 8 cells, but I easly modified for 16 cells. All the data, except bms_power are OK. (Power is easy to calculate from amps*voltage, so it is not a problem.
The only problem is that, from time to time it has communication issues, so not every phyton script call returns values (It returns timeout errors). so the data is updated every 30sec to 2-3 minutes) If we somehow manage to overcome this issue, and have real time data from the BMS it will be perfect!!

It's already a good progress to have data, even if they are not in real time!
I post my modified code here: (and a printscreen from my arduino-blynk app with all the BMS data)

Thank you again MrLaptop!
 

Attachments

  • 2021antbms-model-16cells-OK-basic-code.py.txt
    7.4 KB · Views: 88
  • Screenshot_20220216_110250.jpg
    Screenshot_20220216_110250.jpg
    108.6 KB · Views: 48
Last edited:
Hello

first of all - thanks to all here who do develpment on this thing of BMS Systems

Here i have 3 AntBMS on 3 Different Batteries two in 15S Configuration and one in 16s
All Three i can connect trough the antBMS App without any problem

Now i want to monitor them so i used a RPI3 with fresh Raspbian OS following this Thread but i dont get any connection - after 3 Days of Working...

i searched for the bms on the pi

[NEW] Device AA:BB:CC:A0:11:11 BMS-ANT16S-111

Paired it

[NEW] Device AA:BB:CC:A0:11:11 BMS-ANT16S-111
[bluetooth]# pair AA:BB:CC:A0:11:11
Attempting to pair with AA:BB:CC:A0:11:11
[CHG] Device AA:BB:CC:A0:11:11 Connected: yes
Request PIN code
[agent] Enter PIN code: 1234
[CHG] Device AA:BB:CC:A0:11:11 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device AA:BB:CC:A0:11:11 ServicesResolved: yes
[CHG] Device AA:BB:CC:A0:11:11 Paired: yes
Pairing successful

Trust

[bluetooth]# trust AA:BB:CC:A0:11:11
[CHG] Device AA:BB:CC:A0:11:11 Trusted: yes

then i edit your script "serverMacadress

serverMACAddress = 'AA:BB:CC:A0:11:11'

I tryed different Versions of this Script fond here in this Tread but i allways get:

Traceback (most recent call last):
File "/bms/bmsnew.py", line 30, in <module>
Antw33 = ser.recv(140)
OSError: [Errno 9] Bad file descriptor

I also tryed this test Script fond here:

import socket
import time
import requests as req
from binascii import unhexlify
import struct
import sys
import serial
import bluetooth
from bluetooth import *

serverMACAddress = 'AA:BB:CC:A0:11:11'
port = 1
s = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM
s.connect((serverMACAddress,port))

test='DBDB00000000'
try:
s.send(test.decode('hex'))
except:
s.close()
time.sleep(1)
Antw33 = s.recv(140)
#SoC
data = (Antw33.encode('hex') [(74*2):(75*2)])
print (data)
try:
resp = req.get(url+'SoC'+'?value='+str(int(data,16)))
except:
pass
and i get
Traceback (most recent call last):
File "/bms/bms1.py", line 22, in <module>
Antw33 = s.recv(140)
OSError: [Errno 9] Bad file descriptor

I tryed this with all 3 BMS i have....

Some month ago i started my own research with rfcom bluetooth Serial and also python it i got anwer from this bms but i deleted the code and the pi image ... dam ..

Can anyone helpe me to understand whats going wrong here ?
 
Hi

just found the Solution - the Problem is python3 wich is included in the current raspbian ...

The problem is "test.decode('hex')"
This kind of decoding dont work on python3

im not a big programmer and dont find a Solution for this issue
So i changed to python2 and with python2 it works well ...
 
Hello again!

Good news! Thanks to "MrLaptop" - he gaved me his working code for our 2021 bms model. Initially it was for 8 cells, but I easly modified for 16 cells. All the data, except bms_power are OK. (Power is easy to calculate from amps*voltage, so it is not a problem.
The only problem is that, from time to time it has communication issues, so not every phyton script call returns values (It returns timeout errors). so the data is updated every 30sec to 2-3 minutes) If we somehow manage to overcome this issue, and have real time data from the BMS it will be perfect!!

It's already a good progress to have data, even if they are not in real time!
I post my modified code here: (and a printscreen from my arduino-blynk app with all the BMS data)

Thank you again MrLaptop!
Lucky Guy. I am still struggeling, no problem to read but I need something to trigger the BMS to start to send.
 
Hi

just found the Solution - the Problem is python3 wich is included in the current raspbian ...

The problem is "test.decode('hex')"
This kind of decoding dont work on python3

im not a big programmer and dont find a Solution for this issue
So i changed to python2 and with python2 it works well ...

Yeap. Good to know this, I had errors too with python3, but I forgot the error messages.
For new users, saves a lot of time if we guide them correctly from the beginning, so people must know that these antbms python scripts needs python 2.x. So when you choose the raspberry pi image, you must select legacy OS (and not the latest).
 
Hi

i Think there a no bit changes needed to make it work with python3 - i will look at it if i have some spare time...

Best regards
 
Back
Top