Hi, I have a pretty simple lambda effect that works for about 2 hours and then the ESP32 crashes and reboots. That only happens when this effect is running.
light:
- platform: esp32_rmt_led_strip
name: Led Strip
id: led_strip
pin: "${ALEDs_1_PIN}"
power_supply: power_supply_v5
num_leds: ${LED_Count} #573
channel_colors: GRB
chipset: WS2812 #SK6812
default_transition_length: 0s
restore_mode: ALWAYS_OFF
internal: false
max_refresh_rate: 100ms
color_correct: [66%, 66%, 61%]
effects:
- addressable_lambda:
name: My Random Effect
update_interval: 250ms
lambda: |-
id(led_strip_display).set_enabled(false);
for (int i = it.size() - 1; i > 1; i--) {
it[i] = Color::random_color();
}
I can’t see how this simple loop would cause the ESP32 to crash. It’s like it’s running out of memory or something like that but I don’t see how.
Any suggestions welcomed.
Thanks, Ant
Yes, It’s a 20amp 5v power supply. Running this effect it’s drawing about 3amps max.
[edit] I’ve tested this without the LED strip even connected and the ESP32 still crashes after about the same time.
There is a display setup to use the same LEDs, which is why it needs the disable in the effect lambda. It switches between the two ‘modes’ using this strip just fine.
I admit I’ve not timed it exactly, but yes about 2 hours with the 250ms update interval. I had that set to 100ms at first and then the crash was within about 45mins. That’s what makes it feel like it’s something to do with the loop.