Integrating With Flowcloud

All of this so far has been fine and dandy, but you're hardly going to want to be fiddling with the Ci20 every time you want to operate a bluetooth lightbulb. Wouldn't we much rather control it from our personal computer, or perhaps a smart phone? To that end, we will now work on a way of integrating our bluetooth device with FlowCloud.

[Read more]

Bluetooth LE in Python using pexpect and gatttool

Once you've extablished control of the peripheral using gatttool's interactive mode, the next step is to establish a way of controlling it programmatically. Here, we accomplish this using pexpect, a library for controlling command line programs in Python. Make sure you have pexpect installed on the Ci20:

[Read more]

Command line BTLE

First things first, set up the Ci20. You can do all of the development for this project directly on the Ci20 if you wish, either by hooking it up to a monitor through HDMI or running it headless and connecting to it via ssh. Developing on the Ci20 makes experimenting easier, because you don't need to re-upload your software each time you want to test something. After you've set up the Ci20, you'll need to install the BlueZ bluetooth stack from source. Open a terminal and run the following (the sudo password is ci20):

[Read more]

Reverse engineering the control protocol

Start by reverse engineering the control protocol for the bulb, as demonstrated in this guide. Note: If you’re using a peripheral that implements a standard service, the following process will not be necessary. The salient points are as follows:

[Read more]