ubuntubluetooth-lowenergyubuntu-16.04hci

Hcitool whitelist command isn't working


I am running Ubuntu 16.04 dual boot windows. I am using a UD100 Bluetooth USB adapter (old computer isn't BLE compatible on its own!)

I have a beacon that works fine. lescan works ok (although seems to duplicate even without --duplicates). However, the --whitelist option doesn't seem to work at all.

Terminal Output Image Capture

As you can see from the above image, the whitelist feature fails to scan any beacons, and the lewlsz size never changes when I add a MAC address, even when trying different formats. Clearing the white list has no effect either.

Whats going on? I am trying to monitor multiple beacons, and writing scripts for this, and it would be nice to use lescan --whitelist and its related lewladd and lewlrm commands instead of mucking about with egrep stuff such as lescan | egrep 'MAC1|MAC2|... for each MAC address I want to scan for.

Thank you!


Solution

  • Is the Bluetooth Device address of your peripheral a public or random static address? If it's a random, you need to add the option - -random to the lewladd command.

    The lewlsz command returns the maximum number of devices that can be stored in the white list; not the current size.