Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
15.07k stars 3.26k forks source link

Unresponsible API/web UI during receiving DDP #4320

Open DeKaN opened 9 hours ago

DeKaN commented 9 hours ago

What happened?

Sometimes WLED becomes unresponsive (API and web UI don't work) and plays effects with lags after enabling streaming effects from LedFX via DDP. If I stop LedFx streaming, the issue disappears and I can use API (for switching between built-in effects for example). The issue isn't reproducible after rebooting ESP - everything works for at least 2 hours and appears only after stopping and starting again streaming from LedFx.

I had version 0.15.0-b7 and started downgrading WLED step by step. I haven't seen the issue after installing 0.15.0-b4 yesterday

"Melt" effect from LedFx during the issue: https://github.com/user-attachments/assets/42c14a6c-d08a-4a31-8416-1460f1e8933a

To Reproduce Bug

Install 0.15.0-b5 and newer on ESP32, run LedFX 2.0.105 (as Home Assistant addon or as a separate app) start streaming, stop and start again after some time

Expected Behavior

WLED API and web UI should be accessible, and effects via DDP should be played without lags

Install Method

Binary from WLED.me

What version of WLED?

0.15.0-b5 and newer

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

No response

Anything else?

My ESP32. Connected 400 ws2812 LEDs, divided into 2 segments WLED presets

{"0":{},"1":{"win":"T=0","n":"off"},"2":{"on":true,"bri":255,"transition":7,"mainseg":0,"seg":[{"id":0,"start":0,"stop":267,"grp":1,"spc":0,"of":0,"on":true,"frz":false,"bri":255,"cct":127,"set":0,"col":[[0,255,0],[0,0,0],[0,0,0]],"fx":41,"sx":128,"ix":128,"pal":1,"c1":128,"c2":128,"c3":16,"sel":true,"rev":false,"mi":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":0},{"id":1,"start":267,"stop":400,"grp":1,"spc":0,"of":0,"on":true,"frz":false,"bri":255,"cct":127,"set":0,"col":[[0,255,0],[0,0,0],[0,0,0]],"fx":41,"sx":128,"ix":128,"pal":1,"c1":128,"c2":128,"c3":16,"sel":true,"rev":true,"mi":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0}],"n":"default"}}

WLED config

{"rev":[1,0],"vid":2410270,"id":{"mdns":"balcony-wled","name":"balcony wled","inv":"Light","sui":false},"nw":{"espnow":false,"linked_remote":"","ins":[{"ssid":"<REDACTED>","pskl":13,"ip":[0,0,0,0],"gw":[0,0,0,0],"sn":[255,255,255,0]}],"dns":[8,8,8,8]},"ap":{"ssid":"balcony-wled","pskl":8,"chan":1,"hide":0,"behav":0,"ip":[4,3,2,1]},"wifi":{"sleep":false,"phy":false,"txpwr":78},"hw":{"led":{"total":400,"maxpwr":5000,"ledma":0,"cct":false,"cr":false,"ic":false,"cb":0,"fps":42,"rgbwm":255,"ld":true,"ins":[{"start":0,"len":400,"pin":[16],"order":1,"rev":false,"skip":0,"type":22,"ref":false,"rgbwm":0,"freq":0,"maxpwr":5000,"ledma":30}]},"com":[],"btn":{"max":4,"pull":true,"ins":[{"type":0,"pin":[-1],"macros":[0,0,0]},{"type":0,"pin":[-1],"macros":[0,0,0]},{"type":0,"pin":[-1],"macros":[0,0,0]},{"type":0,"pin":[-1],"macros":[0,0,0]}],"tt":32,"mqtt":false},"ir":{"pin":-1,"type":0,"sel":true},"relay":{"pin":-1,"rev":false,"odrain":false},"baud":1152,"if":{"i2c-pin":[-1,-1],"spi-pin":[-1,-1,-1]}},"light":{"scale-bri":100,"pal-mode":0,"aseg":false,"gc":{"bri":1,"col":2.8,"val":2.8},"tr":{"mode":true,"fx":true,"dur":7,"pal":false,"rpc":5,"hrp":true},"nl":{"mode":1,"dur":60,"tbri":0,"macro":0}},"def":{"ps":2,"on":true,"bri":128},"if":{"sync":{"port0":21324,"port1":65506,"espnow":false,"recv":{"bri":true,"col":true,"fx":true,"pal":true,"grp":1,"seg":true,"sb":true},"send":{"en":false,"dir":false,"btn":false,"va":false,"hue":true,"grp":1,"ret":0}},"nodes":{"list":true,"bcast":true},"live":{"en":true,"mso":false,"rlm":true,"port":5568,"mc":false,"dmx":{"uni":1,"seqskip":false,"e131prio":0,"addr":1,"dss":0,"mode":4},"timeout":25,"maxbri":false,"no-gc":true,"offset":0},"va":{"alexa":false,"macros":[0,0],"p":0},"mqtt":{"en":false,"broker":"","port":1883,"user":"","pskl":0,"cid":"WLED-1e29b4","rtn":false,"topics":{"device":"wled/1e29b4","group":"wled/all"}},"hue":{"en":false,"id":1,"iv":25,"recv":{"on":true,"bri":true,"col":true},"ip":[192,168,1,0]},"ntp":{"en":true,"host":"0.wled.pool.ntp.org","tz":0,"offset":14400,"ampm":false,"ln":50.2,"lt":53.19}},"ol":{"clock":0,"cntdwn":false,"min":0,"max":29,"o12pix":0,"o5m":false,"osec":false,"osb":false},"timers":{"cntdwn":{"goal":[20,1,1,0,0,0],"macro":0},"ins":[{"en":1,"hour":255,"min":0,"macro":1,"dow":127},{"en":1,"hour":255,"min":0,"macro":2,"dow":127}]},"ota":{"lock":false,"lock-wifi":false,"pskl":10,"aota":true},"um":{"AudioReactive":{"enabled":false,"add-palettes":false,"analogmic":{"pin":-1},"digitalmic":{"type":1,"pin":[32,15,14,-1]},"config":{"squelch":10,"gain":60,"AGC":0},"frequency":{"scale":3},"dynamics":{"limiter":true,"rise":80,"fall":1400},"sync":{"port":11988,"mode":0}}}}

LedFX config

{
    "create_segments": true,
    "configuration_version": "2.3.3",
    "user_presets": {},
    "melbank_collection": [
        {
            "id": "melbank-0",
            "config": {
                "max_frequency": 350,
                "min_frequency": 20,
                "name": "Melbank 0"
            }
        },
        {
            "id": "melbank-1",
            "config": {
                "max_frequency": 2000,
                "min_frequency": 20,
                "name": "Melbank 1"
            }
        },
        {
            "id": "melbank-2",
            "config": {
                "max_frequency": 15000,
                "min_frequency": 20,
                "name": "Melbank 2"
            }
        }
    ],
    "visualisation_fps": 30,
    "transmission_mode": "compressed",
    "dev_mode": false,
    "scenes": {},
    "devices": [
        {
            "id": "balcony-wled",
            "type": "wled",
            "config": {
                "ip_address": "balcony-wled.local",
                "name": "balcony wled",
                "pixel_count": 400,
                "icon_name": "mdi:balcony",
                "rgbw_led": false,
                "sync_mode": "DDP",
                "refresh_rate": 62,
                "create_segments": false,
                "timeout": 1,
                "center_offset": 0
            }
        }
    ],
    "port_s": 8443,
    "user_gradients": {},
    "visualisation_maxlen": 267,
    "host": "0.0.0.0",
    "global_brightness": 1,
    "virtuals": [
        {
            "id": "balcony-wled",
            "config": {
                "name": "balcony wled",
                "icon_name": "mdi:balcony",
                "rows": 1,
                "max_brightness": 1,
                "mapping": "span",
                "grouping": 1,
                "transition_time": 0.4,
                "transition_mode": "Add",
                "frequency_max": 15000,
                "frequency_min": 20,
                "center_offset": 0,
                "preview_only": false
            },
            "segments": [
                [
                    "balcony-wled",
                    0,
                    399,
                    false
                ]
            ],
            "is_device": "balcony-wled",
            "auto_generated": false
        },
        {
            "id": "balcony-wled-seg-0",
            "config": {
                "name": "balcony wled-Seg-0",
                "icon_name": "mdi:balcony",
                "transition_time": 0,
                "rows": 8,
                "max_brightness": 1,
                "mapping": "span",
                "grouping": 1,
                "transition_mode": "Add",
                "frequency_max": 15000,
                "frequency_min": 20,
                "center_offset": 0,
                "preview_only": false
            },
            "segments": [
                [
                    "balcony-wled",
                    0,
                    266,
                    false
                ]
            ],
            "is_device": false,
            "auto_generated": true,
            "effects": {
                "melt": {
                    "type": "melt",
                    "config": {
                        "blur": 0,
                        "mirror": false,
                        "flip": false,
                        "background_brightness": 1,
                        "background_color": "#000000",
                        "brightness": 1,
                        "gradient_roll": 0,
                        "gradient": "linear-gradient(90deg, rgb(255, 0, 0) 0%, rgb(255, 120, 0) 14%, rgb(255, 200, 0) 28%, rgb(0, 255, 0) 42%, rgb(0, 199, 140) 56%, rgb(0, 0, 255) 70%, rgb(128, 0, 128) 84%, rgb(255, 0, 178) 98%)",
                        "fix_hues": true,
                        "speed": 0.5,
                        "reactivity": 0.5
                    }
                }
            },
            "effect": {
                "type": "melt",
                "config": {
                    "blur": 0,
                    "mirror": false,
                    "flip": false,
                    "background_brightness": 1,
                    "background_color": "#000000",
                    "brightness": 1,
                    "gradient_roll": 0,
                    "gradient": "linear-gradient(90deg, rgb(255, 0, 0) 0%, rgb(255, 120, 0) 14%, rgb(255, 200, 0) 28%, rgb(0, 255, 0) 42%, rgb(0, 199, 140) 56%, rgb(0, 0, 255) 70%, rgb(128, 0, 128) 84%, rgb(255, 0, 178) 98%)",
                    "fix_hues": true,
                    "speed": 0.5,
                    "reactivity": 0.5
                }
            },
            "active": true
        },
        {
            "id": "balcony-wled-seg-1",
            "config": {
                "name": "balcony wled-Seg-1",
                "icon_name": "mdi:balcony",
                "transition_time": 0,
                "rows": 11,
                "max_brightness": 1,
                "mapping": "span",
                "grouping": 1,
                "transition_mode": "Add",
                "frequency_max": 15000,
                "frequency_min": 20,
                "center_offset": 0,
                "preview_only": false
            },
            "segments": [
                [
                    "balcony-wled",
                    267,
                    399,
                    false
                ]
            ],
            "is_device": false,
            "auto_generated": true,
            "effects": {
                "bands": {
                    "type": "bands",
                    "config": {
                        "gradient_roll": 0,
                        "gradient": "linear-gradient(90deg, rgb(255, 0, 0) 0%, rgb(255, 120, 0) 14%, rgb(255, 200, 0) 28%, rgb(0, 255, 0) 42%, rgb(0, 199, 140) 56%, rgb(0, 0, 255) 70%, rgb(128, 0, 128) 84%, rgb(255, 0, 178) 98%)",
                        "align": "right",
                        "blur": 0,
                        "mirror": false,
                        "band_count": 12,
                        "flip": false,
                        "background_brightness": 1,
                        "background_color": "#000000",
                        "brightness": 1
                    }
                },
                "pixels": {
                    "type": "pixels",
                    "config": {
                        "pixel_color": "#ffffff",
                        "blur": 0,
                        "mirror": false,
                        "flip": false,
                        "speed": 20,
                        "step_period": 1,
                        "pixels": 1,
                        "background_brightness": 1,
                        "background_color": "#000000",
                        "build_up": false,
                        "brightness": 1
                    }
                },
                "metro": {
                    "type": "metro",
                    "config": {
                        "steps": 4,
                        "blur": 0,
                        "mirror": false,
                        "cpu_secs": 1,
                        "flip": false,
                        "flash_color": "#ffffff",
                        "pulse_ratio": 0.3,
                        "pulse_period": 1,
                        "background_brightness": 1,
                        "background_color": "#000000",
                        "brightness": 1,
                        "capture": false
                    }
                }
            },
            "effect": {
                "type": "bands",
                "config": {
                    "gradient_roll": 0,
                    "gradient": "linear-gradient(90deg, rgb(255, 0, 0) 0%, rgb(255, 120, 0) 14%, rgb(255, 200, 0) 28%, rgb(0, 255, 0) 42%, rgb(0, 199, 140) 56%, rgb(0, 0, 255) 70%, rgb(128, 0, 128) 84%, rgb(255, 0, 178) 98%)",
                    "align": "right",
                    "blur": 0,
                    "mirror": false,
                    "band_count": 12,
                    "flip": false,
                    "background_brightness": 1,
                    "background_color": "#000000",
                    "brightness": 1
                }
            }
        }
    ],
    "port": 8888,
    "melbanks": {
        "coeffs_type": "matt_mel",
        "max_frequencies": [
            350,
            2000,
            15000
        ],
        "min_frequency": 20,
        "peak_isolation": 0.4,
        "samples": 24
    },
    "user_colors": {},
    "integrations": [],
    "audio": {
        "audio_device": 0,
        "delay_ms": 0,
        "fft_size": 4096,
        "mic_rate": 44100,
        "min_volume": 0.2,
        "onset_method": "hfc",
        "pitch_method": "yinfft",
        "pitch_tolerance": 0.8,
        "sample_rate": 60,
        "tempo_method": "default"
    },
    "ui_brightness_boost": 0,
    "scan_on_startup": false,
    "global_transitions": true,
    "wled_preferences": {
        "dmx_address_start": {
            "setting": 1,
            "user_enabled": false
        },
        "force_max_brightness": {
            "setting": false,
            "user_enabled": false
        },
        "inactivity_timeout": {
            "setting": 1,
            "user_enabled": false
        },
        "realtime_dmx_mode": {
            "setting": "MultiRGB",
            "user_enabled": false
        },
        "realtime_gamma_enabled": {
            "setting": false,
            "user_enabled": false
        },
        "start_universe_setting": {
            "setting": 1,
            "user_enabled": false
        },
        "wled_preferred_mode": {
            "setting": "UDP",
            "user_enabled": false
        }
    },
    "flush_on_deactivate": false
}

I use Home Assistant to start/stop streaming from LedFx and switch built-in effects:

Code of Conduct

softhack007 commented 8 hours ago

Hi,

How many LEDs do you drive from LedFX?

External control via DDP needs a lot of network bandwidth and processing power on esp32 side. So knowing your LEDs setup is important to understand the problem - please post your cfg.json, and (maybe) LedFX effect config.

DeKaN commented 1 hour ago

Hi @softhack007, I have 400 LEDs connected to the board. I've added WLED config and LedFx config.