NodeMCU MQTT LED Strip Controller Build & Config How-To Videos

@killercorny - I love questions that answer themselves :slight_smile:

Nice job - and glad to hear the LED strip is working for you! I just made one for my brother-in-law to go fully around his room (in a channel mounted along the wall/ceiling), for a total length of 15 meters (3 5-meter strips, 450 LEDs). It’s working well, with proper power supply and bussing of the power along the strip (I made a video about it on my channel), but I’ll have to try playing with the setting you found to adjust the length of effects to the length of the strip.

Thanks!

Yeah, I was too impatient again and take a look around and found it. Anyway…

There´s one thing that still bothers me. After a while the animation stops or color changes to full white. Also, some of the effects cause a hangup of the nodemcu. So I have to power cycle it.
I think its a problem with my nodemcu v2. Because of this I allready order some v3 from banggod a month ago, hope the arrive soon. Then I will switch these an see if the problem persists.

Check to make sure your power supply has enough amperage. How many LEDs are you running? If you’re running the 30/M string @ 5v, keep in mind you’ll need 1.8A per meter to power the string (and a bit extra for the NodeMCU). Those wall power supplies are usually only 1A or so, so you don’t want to run more than ~15 LEDs or so on them.

I experienced the same issues you had, on my longer strings, trying to run them on phone charger power supplies. I’ve had to swtich to the dedicated LED driver power supplies for my longest strips, and haven’t had any issues since then.

I dont think, power is the problem. I´m using this PSU: https://de.aliexpress.com/item/DC5V-Waterproof-IP67-Switching-Power-Supply-20A-100W-Driver-Transformer-100-240V-AC-DC-5V-Power/32705421954.html?spm=a2g0s.9042311.0.0.7af64c4dotDC4U
It provides upt o 100W, but my stripe uses 90W at max. Its a 60/m strip and 5m long, so 5*60=300 and 300 *0,06A = 18A *5V = 90Watts :wink:
When its a problem with the PSU there would be an overload very soon and not like me after several minutes. It´s up to an hour before the lights go off. After then I simply have to switch off an on via OH2 and set the effect again.
Its a strange behavior…

Ok, that is definitely enough power :smiley: - also, looks like a nice supply! Just out of curiosity, is it fan-cooled or just heat-sink? I have a couple of those fan-cooled ones, and don’t like how loud they get…

So, what you’re describing sounds like the ESP8266 hitting a watchdog timer. Did you compile the Arduino code with 80Mhz CPU clock or 160Mhz? i’ve only used 160Mhz, to avoid any issues…

The PSU is without fans, just a heat-sink-case.

Indeed, I used the 80Mhz setting. I´ll try 160 Mhz, cause there´s nothing to loose…

EDIT:
@bartus
The 160Mhz setting doesnt fix my problem. It still occurs …

I’ve got a more generic question. I’ve already hyperion running on a pi3 (together with Kodi) for Ambilight behind my tv. I also have a esp8266 in place for the measuring the level of my rainwater.
Is there any particular reason to use an ESP for this project and no pi zero w? I’m planning to place an extra apa102 which I want to connect to my hyperion. I already found tutorials how to do this with an esp and a pi, but dont know which to choose :slight_smile:

@killercorny - that is really perplexing. I guess the only other things I could think of would be temporary power sag or transients (solved by putting a filter cap between the LED strip’s 5V/Gnd leads), or connectivity issues (i.e. my strips will freeze if the openHAB/MQTT server goes down, while they attempt to reconnect - however; they will definitely restart themselves when reconnected). Beyond that, I would say you might have a bad NodeMCU (I have come across a few duds in my experience).

@wars - for a processing-intensive application like an ambilight, I would probably recommend the Raspberry Pi over an ESP. The FastLED library on the ESP uses up most of its resources, so there wouldn’t be much left for any image processing that an ambilight needs.

I allready use a 1mF power cap. Its often recommended. My RPi is running 24/7, so no unexpected shutdowns.
A bad MCU is also my suggestion. After a freeze of an animation effect, the colors change too. Mostly to white or yellow. I´m waiting for a new MCU v3, hoping they will work correctly for long time.

Bartus, good day! Love the project as it seems to be in line with what i’m doing with a custom PC build. I have a few questions before I dive into this full bore as it relates to openhab. You reference the MQTT broker, but was not clear if that is a part of the openhab install. I’m also running openhab on a windows machine as the custom build i’m doing I would be developing a UI to control the various led strips. Do you have any recommendations or documentation for openhab as I didn’t read anything on mqtt outside of binding it somehow. I’m very very new to this.

I appreciate any response and patience.

Thanks,

killrmodz

**Update, found your youtube videos. I’ll start there. Thanks!

The mqtt broker, called mosquitto is a seperate software. On openhabian there is a tool for installing it. Running OH2 on Windows is not the best option, but possible. There is also a version of mosquitto for Windows, check out this video:

If you are willing to wait just a little bit, or experiment with the SNAPSHOT, the new MQTT 2.4 binding comes with an internal MQTT broker. To use the MQTT 1.x version binding though, you must run a separate MQTT broker.

Thank you both for the information. I will post my progress as time goes on.

Quick question, before I start diving deep into this, Bartus spoke about running more then one strip. My question is are those strips ran on separate NodeMCU’s or data pins on one NodeMCU? My scenario is calling for the use of 1 Node using almost all of the data pins.

Thanks!

@killRMODZ - I run my strips off different NodeMCUs with one data pin (grouped together by a single MQTT group topic). This works for me, when I have to synchronize multiple nodes (i.e. windows/door frames in a holiday light show). I have not attempted to run multiple strips off multiple data pins yet, but I don’t see any issues that would prevent this - you will have to modify the code to run multiple data pins off the same code/node. As long as you’re OK with the node running identical effects on all the strips, you should be able to easily do this…

So I will not be able to separate the animations to the separate data pins? Why I ask is because of the amount of custom parts that require led strips. Not alot mind you… like 4 for a logo to light up, and 1 due to customizing a vandal switch. If this is not possible, i’m back to square one. LOL

Utilizing fastled’s multiple controller option.

Thanks!

@killRMODZ - I’m not saying it’s impossible, but the code right now only supports a single output. You’d have to copy the routines/variables multiple times to split the MQTT logic, the FastLED control logic and the output logic out between multiple outputs/strips. Certainly doable, but not high on my list of Todo’s right now :wink: (I’m focusing on adding some web-based configuration/control capabilties to the code right now).

Yeah, that’s what I was thinking. Well if it’s not IMPOSSIBLE, i’m going to be super busy… LOL Thanks Bartus!

1 Like

If you do end up taking it on/getting it to work, I will certainly appreciate a PR on Github

Most definitely!!