Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect. #11

Open
koma25 opened this issue Nov 3, 2024 · 1 comment
Open

Can't connect. #11

koma25 opened this issue Nov 3, 2024 · 1 comment

Comments

@koma25
Copy link

koma25 commented Nov 3, 2024

Hello. Could you help? The heater is from another manufacturer, but it seems to me that this is an exact copy. Here is the log:

Docker:
2024-11-03T12:35:06.463714576Z 2024-11-03 12:35:06 +0000 [INFO] Connecting to MQTT broker 172.20.0.1:1883

2024-11-03T12:35:06.476836574Z Traceback (most recent call last):

2024-11-03T12:35:06.476911369Z File "//./main.py", line 330, in

2024-11-03T12:35:06.477265269Z vdh = vevor.DieselHeater(ble_mac_address, ble_passkey)

2024-11-03T12:35:06.477395229Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-11-03T12:35:06.477443061Z File "/vevor.py", line 136, in init

2024-11-03T12:35:06.477710871Z self.peripheral = Peripheral(mac_address, "public")

2024-11-03T12:35:06.477788591Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-11-03T12:35:06.477800035Z File "/usr/local/lib/python3.11/site-packages/bluepy/btle.py", line 391, in init

2024-11-03T12:35:06.478096825Z self._connect(deviceAddr, addrType, iface)

2024-11-03T12:35:06.478172472Z File "/usr/local/lib/python3.11/site-packages/bluepy/btle.py", line 439, in _connect

2024-11-03T12:35:06.478486669Z raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)

2024-11-03T12:35:06.478569186Z bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 98:89:17:04:41:5E, addr type: public

gatttool:

admin@docker:~/vevor-ble-bridge $ gatttool -I -b 98:89:17:04:41:5E
[98:89:17:04:41:5E][LE]> connect
Attempting to connect to 98:89:17:04:41:5E
Connection successful
[98:89:17:04:41:5E][LE]> primary
attr handle: 0x0001, end grp handle: 0x0009 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x000a, end grp handle: 0x000a uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x000b, end grp handle: 0x000e uuid: 0000ffe0-0000-1000-8000-00805f9b34fb
attr handle: 0x000f, end grp handle: 0x0012 uuid: 0000180f-0000-1000-8000-00805f9b34fb

@bderleta
Copy link
Owner

bderleta commented Dec 4, 2024

Hard to say, it may be privilege issue (bluepy can't properly access hci device), may be a library (bluepy) problem. It fails in the very first step of connection, there's nothing I can tweak on my side.
How many BT adapters do you have? Please provide an output from hciconfig -a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@bderleta @koma25 and others