eschava / node-red-contrib-xiaomi-ble

Xiaomi Bluetooth4 (BLE) sensors
MIT License
19 stars 15 forks source link

Support for noble.address? #21

Closed moryoav closed 3 years ago

moryoav commented 4 years ago

Since I'm using an Intel NUC internal bluetooth, I added another bluetooth dongle, Asus BT400, connected with a USB extension cable, because distance is an issue for me. Now, how do I choose which BT device the node calls? I want to force the node to call the BT400 instead of the built in BT. Is it possible?

eschava commented 4 years ago

Documentation for noble states that

hci0 is used by default to override set the NOBLE_HCI_DEVICE_ID environment variable to the interface number. Example, specify hci1: sudo NOBLE_HCI_DEVICE_ID=1 node .js

Have you tried that?

moryoav commented 4 years ago

Interesting! Any idea how to do that on Windows?

eschava commented 4 years ago

you can execute set NOBLE_HCI_DEVICE_ID=1 in the console before starting node-red (the same console, of course) or set environment variable globally using this instruction https://docs.oracle.com/en/database/oracle/r-enterprise/1.5.1/oread/creating-and-modifying-environment-variables-on-windows.html#GUID-DD6F9982-60D5-48F6-8270-A27EC53807D0

moryoav commented 4 years ago

I will give it a try, thank you!