Code Monkey home page Code Monkey logo

Comments (5)

jdrescher2006 avatar jdrescher2006 commented on August 22, 2024

Have you tried the bmsinfo.py? It works for me.

from fhem-bluetoothsmartbms.

clardima avatar clardima commented on August 22, 2024

Thanks for your reply.
I was having difficulties with bluetooth on my raspberrypi, so I had to solve that first.

Now I am able to connect to the BMS's (I got 3 of them)
One of them is working, I can receive the data.

But the other 2, seem not to work. The script is freezing.

pi@raspberrypi:/clardibms $ sudo python3 bmsinfo.py A4:C1:38:06:BC:A6
BMS found
BMS request generic data
BMS answering
BMS answering
BMS answer: dd03001b0b4700001a251c2000002446000000000000195d0307020b4f0b4afd7d77
BMS request voltages
BMS answering
BMS answering
BMS answer: dd04000e101c101d101e101e101a101b101cfebc77
BMS chat ended
{
"Bal": 0,
"Ibat": 0.0,
"T1": 16.4,
"T2": 15.9,
"V01": 4.124,
"V02": 4.125,
"V03": 4.126,
"V04": 4.126,
"V05": 4.122,
"V06": 4.123,
"V07": 4.124,
"Vbat": 28.87
}
[A4:C1:38:06:BC:A6] Disconnected
pi@raspberrypi:
/clardibms $ sudo python3 bmsinfo.py A4:C1:38:40:18:39
BMS found
BMS request generic data
BMS answering

...and....

pi@raspberrypi:/clardibms $ sudo bluetoothctl
Agent registered
[xiaoxiang BMS]# scan on
Discovery started
[CHG] Controller B8:27:EB:4E:27:C6 Discovering: yes
[CHG] Device A4:C1:38:06:BC:A6 RSSI: -68
[CHG] Device A4:C1:38:57:7C:4B RSSI: -42
[xiaoxiang BMS]# connect A4:C1:38:57:7C:4B
Attempting to connect to A4:C1:38:57:7C:4B
[CHG] Device A4:C1:38:57:7C:4B Connected: yes
Connection successful
[CHG] Device A4:C1:38:57:7C:4B ServicesResolved: yes
[xiaoxiang BMS]# exit
pi@raspberrypi:
/clardibms $ sudo python3 bmsinfo.py A4:C1:38:57:7C:4B
BMS found
BMS request generic data
..(and it hangs....)

from fhem-bluetoothsmartbms.

jdrescher2006 avatar jdrescher2006 commented on August 22, 2024

I have the same problem, sometimes the communication freezes:
./bmsinfo.py A4:C1:38:F2:6D:4E
BMS found
BMS request generic data

Currently I am working on making the script more robust, so as to repeat the request. Also I am looking to get more data from the BMS like SOC and other values.

from fhem-bluetoothsmartbms.

jdrescher2006 avatar jdrescher2006 commented on August 22, 2024

I have discovered that it makes sense to wait a second before writing to the device. This makes communication much more stable.
Like that:
time.sleep(1)
self.bms_write_characteristic.write_value(bytes([0xDD,0xA5,0x03,0x00,0xFF,0xFD,0x77]));

Note that you need to import time for that.

from fhem-bluetoothsmartbms.

vx2200 avatar vx2200 commented on August 22, 2024

I had the same stability issues and added a sleep between connection and write statement. This helps a lot. But, sometimes it still freezes. I increased the sleep to 2 seconds. This seems to fix this problem.

from fhem-bluetoothsmartbms.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.