Open simplenotezy opened 3 years ago
This plugin relies on the noble utility to implement a BLE Central device. The bluetooth-hci-socket version relied upon by the noble package does not work with nodejs versions newer than v8. The abandonware version of bluetooth-hci-socket will build on my RPi using nodejs v14. (see https://www.npmjs.com/package/@abandonware/bluetooth-hci-socket). I'm still working to get noble to use the alternate bluetooth module.
Any solution to this issue yet?
I have successfully installed home bridge-bluetooth but homebridge log shows the following error:
Any help is much appreciated.
The solution suggested by @gdavids57 actually works for me. Please do not forget to change all instances of require('bluetooth-hci-socket')
to require('@abandonware/bluetooth-hci-socket')
.
Moreover, the chalk version 5 does not work for this plugin as the moment. So what you need to do is to downgrade chalk version to version 4. What I have done is as follow:
sudo npm uninstall chalk sudo npm install chalk@4.1.2
I have a Bluetooth version of Xiaomi Power Strip 2 (model: qmi.plug.pvs3). It connected ok, but no service discovered.
This is my config file:
{
"platform": "Bluetooth",
"accessories": [
{
"name": "Xiaomi Outlet 2",
"address": "68:AB:BC:07:50:AD",
"services": [
{
"name": "JBL",
"type": "Outlet",
"UUID": "80c77a06-ec5c-11ec-8ea0-0242ac120002",
"characteristics": [
{
"type": "On",
"UUID": "80c77a06-ec5c-11ec-8ea0-0242ac120002"
}
]
}
]
}
]
}
The log on Homebridge as follow:
[15/06/2022, 9:43:48 pm] [Bluetooth] [Xiaomi Outlet 2] Connected | Xiaomi Outlet 2 (68:AB:BC:07:50:AD)
[15/06/2022, 9:43:48 pm] [Bluetooth] [Xiaomi Outlet 2] No services discovered
What have I done wrong?
The solution suggested by @gdavids57 actually works for me. Please do not forget to change all instances of
require('bluetooth-hci-socket')
torequire('@abandonware/bluetooth-hci-socket')
.
Hi @uswong.
Can you please tell me how to find the instances as mentioned in your reply
cd
to your homebridge-bluetooth plugin directory and try using the following command:
grep -r bluetooth-hci-socket *|grep require
Upon running
npm install -g noble
I get below error:If I run it with
sudo
(which I believe I am not supposed to, as my node_modules is owned by my current user), I get this error:Any ideas on how I can proceed?