hannseman / homebridge-mi-hygrothermograph

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
MIT License
266 stars 52 forks source link

hcitool lescan does not work anymore after plugin installation #109

Open whissperr opened 4 years ago

whissperr commented 4 years ago

Expected Behavior

hcitool lescan command normally starts scanning process and gives list of discovered BLE devices

Current Behavior

After plugin installation and configuration hcitool lescan command returns back an error:

raspberrypi:/home/pi# hcitool lescan Set scan parameters failed: Input/output error

If plugin configuration is deleted from config and home bridge restarted, hcitool lescan behavior is back to normal

Steps to Reproduce (for bugs)

Versions

Configuration

Homebridge Log / Command Output

hannseman commented 4 years ago

Weird, what RPi model are you using?

whissperr commented 4 years ago

Raspberry Pi 4B - 2GB

ebreg commented 4 years ago

I have the exact same problem on a Raspberry Pi Zero W Rev. 1.1.

OS: Linux homebridge 5.4.51+ (armv6l) Homebridge: 1.1.1 Mi Hygrothermograph plugin: 3.0.1 Node: 12.18.2

plantoschka commented 4 years ago

I have the same issue on an Intel NUC with an external Bluetooth Dongle.

The problem is also that gatttool which I am using to control a SwitchBot does not work anymore when this plugin is enabled. After stopping this plugin everythin works fine.

xrust83 commented 4 years ago

I have the same issue on an RPI 3B+ with an external Bluetooth Dongle.

idsnowghost commented 4 years ago

Same issue with Beaglebone Black/Debian 9. Plugable brand BLE dongle.

Also stops scanning for the sensor updates after about 30 minutes unless I trigger a BLE command for another Homebridge plugin (homebridge-hatch-baby-rest).

xrust83 commented 4 years ago

08/30/2020 I installed a clean homebridge image. Installed the homebridge-mi-hygrothermograph plugin point by point and everything worked as it should for 2 days. I installed today sudo apt-get update -y sudo apt-get upgrade -y and the thermometer plug is broken again. Plugin breaks BT driver update. or other drivers. After rebooting, an error appears adapter does not support Bluetooth Low Energy (BLE, Bluetooth Smart). Try to run with environment variable: [sudo] NOBLE_HCI_DEVICE_ID = x node ...

ux-lic commented 3 years ago

I had the same issue on my RPi Zero. I found restarting the bluetooth service fixed the issue.

[sudo] service bluetooth restart

_

homebridge-mi-hygrothermograph v3.0.2

_

dalanmiller commented 3 years ago

Maybe related to:

xumxum commented 3 years ago

Today saw also the mi sensor was consistently givving polling error. service bluetooth restart did the job..for now.

dugiebones commented 3 years ago

Experiencing the same problem (hcitool not working after plugin install, continue working after uninstall, on rpi 4-4G). Is it an inherent problem with how the Bluetooth work? Might try again on rpi 4-2G or 3b later...

codyc1515 commented 3 years ago

Of course the scanner will not work plug-in is using the Bluetooth. This is because the plug-in "locks" the Bluetooth, so to speak. You can keep spamming sudo hcitool lescan while restarting Homebridge and hopefully it should work.

pavlobielousov commented 1 year ago

Of course the scanner will not work plug-in is using the Bluetooth. This is because the plug-in "locks" the Bluetooth, so to speak. You can keep spamming sudo hcitool lescan while restarting Homebridge and hopefully it should work.

That seems to be true. The plug-in takes an exclusive access to the Bluetooth device thus other applications fail while trying to communicate with it.

I suggest temporarily stopping the Homebridge service sudo hb-service stop. Then run hcitool lescan or other Bluetooth-related commands, and start the Homebridge service again sudo hb-service start.