diy solar

diy solar

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

Many thanks to all for this project, it's exactly what I was looking for. I have two Ant BMS running, and have successfully connected to one of them including returning values via MQTT - but for some reason I cannot connect to the other one! They are both identical and set up in exactly the same way, both work perfectly in the Ant BMS app and both have modified MAC addresses so I can connect to them separately. The one I cannot conect to is visible in bluetoothctl, but when I try to pair to it I get "failed to connect". Does anyone have any ideas as to why this might be or how I can fix it?

Many thanks,
Tim
 
Is it still connected to a phone possibly? I use 2 pre 2021 BMS's without issue. Yet to try the current versions that I also have. If I am paired to the phone then it won't work until I unpair.
 
Hello again!

I am addressing now to programmers (I am not ) Is there a way to modify the python script to work like this: If there is no response from the BMS in (let's say 5 or 6 seconds) then terminate the execution of the script. In this way, I will save a lot of time. Now, it hangs waiting for a response sometimes even 30-40 sec, and the data is delayed. I want the data to be send more often, and somehow I must overcome this waste of time waiting for a response from the bms. When the communication is working, the data is been extracted from the bms within 4-5 seconds. Any time longer, the attempt will be 100% a fail.

Is there any solution to this ?
Thank you!
import time
from datetime import datetime
import string
now = datetime.now()
h = int((now.strftime("%H")))
print (h)
while True:

try:


time.sleep(120)
exec(open("yourpython.py").read())



except Exception as e:
print ("Exception occured: ", e)
exec(open("yourpython.py").read())
 
Back
Top