NimmLor / esp8266-fastled-iot-webserver

A universal software for all my LED projects, with many awesome features
https://www.thingiverse.com/surrbradl08/designs
GNU General Public License v3.0
366 stars 94 forks source link

Web UI up, but no control on the lamps. #236

Closed pvravi closed 1 year ago

pvravi commented 1 year ago

So here's my setup so far:

D1 board (Generic, Aliexpress) WS2812b LED strip (30 LEDs/m, 5m = 150 LEDs). 5v/3A power supply (also tried with the USB connection).

I am powering the LED strips from the 5V pin on the D1 board itself. Power supply into the D1 board, three wires (5V, GND, D3) going from the D1 board to the LED strip.

I pulled release 4.5 (previously tried ToT, but same issue). Compiled and downloaded the code, and everything downloaded correctly. The Web UI comes up (latest automatically puts it on my network, likely picking up my SSID from the source machine, but 4.5 creates an AP as advertised). I can click and change the UI and everything appears working.

HOWEVER, not a peep out of the LED strip. It does nothing whatsoever.

The LED strips are good (tested with another packaged controller). I have tried with the same board about 2 years ago everything was working then, with the same configuration. However that machine is lost and I have no idea what I had there at that point. Serial port monitoring only shows gibberish. I understand the mislabeling of the D pins, so I have tried with other D pins as well, no result. The LEDs stay strightly off

I have the plain vanilla version. Just WiFi, nothing else. No Alexa/other optional items

Versions: Board: esp8266 2.7.4 FastLED: 3.4.0 WifiManager 2.0.3 Alpha Sketch Data uploader: 0.5 Arduino IDE 1.8.8

Meanwhile, I tried something VERY simple like so:

 #include "FastLED.h"
  #define NUM_LEDS 10
        CRGB leds[NUM_LEDS];
        void setup() { 
          FastLED.addLeds<NEOPIXEL, 4>(leds, NUM_LEDS); 
        }

        void loop() { 
                leds[0] = CRGB::White; FastLED.show(); delay(1000); 
                leds[1] = CRGB::Red; FastLED.show(); delay(1000);
                leds[2] = CRGB::Blue; FastLED.show(); delay(1000);
                leds[3] = CRGB::Green; FastLED.show(); delay(1000);
                leds[4] = CRGB::White; FastLED.show(); delay(1000); 
                leds[5] = CRGB::Red; FastLED.show(); delay(1000);
                leds[6] = CRGB::Blue; FastLED.show(); delay(1000);
                leds[7] = CRGB::Green; FastLED.show(); delay(1000);
                leds[8] = CRGB::White; FastLED.show(); delay(1000); 
                leds[9] = CRGB::Red; FastLED.show(); delay(1000);
        }

And this works totally as expected

And that makes me even more lost as to why the full iot webserver refuses to work. It appears that with the iot webserver, I'm unable to power the LEDs.

What can I do to take this forward?

pvravi commented 1 year ago

Holy cow, it worked! Based on a whim (from the simple example above), changed

define DATA_PIN 4

instead of

define DATA_PIN D4

and it works like magic!

Strange situation. Why does it say D4?