Help Needed: ESP32 with WS2812B LED Strip – Serial Monitor Errors

Thread Starter

Mayo123

Joined Dec 1, 2024
7
Hi,
I’m trying to connect an ESP32 (link) to a WS2812B LED strip (link), but I’m getting the following errors in the serial monitor:

E (21652) led_strip_rmt: led_strip_rmt_wait_refresh_done(85): disable RMT channel failed
E (22155) rmt: rmt_tx_disable(774): channel can't be disabled in state 1


Setup:
  • Wiring: GND → GND, 5V → VIN, Data → D14 (tried other pins).
  • Power: ESP32 powered via USB.
  • Code: Using FastLED (example code below).

C++:
#include <FastLED.h>

#define DATA_PIN 14
#define NUM_LEDS 6

CRGB leds[NUM_LEDS];

void setup() {
  Serial.begin(115200);
  FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);  // GRB ordering is typical
}

void loop() {
  // Turn the LED on, then pause
  leds[0] = CRGB::Red;
  FastLED.show();
  delay(500);

  // Now turn the LED off, then pause
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(500);
}
The LED strip doesn’t respond, and I can't find solutions online. Any ideas? Thanks!
 

geekoftheweek

Joined Oct 6, 2013
1,429
RMT is a peripheral of the ESP32 designed for infrared remote control transmissions, but can be used for many other things including WS2182 LEDs. I am guessing judging by your errors that there is a problem with the FastLED library. I would suggest using Adafruit's library mentioned in this instructable https://www.instructables.com/ESP8266-controlling-Neopixel-LEDs-using-Arduino-ID simply because I know it works.

Another problem with WS2812 is according to the datasheet a high level on the data pin is 70% of VDD or 3.5V if you are powering the LEDs with 5V. I have had success with 3.3V myself, but that is no guarantee it will work every time.
 

geekoftheweek

Joined Oct 6, 2013
1,429
I also found a page mentioning that a voltage sag in the power supply can cause problems with the RMT peripheral. If you are powering the LEDs from the 5V pin of the ESP32 it may help to try a different USB cord or find another way to power the LEDs.
 

Thread Starter

Mayo123

Joined Dec 1, 2024
7
Thank you for your answers. @geekoftheweek
I have tried the Adafruit_NeoPixel library as well, but it is still not working, and I also don't get any error logs.
I tried connecting it to the 3.3V pin, but it still doesn't work. :(

Here is the code for the Adafruit library:
C++:
#include <Adafruit_NeoPixel.h>

// Pin connected to the DIN of WS2812B
#define LED_PIN 14
#define NUM_LEDS 2

Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();  // Initialize the strip
  strip.show();   // Turn off all LEDs initially
}

void loop() {
  // Turn LEDs red
  for (int i = 0; i < NUM_LEDS; i++) {
    strip.setPixelColor(i, strip.Color(255, 0, 0)); // Red
  }
  strip.show();
  delay(1000);

  // Turn LEDs green
  for (int i = 0; i < NUM_LEDS; i++) {
    strip.setPixelColor(i, strip.Color(0, 255, 0)); // Green
  }
  strip.show();
  delay(1000);
}
 

BobTPH

Joined Jun 5, 2013
11,465
Another problem with WS2812 is according to the datasheet a high level on the data pin is 70% of VDD or 3.5V if you are powering the LEDs with 5V. I have had success with 3.3V myself, but that is no guarantee it will work every time.
Yes, I had this exact problem driving a strip from a 3.3V micro. Worked most of the time, but sometimes failed in 2 of 8 boards. Fixed it for good by adding a high speed CMOS buffer with a lower threshold.
 

geekoftheweek

Joined Oct 6, 2013
1,429
Thank you for your answers. @geekoftheweek
I have tried the Adafruit_NeoPixel library as well, but it is still not working, and I also don't get any error logs.
I tried connecting it to the 3.3V pin, but it still doesn't work.
You are most welcome! I was hoping for some better news though...
The lack of errors now is usually a step in the right direction. Unfortunately the WS2812B also shows a minimum voltage of 3.5V on the power supply in order to work at all. It may be that powering them at 3.3V is not enough for them to work.

In #5 there is mention of a similar problem and needing to add a buffer to the circuit to make them work.
 

BobTPH

Joined Jun 5, 2013
11,465
In #5 there is mention of a similar problem and needing to add a buffer to the circuit to make them work.
That is not the problem if you are powering them both from 3.3V. Using a buffer will not help, the logic levels are fine if the micro and the strip are powered by the same voltage. The problem I described was when controlling a strip powered by 5V with a micro st 3.3V.
 

geekoftheweek

Joined Oct 6, 2013
1,429
That is not the problem if you are powering them both from 3.3V. Using a buffer will not help, the logic levels are fine if the micro and the strip are powered by the same voltage. The problem I described was when controlling a strip powered by 5V with a micro st 3.3V.
Understood. I guess I should have worded my response better to include running them at 5V. I was thinking along the lines of if they weren't working at 3.3V because of the 3.5V minimum power supply listed in the datasheet that your experience would be something to consider for powering them with 5V.
 

Thread Starter

Mayo123

Joined Dec 1, 2024
7
I fixed the issue. It might sound silly, but I had connected the LED strip from the wrong side. I didn’t realize it mattered.

For future readers: make sure to connect the LED strip on the side where the arrows point away from it (not towards it).

Thank you, everyone, for your help! (I actually already ordered the parts you suggested.)
 
Top