Sample App: BLE Central using Texas Instruments CC2650 SensorTag and IBM Watson IoT Quickstart
This app demonstrates "end to end" connectivity using both BLE and Wi-Fi. It reads sensor data via BLE from a Texas Instruments CC2650 SensorTag and publishes it to IBM's Watson IoT Quickstart page via Wi-Fi and MQTT.
- Broadcom WICED SDK 3.5.2
- TI CC2650 SensorTag (http://ti.com/sensortag)
- Avnet BCM4343W IoT Starter Kit (http://cloudconnectkits.org)
The TI CC2650 SensorTag consists of the following:
- CC2650 Wireless SoC
- Invensense MPU-9250 9-Axis Motion Sensor
- TI TMP007 IR Thermopile Temperature Sensor
- TI HDC1000 Humidity Sensor
- TI OPT3001 Ambient Light Sensor
- Bosch BMP280 Barometric Pressure Sensor
The BCM4343W radio implements a BLE central that actively scans for a CC2650 SensorTag. When a nearby SensorTag is powered up and starts advertising (ADV), the BCM4343W establishes a connection, writes to the various GATT characteristics that enable the sensors on the SensorTag and then enables notifications. When notifications are received by the BCM4343W, the data is formatted into standard measurement units (ie, C, hPA, lux, etc) and published to the IBM Quickstart IoT service via MQTT. If the SensorTag is powered off or if the BLE connection drops for any reason, the BCM4343W will revert back to the scanning state. Depending on the sensor, the CC2650 will push a notification to the BCM4343W at intervals ranging from 1 second to approximately 2.5 seconds. The rate(s) can be modified in the app source code following TI’s SensorTag documentation. The design is currently limited to a single connection.
To demonstrate the app:
- Edit wifi_config_dct.h with the settings for your local Wi-Fi AP (SSID and password).
- Build the app and download it to the Avnet BCM4343W IoT Starter Kit using an appropriate Make Target, ie, "demo.sensortag_cloud-BCM94343W_AVN download_apps download run"
- Visit IBM’s IoT Quickstart website located at: https://quickstart.internetofthings.ibmcloud.com
- Enter the Device ID printed to the serial console by the BCM4343W. The number corresponds to the factory-programmed MAC address of the BCM4343W.
- Lastly, power up a TI CC2650 Sensortag. The app will automatically connect and start publishing sensor values to the IBM website.
- Multiple, simultaneous SensorTag connections
- BLE Security / Bonding capability. CC2650 SensorTag doesn't currently require this.
- Ability to provision Wi-Fi via BLE by adding BLE Peripheral capability to the app (simultaneous Central/Peripheral operation)