Closed Honusnap closed 9 months ago
Hello,
jkbms.prn.py line 443 : client = BleakClient(self.address)
https://bleak.readthedocs.io/en/latest/api/client.html _"Although example code frequently initializes BleakClient with a Bluetooth address for simplicity, it is not recommended to do so for more complex use cases. There are several known issues with providing a Bluetooth address as the address_or_bledevice argument."
Could it be the source of the problem ? I added the debug display in configf.ini,
BleakClient(self.address) with 3C:A5:50:81:D7:C6 => seems to fail bluetoothctl connect 3C:A5:50:81:D7:C6 => work
2024-01-09 14:23:56.716399500 INFO:SerialBattery: 2024-01-09 14:23:56.717421500 INFO:SerialBattery:Starting dbus-serialbattery 2024-01-09 14:23:56.723321500 INFO:SerialBattery:dbus-serialbattery v1.0.2023111 7dev 2024-01-09 14:23:57.739998500 INFO:SerialBattery:Init of Jkbms_Ble at 3C:A5:50:8 1:D7:C6 2024-01-09 14:23:57.741599500 INFO:SerialBattery:Test of Jkbms_Ble at 3C:A5:50:8 1:D7:C6 2024-01-09 14:23:57.761070500 DEBUG:SerialBattery:scraping thread started -> mai n thread id: 3069358096 scraping thread: 3051500640 2024-01-09 14:23:57.763839500 DEBUG:SerialBattery:--> asy_connect_and_scrape(): Connect and scrape on address: 3C:A5:50:81:D7:C6 2024-01-09 14:23:58.479539500 DEBUG:SerialBattery:--> asy_connect_and_scrape(): btloop 2024-01-09 14:23:58.480246500 DEBUG:SerialBattery:--> asy_connect_and_scrape(): reconnect 2024-01-09 14:24:05.824580500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: Characteristic with UUID 00002a24-0000-1000-8000-00805f9b34fb could not be found! 2024-01-09 14:24:08.245174500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit 2024-01-09 14:24:08.282880500 ERROR:SerialBattery:No BMS found at 3C:A5:50:81:D7:C6 2024-01-09 14:24:08.283620500 ERROR:SerialBattery:ERROR >>> No battery connection at Jkbms_Ble
https://copyprogramming.com/howto/unable-to-readspecific-characteristic-from-ble-device-with-python
Hello All, I Swapped the JKbms for an other more recent one .. AND ... it work with this newer one.
Eventually try to set the passkey for the connection to 1234.
As i know, we can't change the bluetooth key, but we can change the password key that's been used in the application for advanced parameters. This password key is the same and different then "1234" in both of my BMS, old BMS do not work, new one does.
But i wIll try to changed the password to 1234 on the old BMS when i'll hook it up to a pack i'm building, thanks.
Cerbo GX do not conenct to the JKbms bluetooth
Hi all, Roughly what i did :
wget the install package then used 1 (last version install : was yesterday : 07/01/2024, did not checked the version), was not working so tried those commands (among others) pip3 install dbus-fast==1.94.1 pip3 install bleak==0.21.0 I then tried nightly >Master install .. nothing better (dbus-serialbattery v1.0.20231117dev)
I've seen many post on bluetooth problems, i''ve tried many solution and still have not solved my problem With bluetoothctl, i disconnected, removed, paired unpaired ... the JKbms MAC. => No success
Here is something that seems abnormal :
[bluetooth]# pair 3C:A5:50:81:D7:C6 Attempting to pair with 3C:A5:50:81:D7:C6 [CHG] Device 3C:A5:50:81:D7:C6 Connected: yes Request passkey [agent] Enter passkey (number in 0-999999): 123456 [CHG] Device 3C:A5:50:81:D7:C6 Paired: yes Pairing successful [JK-B1A24S15P]# info 3C:A5:50:81:D7:C6 Device 3C:A5:50:81:D7:C6 (public) Name: JK-B1A24S15P Alias: JK-B1A24S15P Paired: yes Trusted: no Blocked: no Connected: yes LegacyPairing: no UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: Unknown (0000ffe0-0000-1000-8000-00805f9b34fb) ManufacturerData Key: 0xfad6 ManufacturerData Value: 88 a0 3c a5 50 81 d7 c6 ..<.P... AdvertisingFlags: 06 .
Then some second after, without having done ANY other action on the device :
[JK-B1A24S15P]# info 3C:A5:50:81:D7:C6 Device 3C:A5:50:81:D7:C6 (public) Name: JK-B1A24S15P Alias: JK-B1A24S15P Paired: no Trusted: no Blocked: no Connected: yes LegacyPairing: no UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: Unknown (0000ffe0-0000-1000-8000-00805f9b34fb) ManufacturerData Key: 0xfad6 ManufacturerData Value: 88 a0 3c a5 50 81 d7 c6 ..<.P... AdvertisingFlags: 06
bluetoothctl is very active and verbose, is there something else running, a service or whatever else running that is messing with Ble configuration ? Why is the succesfull pairing disepearing ? The pairing code is : 123456 and pairing work normally on my phone.
Driver version
v1.0.20231117dev
Venus OS device type
Cerbo GX
Venus OS version
3.13
BMS type
JKBMS / Heltec BMS
Cell count
16
Battery count
1
Connection type
Please select
Config file
Relevant log output
Any other information that may be helpful
No response