-
Notifications
You must be signed in to change notification settings - Fork 117
BTLEDisconnectError & BluetoothBackEndExeption #64
Comments
So you didn't change anything at it started to appear ? Using phone app for thermostats ? Are thermostats runnign latest firmware ? You could also try to pair them, with the computer https://wiki.archlinux.org/index.php/bluetooth#Pairing |
Same error for me, but with Xiaomi temperature and humidity sensors. Reboot helps for 5min - 12h. Also on Bluez 5.50. Even with pairing.
|
Hey ho, i have the same problem but i'm a little bit further 😁 |
Same problem here... Data are not sent to HA, only the topics...
|
So far rebooting RPI every hour seems to work just fine. At least I am not getting stuck with empty responses. |
By double-checking, I saw the problem is not the same... I'll have to investigate :s |
@Maczuga can you please check the next time if there is a zombie bluepy-helper? i have a workaround, which works for me 🙈
i know it only hides the problem, but at this moment, its enough for me😅 |
Same problem here, but even more frequently, I can't get data most of the time, the only way to get it is to put the thermometer in pairing mode and it works for some seconds 2019-06-27 14:13:02,509 INFO bt-mqtt-gw.workers.mithermometer mithermometer.py:39:status_update - Updating 1 mithermometer devices The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): |
I had the same error as @StefanoMarchesi. After trying a few things the following worked for me. Running |
I'm wondering if an update occurred to a bluetooth related system package or even the kernel. I didn't have these issues and now I have them. Unfortunately I can't seem to pin point the time of the update nor the suspect package and version. |
@zewelor gateway is stopping every day! It wont even last 24 hours. When it stops, then only help is restart NUC. Command
Command Before I had Monitor, also for scanning bluetooth devices, wich has been working non stop |
@zewelor Every day after about 8hours of running gateway or at midnight it stops working. Gateway start to restart non stop. Any suggestion? I deleted now miflora, and only use toothbrush |
Looks like this issue: IanHarvey/bluepy#190 (comment) . Im not linux bluetooth stack expert, so I dont have any ideas about this. Maybe some workers combination, doesnt want to work together. Maybe you could write down worker which are causing problems. Except of some bluetooth drivers / stack problems, it might be that some libs doesnt free interface correctly, or something should need to wait longer before pooling bluetooth data. |
I installed gateway on 2 raspberrys, one with kodi, one with openmediavault, and it is now 1day 1hour up! With 2 workers: oralb and miflora! This was not possible on intel nuc(ubuntu server, docker, HA)! |
@joselito11 On NUC with HA, did you usd any bluetooth integration in HA ? Or maybe bluetooth drivers on NUC are just broken, or needs kernel upgrade etc ? |
I first used bletooth tracker from HA, for miflora. Few day later I found your script. I have updated linux firmware for kernel? But for bluetooth drivers I found only old post for ubuntu 16.04, so I was not able to update. |
Having the same issue on a Raspberry Pi Zero with the latest raspberian buster. |
Hello. Using the bluepy module, I was struggling with a similar issue for a little while myself. I found a way around it thanks to the hints at this thread. On a raspberry zero (as central) receiving sensor data from an esp32 (peripheral). When I power off the ESP the Raspberry gets the initial BTLEDisconnectError then "BTLEInternalError: Helper not started (did you call connect()?)" Then exit. import binascii
import struct
import time
from bluepy.btle import UUID, Peripheral, BTLEDisconnectError, BTLEInternalError
adc_uuid = UUID(0x2A6E)
p = Peripheral()
p.connect("bt:ma:ca:dd:re:ss", "public")
def main():
print("connecting...")
ch = p.getCharacteristics(uuid=adc_uuid)[0]
if (ch.supportsRead()):
while 1:
try:
val = binascii.b2a_hex(ch.read())
val = binascii.unhexlify(val)
val = struct.unpack('<h', val)[0]
print str(val)
time.sleep(.01)
except BTLEDisconnectError:
print "Device disconnected!"
continue
except BTLEInternalError:
print "internal error... ignoring"
time.sleep(.5)
print "attempting to reconnect..."
p.connect("bt:ma:ca:dd:re:ss", "public")
ch = p.getCharacteristics(uuid=adc_uuid)[0]
if (ch.supportsRead()):
continue
else:
"no connection!!!"
if __name__ == '__main__':
main() |
I do also phase the same issue. Any progress on this? |
Same here. Have a Raspberry Pi Zero with dietpi running nothing else but bt-mqtt-gateway. |
08:30:51 Error during update of thermostat device 'Bad' (00:1A:22:0A:F7:66): BTLEDisconnectError Same issue. Raspberry Pi 4 Any idea? |
Hi
i have used bt-mqtt-gateway for some month, no problems there but since 1 or 2 weeks i receive some errors.
Today i updated to the new version + update bluez to 5.50
Config:
mqtt:
host: 192.168.178.2
port: 1883
username: bt-mqtt
password: *****
client_id: bt-mqtt-gateway
manager:
workers:
thermostat:
args:
devices:
schlafzimmer: 00:1A:22:10:FC:3D
badezimmer: 00:1A:22:11:1D:75
wohnzimmer1: 00:1A:22:11:15:3F
wohnzimmer2: 00:1A:22:10:DE:29
wohnzimmer3: 00:1A:22:11:02:76
hobbyraum: 00:1A:22:11:1D:CA
topic_prefix: heizung
topic_subscription: heizung/+/+/set
update_interval: 60
miflora:
args:
devices:
ebene2: C4:7C:8D:67:40:89
ebene1: C4:7C:8D:67:5A:51
topic_prefix: miflora
update_interval: 60
pi@rpi:~/bt-mqtt-gateway $ sudo ./gateway.py
20:34:53 Starting
20:34:53 Adding 6 thermostat devices
20:34:54 Adding 2 miflora devices
20:34:54 Updating 6 thermostat devices
20:34:54 Error during update of thermostat device 'schlafzimmer' (00:1A:22:10:FC:3D): BTLEDisconnectError
20:34:54 Error during update of thermostat device 'hobbyraum' (00:1A:22:11:1D:CA): BTLEDisconnectError
20:34:54 Error during update of thermostat device 'wohnzimmer1' (00:1A:22:11:15:3F): BTLEDisconnectError
20:34:54 Error during update of thermostat device 'badezimmer' (00:1A:22:11:1D:75): BTLEDisconnectError
20:34:54 Error during update of thermostat device 'wohnzimmer2' (00:1A:22:10:DE:29): BTLEDisconnectError
20:34:54 Error during update of thermostat device 'wohnzimmer3' (00:1A:22:11:02:76): BTLEDisconnectError
20:34:54 Updating 2 miflora devices
20:34:55 Error during update of miflora device 'ebene1' (C4:7C:8D:67:5A:51): BluetoothBackendException
20:34:55 Error during update of miflora device 'ebene2' (C4:7C:8D:67:40:89): BluetoothBackendException
20:34:55 Setting target_temperature to 22.0 on thermostat device 'wohnzimmer2' (00:1A:22:10:DE:29)
20:34:55 Error setting target_temperature to 22.0 on thermostat device 'wohnzimmer2' (00:1A:22:10:DE:29): BTLEDisconnectError
20:34:55 Setting target_temperature to 22.0 on thermostat device 'wohnzimmer3' (00:1A:22:11:02:76)
20:34:55 Error setting target_temperature to 22.0 on thermostat device 'wohnzimmer3' (00:1A:22:11:02:76): BTLEDisconnectError
20:34:55 Setting target_temperature to 23.0 on thermostat device 'badezimmer' (00:1A:22:11:1D:75)
20:34:56 Error setting target_temperature to 23.0 on thermostat device 'badezimmer' (00:1A:22:11:1D:75): BTLEDisconnectError
20:34:56 Setting target_temperature to 22.0 on thermostat device 'wohnzimmer1' (00:1A:22:11:15:3F)
20:34:56 Error setting target_temperature to 22.0 on thermostat device 'wohnzimmer1' (00:1A:22:11:15:3F): BTLEDisconnectError
20:34:56 Setting target_temperature to 22.0 on thermostat device 'hobbyraum' (00:1A:22:11:1D:CA)
20:34:56 Error setting target_temperature to 22.0 on thermostat device 'hobbyraum' (00:1A:22:11:1D:CA): BTLEDisconnectError
20:34:56 Setting target_temperature to 4.5 on thermostat device 'schlafzimmer' (00:1A:22:10:FC:3D)
20:34:56 Error setting target_temperature to 4.5 on thermostat device 'schlafzimmer' (00:1A:22:10:FC:3D): BTLEDisconnectError
The text was updated successfully, but these errors were encountered: