This project all started when I got these super cheap lighting controllers off Amazon meant to be controlled through a mobile app. Popping them open, I found out that they were very simple printed circuit boards with an ESP8266 microcontroller and minimal circuitry. Digging around the user manual yielded a few reference to the mobile app, which was called "WLED". Funnily enough, WLED is also the name of an open-source project aimed at creating ESP32-driven lighting shows. Obviously, someone in China had considered this and build modules around that project. Interestingly, the OTA firmware flashing feature was still active, and that's how I set out to hack up a fun xmas lights show.
I am Jack's dull lighting controller...
Aww Yisss... an ESP8266!!
Loading the latest WLED release inside the controller's memory (15.0), I was able to see a WiFi access point called WLED and connect to it using the default "wled1234" password. From there, the WLED web UI is completely accessible, which allows for easy configuration onto one's local network. I set mine up on 192.168.1.10 and set out to plug some lights on it...
Ho ho ho...
LED Modules
The controllers advertised support for a few LED modules that use 3-wire protocols. Sadly, I only had older WS2801-based strips at hand, which use an older 4-wire SPI-based protocol (V+, GND, DATA, CLK), which were not explicitely supported by the controller. However, this limitation can easily be bypassed by hacking up the extra GPIO pin of another port, and using WLED to re-route that pin to act as the SCLK signal. The downside of this manoeuver is that you lose one port, but gain the ability to drive other protocols using GPIO bit-banging.
Ye Olde WS2801 strips...
Driving 4-wire LED drivers by stealing a pin from port 2
Software hijack of port 2's GPIO1 as CLK
Paydirt: Houston, we have pretty lights.
Now It Begins: xLights
Now that we have working LEDs and a controller, we can let the fun begin with adding some real brains to the light show... Enter xLights, an open-source DMX/E131/ArtNET/DDP control software with professional capabilities. As with most mature open-source projects, it features a rich feature set, and a vibrant community of users. More importantly, xLights has a very solid integration to WLED through E131's streaming ACN protocol, which allows us to control one or more WLED controllers from an xLights base station... While a thorough discussion on xLights capabilities would be outside the scope of a simple blog post, we can leverage the following features to build fun sequences:
- VAMP plugins allow for automated audio feature extraction to create timing tracks to add to xLights sequences
- Several effects have parameters that can be tied to amplitude/frequency/spectral components in the audio track to drive the lightshow accordingly.
In the spirit of Xmas magic, I ended up with this after 15 minutes of fiddling around:
Comments
Post a Comment