Jump to content

Christmas present == new project . . .

Recommended Posts

So, one of the gifts I received for Christmas this year was an LED multi color smart bulb. In the E27 ( I think ? ) format, or whatever the standard household bulb type *is*. These light bulbs are great, in that they can display multiple colors, and have multiple patterns, and perhaps a few additional "features" in software. The downside is the software available is for Android or iOS only.


So this got me wondering how hard it could be to write software for a PC ( OSX included ) to access these bulbs. So, I spent a good part of my Christmas reading, and toying with what I'd consider obscure concepts. To be sure, I found one document that talked about reversing such a device, but the information provided was outdated, missing, or just flat out wrong. So, I wound up finding a stackoverflow.com post http://stackoverflow.com/questions/23877761/sniffing-logging-your-own-android-bluetooth-trafficwhich gave me a very good idea how to sniff the data packets going out of my tablet to the bulb. This post by far was the best resource I found for the entire endeavor . . . as every thing else I read was completely wrong for my own situation. Nothing worked.


Essentially, I had to trial and error everything, until I eventually wound up with a method to turn on/off the bulb from the Linux command line using bluez tools such as hciconfig hcitool, and gatttool. Great . . . one step down, and yes I can turn on /of the bulb, as well as execute a few specific functions that seem to be included into the software for the BLE controller.  Which by the way is definitely a Texas instruments part for sure.


Now, the next step is to write a specific purpose application in C, which is then accessed via a web app in the step afer that ( step 3 ). So eventually, I can have a web interface for turning on / off the light, as well as perform custom color manipulation, and perhaps even syncing to music.


In other words, YAY! something else to keep me busy :)


EDIT: And yeah. eventually I'll put a write up out on all this. But right now. my notes are a complete mess as several parts had to be redone multiple times, and some just did not work . . .

Share this post

Link to post
Share on other sites

For what it's worth. bluez BLE is  *hard*. Also having a hard time wading through gatttool.c as the person who wrote it seems to be infatuated with glibc garbage which makes for very terse reading.


gThis gThat and since I'm unfamiliar with these libraries, or whatever they are, it serves as additional obfuscation to the code. There also seems to be several layers of "wrapper" functions going back about 3 to 4 functions deep for "simple" operations such as "connect", etc.


Still reading . . .

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now