Hi all,
I have a staircase with 16 steps, which I have illuminated with WS2812B (NEOPIXEL) LEDS (24 leds/step). these fade in if motion is detected, and after 20 seconds the fade out (as if following you up or down the staircase).
However, I have some problems with ESP32 RMT LED, namely that the LEDs flicker. This happens at a more or less constant rate and it appears to be a problem with interrupts. Looks like it is linked to Wifi activity. I can reproduce the problem 100% of the time.
Now, before I dive deeper. I have a workaround that is working, proving my hardware setup is working as it should. And I will get into the details on why I want this on ESP32 RMT.
Current (workaround) working solution (snippets that are relevant):
esphome:
includes: common/staircase/myled.h
esp32:
board: wemos_d1_mini32
framework:
type: arduino
light:
- platform: fastled_clockless
chipset: NEOPIXEL #WS2812B
pin: GPIO16
num_leds: 384
name: "Staircase-internal"
id: light1
default_transition_length: 1s
internal: true
myled.h contains:
#define FASTLED_SHOW_CORE 1
Using the arduino platform + FastLED library and a single #define removes all flickering from the setup. Great! Problem fixed! But there are 2 issues here:
- Arduino platform + ESP32 has an issue with mDNS (I have a workaround in place for that too). Solution here is ESP-IDF as that fixes mDNS.
- FastLED compiles, but gives heaps of warnings and it is an older version. I tried 3.5.0 but the LEDs would not turn on. ESP-IDF and FastLED are incompatible.
My gut feeling is that if I move to ESP32 RMT + ESP-IDF that will be more future proof.
Future solution:
esphome:
includes: common/staircase/myled.h
esp32:
board: wemos_d1_mini32
framework:
type: esp-idf # cannot use esp-idf and fastLED
version: recommended
light:
- platform: esp32_rmt_led_strip
rgb_order: GRB
pin: GPIO16
num_leds: 384
rmt_channel: 0
chipset: ws2812
name: "Staircase-internal"
id: light1
default_transition_length: 1s
internal: true
This “works” in the way that it compiles without warnings/errors, mDNS is fixed and the LEDs do actually turn on. But, as mentioned, there is a lot of flickering going on which is very annoying and distracting.
I tried the following options to pin the RMT task to a single core:
// For RMT driver
#define ESP_INTR_FLAG_IRAM 1
#define CONFIG_USE_CORE_AFFINITY = 1
But these settings do not fix my problem. And now, I am completely stuck as I have been searching the internet for a solution, reading through tons of code in the hopes to find the right setting.
Oh and I rewrote my YAML to include the automation of the steps in scripts, reducing the wifi traffic, which helped a bit (about 50% less flickering).
There has to be some way to make this work like the FastLED solution. Who can help me with this problem? I would appreciate it very much!