In this tutorial, we'll learn how to setup an Intel NUC to interact with a TI SensorTag using BLE (Bluetooth Low Energy). The littleb library will be used for Bluetooth communications.Setup
- Follow the Arduino Create getting started flow for the Intel NUC and select the Ubuntu Linux option. NOTE: make sure the select "
Ubuntu" on the "
Get a customized OS for your Gateway" step!
- Once the NUC has been setup and rebooted, connect the Bluetooth 4.0 USB adapter to the NUC.
- Open a terminal session, by pressing
CTRL+ALT+F1on the keyboard attached to the NUC.
- Login using the credentials you set up previously.
- By default, the Ubuntu install does not include the required Bluetooth software, it can be installed by running the following command:
sudo apt-get update && sudo apt-get install bluez
littleblibrary requires you to enable
bluetoothdexperimental support. This can be done by editing the
/etc/systemd/system/bluetooth.target.wants/bluetooth.servicefile on your NUC. Change the:
- Once this change is complete, reboot the NUC:
Loading the sketch
Now that the NUC has been configured with the necessary requirements for the
library, we can load the sketch using Arduino Create.
Inside Arduino Create, open the Arduino Web Editor and select your Intel NUC device from the drop down. Then click the
menu item, followed by
, and then select the
example from the
Next, click the
menu item on the left hide side. This will allow you to monitor the output of
entries that are inside the sketch.
Once the monitor section is open, click the Upload (
) button to build and upload the sketch to your Intel NUC. After, sketch has been uploaded to the Intel NUC, press the button on the left on the TI SensorTag to make it advertise. When advertising, a green LED will start to blink.
sketch, scans for SensorTag's continuously in 15 second intervals. Once a SensorTag is discovered it will try to connect to it, discover it's services and subscribe to the button characteristic (
) for notifications.
Now you can press the left or right button on the SensorTag, and it will send a notification Intel NUC. The
sketch processes the notification and prints out the button that has been pressed (if any).
This tutorial has walked you through how to setup your NUC and use the
library to interact with a TI SensorTag over BLE. The button characteristic was monitored and events were printed to the Arduino Create monitor area.
The TI SensorTag exposes many other features over BLE, you can use the example
sketch as a starting point to interact with them.