TI SensorTag driver in Kura Wires
As presented in TI SensorTag Driver, Eclipse Kura provides a specific driver that can be used to interact with TI SensorTag devices. The driver is available only for gateways that support the new Kura BLE APIs.
This tutorial will explain how to configure a Wire graph that connects with a SensorTag, reads sensor values and publishes data to the cloud platform.
The SensorTag driver can be used only with TI SensorTags with firmware version >1.20. If your device has an older firmware, please update it.
Configure Kura Wires TI SensorTag application
- Install the TI SensorTag driver from the Eclipse Kura Marketplace (here or here).
- On the Kura web interface, instantiate a SensorTag Driver:
- Under “System”, select “Drivers and Assets” and click on the “New Driver” button.
- Select “org.eclipse.kura.driver.ble.sensortag” as “Driver Factory”, type a name in to “Driver Name” and click “Apply”: a new driver will be instantiated and shown up under the “Drivers and Assets” tab.
- Configure the new driver setting the bluetooth interface name (e.g. hci0).
- From the “Drivers and Assets” tab, add a new asset bound to the SensorTag driver:
- Click on the “New Asset” button and fill the form with the “Asset Name” and selecting the driver created in step 2. as “Driver Name”. Click “Apply” and a new asset will be listed under the SensorTag driver.
- Click on the new asset and configure it, adding the channels. Each channel represents a single sensor on the SensorTag and can be chosen from the “sensor.name” menu. Fill the “sensortag.address” with the DB address of the SensorTag you want to connect to. The “value.type” should be set to double, but also the other choices are possible.
- Click “Apply”.
- Click on “Wires” under “System”.
- Add a new “Timer” component and configure the interval at which the sensors will be sampled.
- Add a new “Asset” with the previously added SensorTag asset.
- Add a new “Publisher” component and configure the chosen cloud platform stack in “cloud.service.pid” option
- Add “Logger” component
- Connect the “Timer” to the “Asset”, and the “Asset” to the “Publisher” and “Logger”.
- Click on “Apply” and check on the logs and cloud platform that that data are correctly published.
Please note that the driver supports also unsolicited inputs, setting up a notification for the given channel. In this case, it is sufficient to check the listen option for the chosen channel. The Timer is not needed because the SensorTag will automatically emit the values every notification.period milliseconds.