Recently I purchased a few “Smart” LEDs from a site called LimitlessLED due to positive feedback from a close friend. After all was said and done, I walked away with 3 RGB LED Bulbs, a remote control, and one of their cool WiFi Receiver Bridges. After waiting a few weeks everything showed up and was working fine out of the box, except the WiFi Bridge. Thus started my journey to figure out what in the hell was going on which ended with me converting the adapter to work from a Raspberry Pi.
So after receiving my stuff, I set off to setup the little WiFi receiver. When I first got it, I took it out and set it up with its companion android application which worked great, but once it was paired to my home network the problems started coming. The problem is I live in a somewhat high density area, so there are TON’s of wireless networks in my area, and for some reason this little receiver bridge loves to drop, ignore, or just plain not forward any packets sent to it over my network. I tried different areas, rooms, hell even WiFi channels, but no matter what I did it was impossible to get a consistent link to the unit.
So with that, I decided the hell with it, and tore the sucker apart. Inside of the thing, you won’t find very much:
The mainboard (Ignore the cables, we will get to that later)
The WiFi Bridge
Now normally these are soldered together, but I forgot to take beforehand pictures (sorry!). So, at this point, I started by researching both boards. I was unable to find anything on the mainboard, but I found quite a bit of documentation on the WiFi controller, which is a High-Flying HF-LPT100 unit. With that, I was able to get a pinout for the leads and was able to find UART on pins 5 and 6. So using my new Saleae Logic 8 I decided to hook up to those leads and see if anything was coming across the leads.
So this is where it gets interesting. During boot and normal operation nothing is broadcasted over UART, and it does not seem to accept any input, but as soon as a command is sent to the controller to control my lights, the packet data was displayed in my serial session. So we can conclude from this that the packet data sent to control the LED’s is sent over the UART directly to the mainboard where it is converted and transmitted vi RF to the bulbs!
So to recap what we know:
- The WiFi bridge is powered by a basic HF-LPT100
- The bridge passes all UDP packets on port 8899 to the UART TX port (9600 baud)
- All UDP packets on port 48899 are used to interface with the HF-LPT100 (WiFi settings, etc)
- The RF radio listens on UART, forwards commands to LEDs
- Everything is powered by 3.3V
Now is where the fun starts. I soldered the WiFi receiver unit off of the mainboard, and hooked up the 3.3V, GND, and RX from the mainboard to a USB TTL device and opened a serial session on the interface. I then took the API Documentation from LimitlessLED, and mapped out the Hex value for “RGBW COLOR LED ALL OFF” to its ASCII character of A. I then turned the LEDs on in my room, sent A over my serial session… and the lights turned off! So from this I was able to confirm once again that the transmitter is directly using the UDP commands sent to the Wi-Fi receiver.
Now that everything was mapped, it was time to map it to the Raspberry Pi pinout. Here is the mapping I went with:
Pi to Transmitter
1 -> 2 (3.3V)
6 -> 1 (GND)
8 -> 6 (TX -> RX)
NOTE: If you do this you need to disable console from your Pi’s bootcmd, as you don’t want a console to be given over UART.
Once that was mapped, I tested again from the Raspberry PI to confirm things still work and as expected they did, but we still have some work to do. How do we go about getting native apps to work? Even better, how do we get it so the API documentation can still be used so all currently developed apps and API’s will run with this?
Well as the transmitter listens and runs off of raw UDP packet data, I coded up a little python listener to do the task! But wait, how about the auto discovery and setup in the iOS and Android apps? Don’t worry, that was taken care of as well! 🙂
Just download the source from my GitHub, change the variables to meet your requirements and hardware, run each script, and away you go!
And in the end, I now have a Raspberry Pi that controls my LED’s without any network issues, and works with Ethernet or WiFi!