Scrin / RuuviCollector

Utility to collect measurements from RuuviTags and store them in InfluxDB
MIT License
125 stars 62 forks source link

Feature request/idea: ability to define used BT adapter in the config #40

Closed coccobill1 closed 5 years ago

coccobill1 commented 5 years ago

Describe the feature you'd like to have implemented Ability to choose the BT adapter used, instead of defaulting to hci0.

Describe alternatives you've considered I'm running this on an RPI3B+ with an integrated BT adapter to monitor a few Ruuvitags and a couple MiFlora plant sensors. Running 2 BTLE daemons simultaneously on the same adapter causes conflicts, and I added an extra usb BT dongle. I would very much like the ability to choose which adapter each collector daemon is running on, I would guess this would be fairly simple to implement with a config option.

Do you want to implement this feature? No

Scrin commented 5 years ago

A suitable config option actually exists already, the command.scan and command.dump found under the "Advanced configuration" section of the example config. You can set something like:

command.scan=hcitool -i hci1 lescan --duplicates --passive
command.dump=hcidump -i hci1 --raw

to use hci1 instead of the default (hci0). You can also set any other hcitool/hcidump options this way, if needed.

I'm not familiar with MiFlora plant sensors, but if reading them follows the same pattern (initiate a BLE scan on the adapter and then read everything that comes in), you can use the same BT dongle for both by setting the scan command blank:

command.scan=

This way the RuuviCollector will not initiate a scan itself, but rather just passively listen at all incoming messages on the device (assuming a suitable scan is initiated elsewhere).

Do either of these options suit your needs?

coccobill1 commented 5 years ago

Those are actually both great options and fill my needs perfectly. Maybe add a short note about them in the docs? Thanks for the quick reply.

Scrin commented 5 years ago

Good to hear, I'll add an additional note about them soon-ish when I'm going through the documentation