The Advanced Bluetooth binding brings support for Bluetooth technology into Eclipse SmartHome Framework. The following main use cases are supported by the binding:
The Bluetooth binding can be installed via PaperUI and Eclipse MarketPlace. Please follow this guide.
There is only one "thing" that represents all adapters (Generic and BlueGiga) in the binding.
Discovered adapters can be added as new things from the PaperUI inbox. It is possible to enable/disable discovery of Bluetooth devices for each added adapter thing:
This thing is intended to be used for older versions of bluetooth devices which do not support BLE technology.
Some of mobile phones (older versions) are recognised as generic bluetooth device:
Only Presence detection and Indoor positioning features are available for this type of Bluetooth devices:
This thing is used for newer versions of Bluetooth devices which support BLE technology (public and private static address types).
All the binding features are fully supported by this thing. For example, a standard Bluetooth heart rate monitor will look like that:
From the picture above you can see a list of channels that are automatically created for all discovered GATT services and characteristics of the heart rate monitor device.
This thing is used for some Bluetooth devices that periodically change its addresses (private non-resolvable and resolvable address types) to some random addresses in order to protect privacy of their owners. All modern mobile phones (iPhone and Android) evey so often (roughly every 10 minutes) randomly generate a new Bluetooth address and abandon old one making it impossible to track them.
Only Presence detection and Indoor positioning features are available for this type of Bluetooth devices:
Bluetooth devices are able to broadcast (advertise) some information that can be used to identify them via radio signal, normally it is:
Bluetooth receivers (adapters) periodically scan radio frequencies for advertised messages and report them to the binding. By using advertised messages the binding is able automatically discover Bluetooth devices and also track its presence.
The easiest and most effective way to detect presence is to use so called "Bluetooth beacon" devices.
Normally, most of Bluetooth devices broadcast messages, however there are some devices that try to hide themselves from receivers providing privacy for their owners. Many of modern mobile phones (iPhone and Android) evey so often (roughly every 10 minutes) randomly generate a new Bluetooth address and abandon old one making it impossible to track them by its address.
The binding implements an algorithm to match Bluetooth devices not by its address but by a combination of the following:
Moreover, Android and iPhone smartphones also stop advertising (turns off broadcasting so that no any Bluetooth device can find them) once Bluetooth settings screen gets closed. Some mobile apps can be used to enforce Bluetooth broadcasting to be always on, they normally called "Bluetooth beacon simulators".
//TODO list some beacon simulators
Bluetooth adapters are capable of sensing strength of radio signal that is transmitted by Bluetooth devices (Received signal strength indication; RSSI). The binding is able to calculate estimated distance between adapters and devices by analysing RSSI levels. The closer device to adapter, the stronger signal. If multiple adapters are installed into the system, the binding can be used to detect location of Bluetooth device by comparing estimated distance between device and adapters.
Multiple adapters must be used in order the indoor positioning to functional effectively.
It is advisable that adapters are physically separated from each other as much as possible. For example, you may want to install Bluetooth adapters in each room of your house so that the binding will be able to locate Bluetooth devices in each room. Therefore defining a location for each adapter is essential:
The location of the nearest adapter will be reported by Bluetooth device thing:
In order to add support for new devices, the binding can be extended in several ways - declarative and programmatic:
The binding extensively uses Java Bluetooth Manager and Bluetooth GATT Parser. More details can be found here.
There are two types of adapters that are supported by the binding. Each of them has pros and cons. You may find that not all of them will work for you:
The following table shows some major features supported by each adapter type:
Generic | BlueGiga | |
---|---|---|
Windows | - | Y |
Linux | Y | Y |
Mac | - | Y |
X86 32bit | Y | Y |
X86 64bit | Y | Y |
ARM v6 (Raspberry PI) | Y | Y |
Adapters autodiscovery | Y | Y |
Adapter aliases | Y | - |
Device aliases | Y | - |
BLE devices support | Y | Y |
BR/EDR devices support (legacy BT) | Y | - |