ESP8266 Controlling Multiple Led Strips

Hey everyone, here's what I got.

ESP8266-12E (actually built by NodeMcu, but the pinout is same as the link)
https://acrobotic.com/acr-00018

LED strip uses WS2811 chip

The code I borrowed from works and partially works with the mods I made. I'll just post the sections I changed, but the complete code is here.

I also attached my code, to run you can download everything from the link above and just replace the original ino file with mine.

What it does
The original code connects to the wifi
Uploads a control page when you point a separate browser to it's IP
Changes the pattern/colors with your input

My changes
The original program is setup for one long LED strip which I tested to verify everything worked.
I then cut the strip into three sections for under cabinet lighting. I want them each on their own pin so I can control the delay between them (by making strips seem longer than they are).
The second one we don't have to answer here cuz I haven't even tested yet is an interrupt for a PIR sensor to change the lighting to white when someone walks near the counter. I hope it will go back to the pattern after a delay (10s for testing)

The issue
The problem is after cutting the strip and connecting, not all three strips light together.
(to the best of my memory from last night)
With all 3 in, only strip 1 works
Unplug strip 3 causes 1 and 2 to work
Unplug strip 2 causes 1 to work and 3 still doesn't work
Unplug strip 1 causes 3 to work and 2 still doesn't work (I think it was that order)
Each strip alone works in their respective pins
Keep in mind the original setup with one long strip did work just fine.

Code changes (with a little on either side to help find it in the original code)
This first section was modified to account for different strips with different lengths

// the very next line is original, but I commented out to add data pins later
//#define DATA_PIN      8     // for Huzzah: Pins w/o special function:  #4, #5, #12, #13, #14; // #16 does not work :(
#define LED_TYPE      WS2811
#define COLOR_ORDER   BRG
#define STRIP_1       6     // seperate strips are numbered and added together to form one long chain
#define STRIP_2       67   // by adding extra leds, you add a delay so you don't jump a gap between strips too fast
#define STRIP_3       27
#define STRIP_12      STRIP_1 + STRIP_2
#define NUM_LEDS      STRIP_1 + STRIP_2 + STRIP_3

#define MILLI_AMPS         10000     // IMPORTANT: set here the max milli-Amps of your power supply 5V 2A = 2000
#define FRAMES_PER_SECOND  120 // here you can control the speed. With the Access Point / Web Server the animations run a bit slower.

Next section was just setting up a pin for an interrupt

 // My own interrupt
 const byte interruptPin = 5;

FastLED.addLeds was originally one line that is now 3. After posting this in here, I see that I use pin 5 twice. Using pins 6,7,8 for data previously had yielded the same results though.

  FastLED.addLeds<LED_TYPE, 5, COLOR_ORDER>(leds, 0, STRIP_1);         // for WS2812 (Neopixel)
  FastLED.addLeds<LED_TYPE, 6, COLOR_ORDER>(leds, STRIP_1, STRIP_2);
  FastLED.addLeds<LED_TYPE, 7, COLOR_ORDER>(leds, STRIP_12, STRIP_3);

Checking for interrupt and calling function

 // My own interrupt
  pinMode(interruptPin, INPUT);
  attachInterrupt(digitalPinToInterrupt(interruptPin), illuminate, RISING);

Interrupt function at the very end of the program

 // My own interrupt
void illuminate()
{
  fill_solid(leds, NUM_LEDS, solidColor);   // turns on the default solid color (white)... full brightness?
  FastLED.show();                           
  delay(10000);                             // waits before going back to the palettes?
}

Disclaimer: I'm a mechanical engineer that didn't pay attention in school when we did the little programming req'd (hindsight on that one sucks). Anyway, I spent the last week and a half going through C++ tutorials and examples to get this far. Writing is going to be bad, but at least I recognize what 1/2 of the program is doing now. :sweat_smile:

esp8266-fastled-webserver.ino (23.5 KB)

Your interrupt service routine (illuminate()) is silly. You can NOT use delay() in an ISR.

Since you can individually address LEDs in a strip, I don't understand the point of having cut them apart. Light LEDs 0 to 9, then delay, then light LEDs 10 to 19, then delay, then light LEDs 20 to 29. Not that you'd use delay(), mind you.

The interrupt is one I'll be working on next, but thanks for the heads up on the delay() issue

The reason for cutting the LED strip is mounting locations.
Strip_1 is between fridge and stove
Strip_2 is between stove and sink
Strip_3 is between sink and the wall

The reason for separating them out on the pins is that FastLED did not seem to have an easy way to update the patterns. With the current setup, I know it at least partially works without having to go through and modify the 8 or so patterns already in the program. With Strip_3 disconnected, strips 1 and 2 waved back and forth as one continuous strip. To add delay without changing the patterns, I just tell it that Strip_1 is longer. This gives the impression that a bead of light travels through the stove and sink unseen and is seen again on the next strip.

If I physically tie them together as one strip, the bead will make an instant jump past the stove and sink. I would have to modify multiple functions, which seems like saying x+x+x+x+x+x as opposed to x*6

Here is the example I'm used for this setup.

Half way down, "One array, many strips"