Open asifma opened 3 years ago
This, sadly, don't say more than that the bluez stack failed to connect with the BLE device. If you retry a few times does it ever work? Does it work with the App in the phone?
I had similar error messages when the device was too faar away from the fan. Try moving it closer, it worked for me.
I have the same problem on Armbian Bullseye. The setup worked for some time on Armbian Buster. But after switching to Bulsseye I cant connect to the fan. Tried different bluepy versions from pip repo. The fan is visible via scanning. The distance between the devices is the same as before.
python3 cmdline.py -m 58:2b:db:34:2c:e0 -p 9XXXXXXX
Traceback (most recent call last):
File "/usr/share/hassio/homeassistant/custom_components/pycalima/pycalima/cmdline.py", line 134, in <module>
main()
File "/usr/share/hassio/homeassistant/custom_components/pycalima/pycalima/cmdline.py", line 80, in main
fan = Calima(mac_address, pincode)
File "/usr/local/lib/python3.9/dist-packages/Calima-2.0.0-py3.9.egg/pycalima/Calima.py", line 79, in __init__
self.conn = ble.Peripheral(deviceAddr=addr)
File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 353, in __init__
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 401, in _connect
raise BTLEException(BTLEException.DISCONNECTED,
bluepy.btle.BTLEException: Failed to connect to peripheral 58:2b:db:34:2c:e0, addr type: public
Exception ignored in: <function Calima.__del__ at 0xb66326a0>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/Calima-2.0.0-py3.9.egg/pycalima/Calima.py", line 83, in __del__
AttributeError: 'Calima' object has no attribute 'conn'
I can confirm this as well. Tried on both raspberry os on a pi zero and ubuntu server on a rpi 4. After a few retries though it works so it might just be the distance as @Nornode pointed out
I have the same exact issue as described, running on a pi zero with Raspbian Bullseye. Moreover, the thoughts on closing the distance and making several attempts have no impact. (My Pi zero is within a few feet and has been moved in different directions in the same range. I have also made 20+ attempts to connect, without success.)
The cmdline.py -l command works fine and lists my one device, so logically it should be in range to connect. Connecting via the Android app also works fine.
I have the same exact issue as described, running on a pi zero with Raspbian Bullseye. Moreover, the thoughts on closing the distance and making several attempts have no impact. (My Pi zero is within a few feet and has been moved in different directions in the same range. I have also made 20+ attempts to connect, without success.)
The cmdline.py -l command works fine and lists my one device, so logically it should be in range to connect. Connecting via the Android app also works fine.
I finally managed to resolve my connect issue, though I'm not sure what was the key step:
Hi, Probably not an issue in the script, but do you have any experience of this?