8none1 / pybq

Hook up your Bluetooth LE iBBQ thermometer to MQTT with Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to connect

mrand opened this issue · comments

Howdy, and thanks for making this public!
Any ideas how to debug to get further?
Running Ubuntu 18.04 and followed your instructions about running the master version of bluepy.

Device 34:14:b5:xx:xx:xx, RSSI=-46dB
Found iBBQ device iBBQ at address 34:14:b5:xx:xx:xx. RSSI -46
Using hwaddr 34:14:b5:xx:xx:xx
Traceback (most recent call last):
  File "bbq.py", line 128, in <module>
    bbq = Peripheral(hwid)
  File "/home/house/.local/lib/python3.6/site-packages/bluepy/btle.py", line 411, in __init__
    self._connect(deviceAddr, addrType, iface, timeout)
  File "/home/house/.local/lib/python3.6/site-packages/bluepy/btle.py", line 468, in _connect
    % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 34:14:b5:xx:xx:xx, addr type: public

The following two links imply to me that the 6 channel IBT-6XS Inkbird that I'm using should work via passive BLE monitoring:

https://github.com/austinc3030/inkbird_pybbq
https://forums.ni.com/t5/LabVIEW/LabVIEW-BLE-Bluetooth-Low-Energy-toolkit-and-Inkbird-IBT6X/td-p/4058349

and in fact, I get the following data using ESPHome BLE Gateway:
"packet":"043E3A02010000xxxxxxB514342E0201060302F0FF17FF000000003414B53974D9DC00F6FFF6FFF6FFF6FFF6FF050969424251051218003801020A00BC"

Thanks!

I found this change that was required to support the 6XS, if it helps:
https://github.com/theengs/decoder/pull/32/files

It looks like this is failing in Bluepy when creating the Peripheral object.

Looking at the Bluepy docs: http://ianharvey.github.io/bluepy-doc/peripheral.html

A couple of things occur to me:

  1. Do you have more than one Bluetooth adaptor on your computer? If so, set the iface to the correct device
  2. Maybe the iBBQ device needs a pin? The version I have doesn't and so I haven't looked at PIN handling at all

I'm afraid there isn't much to go on here other than BTLEDisconnectError: Failed to connect to peripheral.

I suppose it could be as simple as it being out of range, but you've probably already tried that.

Something you might like to try and using hcitool (https://linux.die.net/man/1/hcitool) to connect to the device using low level Bluez. This will at least allow you to prove that the computer can talk to the iBBQ device.

Using BLE Passive Monitor via an ESP32 running ESPHome BLE Gateway, I'm able to read the temperatures fine without a PIN - so I can't imagine that is it.

And the first lines of this issue report shows that the iBBQ is identified, along with a decent RSSI - so I'm not sure what else to do there - it seems like it is "talking." I moved it even closer though and got the same results, with an RSSI of -43 dB. I also ran hcitool anyway. I do notice that it returns duplicate entries for most devices - I don't know if that's normal:

house@wyse:~$ sudo hcitool dev
Devices:
        hci0    00:16:6F:EC:40:36

house@wyse:~$ sudo hcitool -i hci0 lescan
LE Scan ...
19:5C:9D:ww:CD:73 (unknown)
60:46:75:xx:F3:52 (unknown)
60:46:75:xx:F3:52 (unknown)
34:14:B5:yy:74:D9 (unknown)
34:14:B5:yy:74:D9 iBBQ
F4:93:3E:zz:5A:E5 (unknown)
C8:F5:D0:pp:6F:F8 (unknown)
FE:44:07:qq:B3:40 (unknown)
FE:44:07:qq:B3:40 Kontakt
33:43:BE:rr:8C:A4 (unknown)
79:BC:D3:ss:AD:08 (unknown)
79:BC:D3:ss:AD:08 (unknown)

I searched the bluepy repo and there are a number of hits on "Failed to connect." I suppose I could look through them, although I also note that the repo seems somewhat abandoned... maintainer last did something 10 months ago. There are some forks that appear to be much more active.

Finally, I don't know if it affects things, but apparently the 2 and 4 channel iBBQ devices have their MAC addresses reversed. I assume it shouldn't matter that my 6 channel doesn't?

Mostly unrelated, and putting the cart before the horse in my specific case, but are you able to set temperature alerts? If I'm understanding https://gist.github.com/uucidl/b9c60b6d36d8080d085a8e3310621d64 properly, seems like it should be doable?

I sure would like to get this working!