Introduction
This post is for the TI and Wurth Elektronik Roadtest Plus and one of the components that was supplied which is the BLE Light development Kit. In the previous posts in the series, I prepared a Wifi Light with a Web based user interface and it was meant to be an IoT Light. In this particular post, I work with a different connectivity solution. I am not android guy and even when Dragan from element14's community, offered the code for his android app, I failed to make it work. Hence I went back to the basics and started work on a Node JS app that could do what I needed. Lets see what I was able to make...
About BLE
There are a lot of resources on BLE and one of the best source is Adafruit's tutorial at https://learn.adafruit.com/introduction-to-bluetooth-low-energy/introduction
They discuss the basics and here is my version of what I understand...
- Every BLE device will use the GAP server to transmit its details- what it advertises, will depend on you.
- You can connect to a BLE device and get access to advertised services. A single BLE device can have multiple services which is a fancy name for saying a single BLE radio can do more than one thing and we keep each task or capability separate this way
- Each service has some 'characteristics' which are like variables on a local machine or a form that you read and fill up. Each characteristic can be either filled up by the device and read by our client(phone or laptop) and some characteristics we fill up and send to the device.
There are prolly a lot of people who will disagree with me and will have something to add... please do in the comments and I will update the post.
About the TI BLE devices
These devices keep advertising themselves all the time and have a UUID like all BLE devices. You can use a scanner app to get that information and so did I. I found characteristics name 'ffb0' through to 'ffb5' that could be written to to change the RGBW values. The LEDs are very bright and these devices are NOT for commercial use because its not certified. (See the documentation). There are a lot of useful blog posts on the element14 forum describing the hardware and here are a few:
- Introduction to Bluetooth Low Energy Light Development Kit - CC2540TDK-LIGHT
- Kit unboxing - LED RoadTest
- Android Support for TI's BLE LED Control
About the Software
The software I wrote is a NodeJS application which uses the noble library by Sandeep Mistry and connects to the BLE peripherals in range. My code scans for peripherals and connects when it finds one of the recognised UUIDs. It then writes the services for the LED control which can receive values from 0 to 255. In my demo I will iterate through a range of values for only the red channel. Here is the video.
As you can see it works pretty well and in the next steps, I will be creating a UI using Meteor.
Feel free to jump in if you see something that can be done better and it will be welcomed. I am an Microwave Materials researcher at this time and have no formal training in programming so to speak.
Thanks for your time and see you next time.
Cheers,
IP