bradcagle / dbus-btbattery

20 stars 3 forks source link

Issues connecting to either of my BMSs #8

Open krisriegle opened 1 year ago

krisriegle commented 1 year ago

Hey Brad, I've been using your solution here for some time and it has worked quite well, but something recently happened that isn't allowing the bluetooth to connect. I tried rolling back to VenusOS v2.92 today and start fresh to see if that fixed, but I am still getting the following errors:

I get an error when attempting to connect to either of my bluetooth addresses on my JBD BMS's :

root@einstein:/opt/victronenergy/dbus-btbattery# ./dbus-btbattery.py 70:3E:97:07:CD:5E INFO:BluetoothBattery:Starting dbus-btbattery INFO:BluetoothBattery:dbus-btbattery v0.1.3 INFO:BluetoothBattery:Connecting 70:3E:97:07:CD:5E INFO:BluetoothBattery:0.0028997499999832144 INFO:BluetoothBattery:0.005748874999994769 INFO:BluetoothBattery:Connection failed: Failed to connect to peripheral 70:3E:97:07:CD:5E, addr type: public

I also get an error when attempting to run ./scan.py

Traceback (most recent call last): File "./scan.py", line 15, in devices = scanner.scan(10.0) File "/usr/lib/python3.8/site-packages/bluepy/btle.py", line 852, in scan self.start(passive=passive) File "/usr/lib/python3.8/site-packages/bluepy/btle.py", line 790, in start self._mgmtCmd("le on") File "/usr/lib/python3.8/site-packages/bluepy/btle.py", line 312, in _mgmtCmd raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp) bluepy.btle.BTLEManagementError: Failed to execute management command 'le on' (code: 17, error: Invalid Index)

bradcagle commented 1 year ago

I get this sometimes when the BT hardware is locked up. I have to completely remove power from the Venus device, then power back up. A simple reboot may not do it.