Jump to content
43oh

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 . . .

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 . . .

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...