You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GPIO19 not working as an 2-Wire LED output in 16.0.0 #5670
I configured it as "APA102" on my WLED 0.15.4, and all works fine.
this is my setup:
and here a picture of leds on:
updating to WLED 16.0.0, leds won't power on and won't works.
I tried to fix changing some options or doing a factory reset and re-configuring it.
nothing happend.
I'm using an ESP32 board and WLED 16.0.0 starts on this board, but i don't know what to do to fix this.
Thanks for reporting this. I have not found the reason why this is but GPIO19 does not work for APA102. If you can change your pin, that would be the quick fix for you, all other pins I tried did work so there is something special about GPIO19 - it does work for other LED outputs so this is for APA102 only.
@coderabbitai what is special about GPIO19 that it would not work as a APA102 output? It works neither as a clock nor as a data output but it does work as any other non-clocked LED output. Is this an issue with WLED config or the new tasmota core or NPB?
#!/bin/bash# Fetch the GitHub issue for context
gh issue view 5670 --repo wled/WLED --comments 2>/dev/null | head -200
Length of output: 878
🏁 Script executed:
#!/bin/bash# Check pin_manager.cpp for GPIO19 restrictions and SPI/APA102 handling
rg -n "19|APA102|SPI|VSPI|HSPI|apa102|spi" wled00/pin_manager.cpp 2>/dev/null | head -60
Length of output: 2527
🏁 Script executed:
#!/bin/bash# Check how APA102 SPI pins are selected / initialized in WLED
rg -rn "APA102\|apa102\|SPI_CLK\|VSPI\|HSPI\|NeoPixelBus\|NpbWrapper\|BusManager" --type cpp -C3 | grep -i "gpio\|pin\|19\|MISO\|MOSI\|SCK\|SPI"| head -60
Length of output: 473
🏁 Script executed:
#!/bin/bash# Search for GPIO19 special casing in pin_manager or bus config
rg -rn "gpio.*19\|pin.*19\|19.*gpio\|19.*pin" --type cpp -i | head -40
# Also check isPinOk for GPIO19 handling
ast-grep --pattern 'isPinOk($$$)'2>/dev/null | head -40
Length of output: 853
🏁 Script executed:
#!/bin/bash# Search NpbWrapper / bus_wrapper for SPI APA102 clock/data routing
fd -e h -e cpp "NpbWrapper\|bus_wrapper\|buswrapper" --exec cat {} 2>/dev/null | head -200
Length of output: 413
🏁 Script executed:
#!/bin/bash# Check how SPI is configured for APA102 in BusDigital
rg -n "APA102\|apa102\|SPI\|VSPI\|HSPI\|spi_host" wled00/bus_manager.cpp wled00/bus_manager.h 2>/dev/null | head -60
Length of output: 426
🏁 Script executed:
#!/bin/bash# Find all relevant bus/wrapper files
fd -e h -e cpp -e hpp | xargs grep -l "APA102\|apa102\|NpbWrapper\|NeoPixelBus"2>/dev/null | head -20
Length of output: 384
🏁 Script executed:
#!/bin/bash# Find and show the NpbWrapper header
fd "NpbWrapper" --exec cat {} 2>/dev/null
fd "npb_wrapper\|NpbWrapper\|buswrapper\|BusWrapper" -e h -e hpp | head -5
Length of output: 409
🏁 Script executed:
#!/bin/bash# Broad search for APA102 and SPI in whole repo
rg -rn "APA102\|apa102" --type cpp --type h -C2 | head -100
Length of output: 362
🏁 Script executed:
#!/bin/bash# Search for where hardware SPI is initialized for APA102/SPI LEDs
rg -rn "SPI\.begin\|hspi\|vspi\|VSPI\|HSPI\|spi_host\|SpiMethod\|SpiSpeed\|NeoEsp32\|MISO" -C3 | head -80
Length of output: 427
🏁 Script executed:
#!/bin/bash# Check full isPinOk() function for all ESP32 variants
grep -n "" wled00/pin_manager.cpp | sed -n '190,270p'
Length of output: 5563
🏁 Script executed:
#!/bin/bash# Read bus_wrapper.h - key file for APA102/SPI
cat wled00/bus_wrapper.h | head -300
Length of output: 13715
🏁 Script executed:
#!/bin/bash# Search for SPI APA102 method definitions and MISO/default pin handling
rg -n "APA102\|apa102\|Spi\|SPI\|MISO\|miso\|VSPI\|HSPI" wled00/bus_wrapper.h 2>/dev/null | head -60
Length of output: 428
🏁 Script executed:
#!/bin/bash# Check bus_manager.cpp for SPI/APA102 setup
rg -n "APA102\|apa102\|SPI\|spi\|clock\|CLK\|DATA_PIN\|two_wire\|twoWire\|MISO" wled00/bus_manager.cpp | head -60
Length of output: 413
🏁 Script executed:
#!/bin/bash# Check what NPB SPI methods are used for APA102# Look for NeoEsp32Spi or similar in the full bus_wrapper
grep -n "Spi\|SPI\|MISO\|VSPI\|HSPI\|Apa102\|APA102\|Dot" wled00/bus_wrapper.h | head -80
Length of output: 3413
🏁 Script executed:
#!/bin/bash# Search for how SPI.begin is called and what MISO pin is used
rg -rn "SPI.begin\|begin.*MISO\|begin.*miso\|begin.*19\|MISO.*19\|19.*MISO"| head -30
Length of output: 404
@DedeHai — the culprit is GPIO19 = default VSPI MISO pin on classic ESP32, and the way arduino-esp32's SPIClass::begin() handles it.
The Root Cause
When WLED sets up an APA102 (hardware SPI, non-ethernet build), bus_wrapper.h uses DotStarSpiHzMethod which maps to VSPI. The call chain is:
WLED correctly passes miso = -1 (line 471 of bus_wrapper.h). But in arduino-esp32, when miso == -1, SPIClass::begin() substitutes the compile-time default for VSPI:
So regardless of what pins the user assigns for APA102 DATA/CLK, SPI.begin() permanently configures GPIO19 as a MISO input because that is the VSPI hardware default. This overrides or conflicts with any output role attempted on GPIO19:
User sets GPIO19 as DATA (MOSI): MOSI tries to be OUTPUT, but MISO default also claims GPIO19 as INPUT — conflict, output fails
User sets GPIO19 as CLK (SCK): same story — MISO default grabs GPIO19 as INPUT, SCK output fights it
For non-SPI LED types (WS2812, WS2811, etc.) no SPI.begin() is ever called, so GPIO19 is never touched → works perfectly as an RMT/I2S output pin.
On ethernet builds, DotStarEsp32HspiHzMethod (HSPI) is used instead, and HSPI's default MISO is GPIO12 — so on ethernet builds GPIO12 would be the affected pin, not GPIO19.
Why the Tasmota Core Matters
The Tasmota platform-espressif32 fork (arduino-esp32 2.0.18, IDF 4.4.8) used in WLED v16 may have subtle differences in how SPIClass::begin() performs the default-pin initialization compared to the older standard espressif32 platform — potentially making this behavior more pronounced or harder to work around.
Possible Fixes
Block GPIO19 (and GPIO12 for ethernet) from APA102 clock/data assignment in isPinOk() or at the bus configuration level — add a warning/guard specific to 2-pin SPI bus types.
After beginDotStar(), release the MISO pin with gpio_reset_pin(GPIO_NUM_19) (or GPIO_NUM_12 for HSPI) since APA102 genuinely doesn't need MISO.
Pass a dummy MISO pin instead of -1 — pick a safe unused GPIO and tell the SPI bus "MISO is here" so it doesn't fall back to GPIO19. After init, ignore it.
Option 2 is probably the cleanest fix — it lets arduino-esp32 initialize normally, then explicitly releases the default MISO pin immediately after SPI setup since DotStar/APA102 is a write-only protocol.
🧠 Learnings used
Learnt from: netmindz
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-03-20T15:29:26.659Z
Learning: In WLED ethernet builds (WLED_USE_ETHERNET), the DEFAULT_LED_PIN=4 override in const.h:661 is an intentional safety measure that applies at compile-time regardless of the runtime ethernetType value. It protects against first-boot cfg.json writes saving GPIO16 as the LED pin on ethernet boards where GPIO16 is hard-wired to ethernet clock output (ETH_CLOCK_GPIO16_OUT), which causes crashes. It also protects custom build environments that forget to set DATA_PINS explicitly. This was confirmed by softhack007 in PR `#5432`.
Learnt from: softhack007
Repo: wled/WLED PR: 5496
File: platformio.ini:551-553
Timestamp: 2026-04-11T22:54:04.432Z
Learning: In WLED (usermods/audioreactive/audio_reactive.cpp, ESP32-C3 I2S default pins): On ESP32-C3 DevKit boards, GPIO 7 and GPIO 8 are frequently wired to an onboard WS2812b RGB LED, and GPIO 9 is typically the BOOT button. These practical hardware constraints — combined with GPIO 2/8/9 being strapping pins, GPIO 12-17 being SPI flash reserved, and GPIO 18-19 being USB-JTAG pins — make GPIO 4 (SDPIN), 5 (WSPIN), 6 (CKPIN) the safest default I2S pin choices for AudioReactive on C3. Confirmed by softhack007 and aligned with WLED-MM defaults for C3.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/pin_manager.cpp:235-270
Timestamp: 2026-03-27T17:17:19.350Z
Learning: ESP32-C61 pin restrictions for isPinOk() in WLED (wled00/pin_manager.cpp), confirmed from official Espressif ESP-IDF GPIO docs and C61 datasheet:
- Strapping pins: MTMS, MTDI, GPIO7, GPIO8, GPIO9
- SPI flash/PSRAM reserved: GPIO14–GPIO17 AND GPIO19–GPIO21 (two non-contiguous ranges; GPIO18 is NOT reserved)
(SPICS1=14, SPICS0=15, SPIQ=16, SPIWP=17, SPIHD=19, SPICLK=20, SPID=21)
- USB-JTAG (same as C6): GPIO12 (D-) and GPIO13 (D+); gate under ARDUINO_USB_CDC_ON_BOOT==1 || ARDUINO_USB_DFU_ON_BOOT==1
- C61 is NOT a simple C6 GPIO clone: its SPI flash range is GPIO14-21 (with gap at 18), NOT GPIO24-30 like C6.
- Suggested isPinOk() guards: `if (gpio > 13 && gpio < 18) return false;` and `if (gpio > 18 && gpio < 22) return false;`
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/pin_manager.cpp:235-270
Timestamp: 2026-03-27T17:17:19.350Z
Learning: ESP32-C61 pin restrictions for isPinOk() in WLED (wled00/pin_manager.cpp):
- Strapping pins: GPIO7, GPIO8, GPIO9
- SPI flash reserved (same as C6): GPIO24 ~ GPIO30 (inferred from C6 hardware relationship; no dedicated C61 ESP-IDF GPIO docs page exists yet)
- USB-JTAG (confirmed by ESP32-C61 hardware design guidelines): GPIO12 (D-) and GPIO13 (D+)
- The C61 is a C6-derivative with Zigbee/802.15.4 radio removed; GPIO layout mirrors C6.
- Suggested CONFIG_IDF_TARGET_ESP32C61 branch should block gpio > 23 && gpio < 31 (SPI flash), and gpio == 12 || gpio == 13 under ARDUINO_USB_CDC_ON_BOOT/DFU_ON_BOOT guard.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/json.cpp:1112-1123
Timestamp: 2026-03-29T20:24:16.592Z
Learning: In WLED PR `#5048` (wled00/json.cpp), for ESP32-C5 strapping pins in serializePins():
- GPIO26, GPIO27, GPIO28 are boot-mode control strapping pins (per ESP32-C5 datasheet Section Boot Configurations).
- GPIO25 is a strapping pin for SDIO sampling edge control.
- GPIO7 is a strapping pin for JTAG signal source control.
- GPIO2 is also listed as a strapping pin (per ESP-IDF GPIO docs for C5).
- GPIO3 is NOT a strapping pin on ESP32-C5 — it is a false positive and should be removed from the PIN_CAP_BOOTSTRAP condition.
- GPIO26 IS a valid strapping pin and should be kept in the PIN_CAP_BOOTSTRAP condition.
Learnt from: softhack007
Repo: wled/WLED PR: 5496
File: platformio.ini:551-553
Timestamp: 2026-04-11T22:43:05.015Z
Learning: In WLED (usermods/audioreactive/audio_reactive.cpp, lines ~772-787): The default I2S pin values for AudioReactive are defined using `#ifndef` guards: i2ssdPin=32 (I2S_SDPIN), i2swsPin=15 (I2S_WSPIN), i2sckPin=14 (I2S_CKPIN). These are classic ESP32 GPIO numbers and are out-of-range/invalid on ESP32-C3 (GPIO 0-21 only). The correct fix for C3 is to add `#ifdef` CONFIG_IDF_TARGET_ESP32C3 branches inside each `#ifndef` block in audio_reactive.cpp, NOT to add -D I2S_SDPIN/WSPIN/CKPIN overrides to platformio.ini. Safe C3 defaults are GPIO 4 (SDPIN), 5 (WSPIN), 6 (CKPIN) — avoiding strapping pins GPIO 2/8/9, flash pins GPIO 12-17, and USB-JTAG pins GPIO 18-19.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/set.cpp:551-555
Timestamp: 2026-03-27T21:00:25.902Z
Learning: In WLED PR `#5048` (wled00/set.cpp lines 551-555), the CONFIG_IDF_TARGET_ESP32C5 block that unconditionally forces ntpEnabled = false is an intentional **temporary hotfix** by softhack007 for a known ESP32-C5 crash: `assert failed: udp_new_ip_type udp.c:1278 (Required to lock TCPIP core functionality!)`. Do not flag this as a permanent design issue; the TODO comment in the code already notes it should be resolved properly once the underlying IDF/TCPIP bug on C5 is fixed. A future permanent solution should use a target capability flag rather than overwriting the user's setting.
Learnt from: netmindz
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-03-20T15:29:26.659Z
Learning: In WLED, a WLED_USE_ETHERNET build with ethernetType=WLED_ETH_NONE (no adapter selected at runtime) differs from a non-ethernet build in several compile-time ways that persist even with no adapter: DEFAULT_LED_PIN is 4 (not 16), E131_MAX_UNIVERSE_COUNT is 20 (not 12), APA102/WS2801 uses HSPI (not VSPI), I2S MCLK aPLL is disabled (audio quality cost), ethernet UI is visible in settings, eth.type=0 is written to cfg.json, and net_debug.cpp uses ETH.hostByName() (which will fail since ETH is never initialized). The runtime-gated behaviors (pin reservation, ETH.begin(), WiFi disconnect, MAC/IP preference) are correctly skipped when ethernetType==WLED_ETH_NONE.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-04-13T20:46:14.014Z
Learning: In WLED (wled00/wled.cpp), on ESP32 with arduino-esp32 v2.0.x (IDF V4 branch), calling `pinMode(hardwareRX, INPUT_PULLDOWN)` has an unexpected side effect: it routes the RX pin through the GPIO matrix instead of keeping it on UART0's IOMUX path, effectively detaching the pin from the UART unit and causing serial receive to stop working (issue `#5501`). The correct way to enable a pull-down on the hardware RX pin without disrupting the UART mapping is to call `gpio_pulldown_en((gpio_num_t)hardwareRX)` directly from the ESP-IDF GPIO driver (`driver/gpio.h`). This is the fix applied in PR `#5503`. Do NOT use `pinMode()` to set pull resistors on UART RX/TX pins on ESP32.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/json.cpp:1112-1123
Timestamp: 2026-03-29T20:24:16.592Z
Learning: In WLED PR `#5048` (wled00/json.cpp serializePins()), ESP32-C5 strapping pins are:
- MTMS (GPIO number to be confirmed per silicon rev), MTDI=GPIO3, GPIO7, GPIO25, GPIO26, GPIO27, GPIO28.
- GPIO3 (=MTDI) is a strapping pin for SDIO sampling/driving clock edge configuration (together with GPIO25).
- GPIO26 is a strapping pin for chip boot mode selection (together with GPIO27 and GPIO28).
- The code flagging gpio==2, gpio==3, gpio==7, gpio==25, gpio==26 as PIN_CAP_BOOTSTRAP (plus gpio==27 and gpio==28 with PIN_CAP_BOOT) is CORRECT for ESP32-C5.
- Do NOT suggest removing GPIO3 or GPIO26 from the C5 strapping-pin block — both are legitimate strapping pins per the ESP32-C5 datasheet and DevKitC-1 user guide.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-18T22:06:57.910Z
Learning: In WLED issue `#5619`, analysis of the user's presets.json confirmed no playlists, timers, or scheduled entries exist. Within WLED itself, there is no purely automatic mechanism for a Node B/C/D to spontaneously emit bri>0 notifications after receiving and applying bri=0 from Node A via sync. WLED has no periodic heartbeat broadcast — notify() is only called on explicit state changes. The relay-stays-on symptom requires an external trigger: user interaction with another device, a home automation hub reacting to WLED state changes, or (as a background amplifier) UDP packet loss leaving some nodes at bri=255.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/cfg.cpp:673-673
Timestamp: 2026-03-27T21:17:51.985Z
Learning: In WLED PR `#5048`, the NTP/UDP crash on ESP32-C5 (pioarduino IDF 5.5.x): CONFIG_LWIP_TCPIP_CORE_LOCKING defaults to n (disabled) in arduino-esp32/pioarduino, while CONFIG_LWIP_CHECK_THREAD_SAFETY=y is what actually causes the "Required to lock TCPIP core functionality!" assertion. LOCK_TCPIP_CORE() / UNLOCK_TCPIP_CORE() macros are only functional when CONFIG_LWIP_TCPIP_CORE_LOCKING=y; using them without enabling that config has no effect. The correct fix without sdkconfig changes is to use tcpip_callback() to schedule ntpUdp.begin() (and other raw lwIP API calls) on the TCPIP thread, which works regardless of the locking mode setting. The tasmota core (IDF 5.3.x, used for C6) likely has CONFIG_LWIP_CHECK_THREAD_SAFETY=n, which is why the same violation does not crash on C6.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-05T14:48:30.841Z
Learning: In WLED v0.15.x, ESP32-C3/S3 environments used the standard Espressif `espressif32` PlatformIO platform with arduino-esp32 2.0.9, which had WPA3-SAE (`CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE`) enabled by default. In WLED v16, all ESP32 variants migrated to the Tasmota `platform-espressif32` fork (2024.06.00, arduino-esp32 2.0.18, IDF 4.4.8), which explicitly disables WPA3-SAE in its `defconfig.common`. This means WLED v16 standard firmware binaries do not support WPA3 connections, breaking users on WPA3-only or WPA3/PMF-required networks. The migration was necessary to fit binaries on 4MB flash boards.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/cfg.cpp:673-673
Timestamp: 2026-03-27T21:17:51.985Z
Learning: In WLED PR `#5048` (wled00/cfg.cpp), the NTP crash on ESP32-C5 (pioarduino + IDF 5.5.x) is caused by both CONFIG_LWIP_TCPIP_CORE_LOCKING=y AND CONFIG_LWIP_CHECK_THREAD_SAFETY=y being enabled by default in the pioarduino/arduino-esp32 IDF 5.x sdkconfig. The tasmota core (IDF 5.3.x, used for C6) likely has CONFIG_LWIP_CHECK_THREAD_SAFETY=n, which is why the same violation does not crash on C6. Since pioarduino already has TCPIP_CORE_LOCKING enabled, wrapping ntpUdp.begin() (and any other raw lwIP API call) with LOCK_TCPIP_CORE()/UNLOCK_TCPIP_CORE() from lwip/tcpip.h is directly applicable without sdkconfig changes in platformio.ini.
@coderabbitai what is special about GPIO19 that it would not work as a APA102 output? It works neither as a clock nor as a data output but it does work as any other non-clocked LED output. Is this an issue with WLED config or the new tasmota core or NPB?
So, i think that i neeed to wait a 16.0.X to have this problem fixed?
@sagitt — you don't necessarily have to wait. The immediate workaround is simply to avoid GPIO19 for APA102 pins, which you can do right now without any firmware change:
Pick any other available GPIO for your APA102 DATA and CLK pins (e.g., GPIO23/MOSI and GPIO18/SCK are the other natural VSPI pins and work fine for output).
As DedeHai confirmed, all other pins work correctly — the problem is exclusive to GPIO19 when used with a hardware-SPI LED type (APA102, LPD8806, etc.).
A proper firmware fix (e.g., calling gpio_reset_pin(GPIO_NUM_19) after SPI init to release the spuriously-claimed MISO pin) would need to be merged into WLED and shipped in a future release. Until then, simply reassign your APA102 to any non-19 GPIO and it will work immediately.
🐇 (╥_╥)
🧠 Learnings used
Learnt from: softhack007
Repo: wled/WLED PR: 5496
File: platformio.ini:551-553
Timestamp: 2026-04-11T22:43:05.015Z
Learning: In WLED (usermods/audioreactive/audio_reactive.cpp, lines ~772-787): The default I2S pin values for AudioReactive are defined using `#ifndef` guards: i2ssdPin=32 (I2S_SDPIN), i2swsPin=15 (I2S_WSPIN), i2sckPin=14 (I2S_CKPIN). These are classic ESP32 GPIO numbers and are out-of-range/invalid on ESP32-C3 (GPIO 0-21 only). The correct fix for C3 is to add `#ifdef` CONFIG_IDF_TARGET_ESP32C3 branches inside each `#ifndef` block in audio_reactive.cpp, NOT to add -D I2S_SDPIN/WSPIN/CKPIN overrides to platformio.ini. Safe C3 defaults are GPIO 4 (SDPIN), 5 (WSPIN), 6 (CKPIN) — avoiding strapping pins GPIO 2/8/9, flash pins GPIO 12-17, and USB-JTAG pins GPIO 18-19.
Learnt from: netmindz
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-03-20T15:29:26.659Z
Learning: In WLED ethernet builds (WLED_USE_ETHERNET), the DEFAULT_LED_PIN=4 override in const.h:661 is an intentional safety measure that applies at compile-time regardless of the runtime ethernetType value. It protects against first-boot cfg.json writes saving GPIO16 as the LED pin on ethernet boards where GPIO16 is hard-wired to ethernet clock output (ETH_CLOCK_GPIO16_OUT), which causes crashes. It also protects custom build environments that forget to set DATA_PINS explicitly. This was confirmed by softhack007 in PR `#5432`.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/cfg.cpp:673-673
Timestamp: 2026-03-27T21:17:51.985Z
Learning: In WLED PR `#5048` (wled00/cfg.cpp), the NTP crash on ESP32-C5 (pioarduino + IDF 5.5.x) is caused by both CONFIG_LWIP_TCPIP_CORE_LOCKING=y AND CONFIG_LWIP_CHECK_THREAD_SAFETY=y being enabled by default in the pioarduino/arduino-esp32 IDF 5.x sdkconfig. The tasmota core (IDF 5.3.x, used for C6) likely has CONFIG_LWIP_CHECK_THREAD_SAFETY=n, which is why the same violation does not crash on C6. Since pioarduino already has TCPIP_CORE_LOCKING enabled, wrapping ntpUdp.begin() (and any other raw lwIP API call) with LOCK_TCPIP_CORE()/UNLOCK_TCPIP_CORE() from lwip/tcpip.h is directly applicable without sdkconfig changes in platformio.ini.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/set.cpp:551-555
Timestamp: 2026-03-27T21:00:25.902Z
Learning: In WLED PR `#5048` (wled00/set.cpp lines 551-555), the CONFIG_IDF_TARGET_ESP32C5 block that unconditionally forces ntpEnabled = false is an intentional **temporary hotfix** by softhack007 for a known ESP32-C5 crash: `assert failed: udp_new_ip_type udp.c:1278 (Required to lock TCPIP core functionality!)`. Do not flag this as a permanent design issue; the TODO comment in the code already notes it should be resolved properly once the underlying IDF/TCPIP bug on C5 is fixed. A future permanent solution should use a target capability flag rather than overwriting the user's setting.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/cfg.cpp:673-673
Timestamp: 2026-03-27T21:17:51.985Z
Learning: In WLED PR `#5048`, the NTP/UDP crash on ESP32-C5 (pioarduino IDF 5.5.x): CONFIG_LWIP_TCPIP_CORE_LOCKING defaults to n (disabled) in arduino-esp32/pioarduino, while CONFIG_LWIP_CHECK_THREAD_SAFETY=y is what actually causes the "Required to lock TCPIP core functionality!" assertion. LOCK_TCPIP_CORE() / UNLOCK_TCPIP_CORE() macros are only functional when CONFIG_LWIP_TCPIP_CORE_LOCKING=y; using them without enabling that config has no effect. The correct fix without sdkconfig changes is to use tcpip_callback() to schedule ntpUdp.begin() (and other raw lwIP API calls) on the TCPIP thread, which works regardless of the locking mode setting. The tasmota core (IDF 5.3.x, used for C6) likely has CONFIG_LWIP_CHECK_THREAD_SAFETY=n, which is why the same violation does not crash on C6.
Learnt from: softhack007
Repo: wled/WLED PR: 5496
File: platformio.ini:551-553
Timestamp: 2026-04-11T22:54:04.432Z
Learning: In WLED (usermods/audioreactive/audio_reactive.cpp, ESP32-C3 I2S default pins): On ESP32-C3 DevKit boards, GPIO 7 and GPIO 8 are frequently wired to an onboard WS2812b RGB LED, and GPIO 9 is typically the BOOT button. These practical hardware constraints — combined with GPIO 2/8/9 being strapping pins, GPIO 12-17 being SPI flash reserved, and GPIO 18-19 being USB-JTAG pins — make GPIO 4 (SDPIN), 5 (WSPIN), 6 (CKPIN) the safest default I2S pin choices for AudioReactive on C3. Confirmed by softhack007 and aligned with WLED-MM defaults for C3.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-04-12T19:41:50.655Z
Learning: In WLED bus_wrapper.h, LPD6803 (B_HS_LPO_3) and LPD8806 (B_HS_LPD_3) are missing the WLED_USE_ETHERNET guard that redirects from VSPI to HSPI. APA102 and WS2801 already have this guard. The fix is to add `#ifdef` WLED_USE_ETHERNET blocks using Lpd6803MethodBase<TwoWireHspiImple<SpiSpeedHz>> and Lpd8806MethodBase<TwoWireHspiImple<SpiSpeedHz>> respectively, mirroring the WS2801 pattern. TwoWireHspiImple.h is already included via the WS2801 ethernet path so no new `#include` is needed. This is the likely root cause of issue `#5152` where LPD6803 breaks Ethernet on ESP32.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-04-13T20:46:14.014Z
Learning: In WLED (wled00/wled.cpp), on ESP32 with arduino-esp32 v2.0.x (IDF V4 branch), calling `pinMode(hardwareRX, INPUT_PULLDOWN)` has an unexpected side effect: it routes the RX pin through the GPIO matrix instead of keeping it on UART0's IOMUX path, effectively detaching the pin from the UART unit and causing serial receive to stop working (issue `#5501`). The correct way to enable a pull-down on the hardware RX pin without disrupting the UART mapping is to call `gpio_pulldown_en((gpio_num_t)hardwareRX)` directly from the ESP-IDF GPIO driver (`driver/gpio.h`). This is the fix applied in PR `#5503`. Do NOT use `pinMode()` to set pull resistors on UART RX/TX pins on ESP32.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/pin_manager.cpp:235-270
Timestamp: 2026-03-27T17:17:19.350Z
Learning: ESP32-C61 pin restrictions for isPinOk() in WLED (wled00/pin_manager.cpp), confirmed from official Espressif ESP-IDF GPIO docs and C61 datasheet:
- Strapping pins: MTMS, MTDI, GPIO7, GPIO8, GPIO9
- SPI flash/PSRAM reserved: GPIO14–GPIO17 AND GPIO19–GPIO21 (two non-contiguous ranges; GPIO18 is NOT reserved)
(SPICS1=14, SPICS0=15, SPIQ=16, SPIWP=17, SPIHD=19, SPICLK=20, SPID=21)
- USB-JTAG (same as C6): GPIO12 (D-) and GPIO13 (D+); gate under ARDUINO_USB_CDC_ON_BOOT==1 || ARDUINO_USB_DFU_ON_BOOT==1
- C61 is NOT a simple C6 GPIO clone: its SPI flash range is GPIO14-21 (with gap at 18), NOT GPIO24-30 like C6.
- Suggested isPinOk() guards: `if (gpio > 13 && gpio < 18) return false;` and `if (gpio > 18 && gpio < 22) return false;`
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/json.cpp:1112-1123
Timestamp: 2026-03-29T20:24:16.592Z
Learning: In WLED PR `#5048` (wled00/json.cpp serializePins()), ESP32-C5 strapping pins are:
- MTMS (GPIO number to be confirmed per silicon rev), MTDI=GPIO3, GPIO7, GPIO25, GPIO26, GPIO27, GPIO28.
- GPIO3 (=MTDI) is a strapping pin for SDIO sampling/driving clock edge configuration (together with GPIO25).
- GPIO26 is a strapping pin for chip boot mode selection (together with GPIO27 and GPIO28).
- The code flagging gpio==2, gpio==3, gpio==7, gpio==25, gpio==26 as PIN_CAP_BOOTSTRAP (plus gpio==27 and gpio==28 with PIN_CAP_BOOT) is CORRECT for ESP32-C5.
- Do NOT suggest removing GPIO3 or GPIO26 from the C5 strapping-pin block — both are legitimate strapping pins per the ESP32-C5 datasheet and DevKitC-1 user guide.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-05T14:48:30.841Z
Learning: In WLED v0.15.x, ESP32-C3/S3 environments used the standard Espressif `espressif32` PlatformIO platform with arduino-esp32 2.0.9, which had WPA3-SAE (`CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE`) enabled by default. In WLED v16, all ESP32 variants migrated to the Tasmota `platform-espressif32` fork (2024.06.00, arduino-esp32 2.0.18, IDF 4.4.8), which explicitly disables WPA3-SAE in its `defconfig.common`. This means WLED v16 standard firmware binaries do not support WPA3 connections, breaking users on WPA3-only or WPA3/PMF-required networks. The migration was necessary to fit binaries on 4MB flash boards.
Learnt from: softhack007
Repo: wled/WLED PR: 5457
File: usermods/zigbee_rgb_light/usermod_zigbee_rgb_light.h:0-0
Timestamp: 2026-03-31T17:31:01.023Z
Learning: In WLED PR `#5457` (zigbee_rgb_light usermod): The WLED_MAX_DIGITAL_CHANNELS=0 build flag used in the esp32c6_zigbee environment is a temporary workaround for rmt_tx_wait_all_done() timeout spam when the Zigbee/802.15.4 stack is active. The root cause is under investigation and is likely related to Zigbee light-sleep (CONFIG_PM_ENABLE) disrupting RMT's internal time base, or ISR latency due to cache-disable during flash ops — NOT the 802.15.4 radio "sharing" the RMT peripheral (they are separate hardware). Because a proper fix (rmt_enable()/rmt_disable() PM-lock wrapping, allow_pd=0, CONFIG_RMT_TX_ISR_CACHE_SAFE) may eliminate the need to disable digital channels entirely, do NOT add a compile-time `#error` guard requiring WLED_MAX_DIGITAL_CHANNELS=0; doing so would prematurely bake in a constraint that may be lifted once the investigation concludes.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/pin_manager.cpp:235-270
Timestamp: 2026-03-27T17:17:19.350Z
Learning: ESP32-C61 pin restrictions for isPinOk() in WLED (wled00/pin_manager.cpp):
- Strapping pins: GPIO7, GPIO8, GPIO9
- SPI flash reserved (same as C6): GPIO24 ~ GPIO30 (inferred from C6 hardware relationship; no dedicated C61 ESP-IDF GPIO docs page exists yet)
- USB-JTAG (confirmed by ESP32-C61 hardware design guidelines): GPIO12 (D-) and GPIO13 (D+)
- The C61 is a C6-derivative with Zigbee/802.15.4 radio removed; GPIO layout mirrors C6.
- Suggested CONFIG_IDF_TARGET_ESP32C61 branch should block gpio > 23 && gpio < 31 (SPI flash), and gpio == 12 || gpio == 13 under ARDUINO_USB_CDC_ON_BOOT/DFU_ON_BOOT guard.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/wled_metadata.cpp:6-8
Timestamp: 2026-03-27T21:02:06.756Z
Learning: In WLED PR `#5048` (pio-scripts/set_metadata.py + wled00/wled_metadata.cpp): The hardcoded `#define WLED_VERSION 16.0.0-alphaV5` in `wled_metadata.cpp` is an intentional **temporary hotfix** by softhack007. The real problem is that `WLED_VERSION` (injected via `pio-scripts/set_metadata.py` as a CPPDEFINE) is not reaching `wled_metadata.cpp` at compile time. The set_metadata.py change in this PR switched from `env.Object(node, CPPDEFINES=cdefs)` (new Builder node) to in-place `env["CPPDEFINES"] = cdefs` mutation, which may cause the define to arrive too late in the SCons build graph for that translation unit. The TODO comment in the code already marks this for removal. Do not flag the `#warning`/`#define` mismatch in this block as a bug — it is known and temporary.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-18T21:46:16.718Z
Learning: In WLED issue `#5619`, the root cause of relay not turning off after HyperHDR stops was confirmed: the HyperHDR-controlled WLED node (Node A) correctly broadcasts bri=0 after exitRealtime(). However, with recv.bri=true and other WLED nodes on the same sync group that are independently ON (bri>0), any state change on those nodes after the 1-second notificationSentTime suppression window overwrites Node A's bri to non-zero, re-enabling the relay. The OS socket buffer stale-packet risk is NOT credible when WLED runs at 30fps realtime (fast loop drains the buffer continuously). The fix is to put the HyperHDR-controlled WLED in a separate sync group or disable recv.bri on it.
Learnt from: blazoncek
Repo: wled/WLED PR: 5140
File: wled00/data/settings_time.htm:66-76
Timestamp: 2025-12-01T07:01:16.949Z
Learning: In WLED PR `#5134`, the fix for macros being initialized with the enable bit set only handles new configurations, not existing ones. If there is a bug in timer/macro handling code (e.g., in settings_time.htm), it must be fixed to work correctly for existing configurations as well.
@sagitt can you test if the 0.15.x V4 build is also broken? I have a strong suspicion that this is something espressif changed in their core version.
I have confirmed that if I comment out the 3 lines in the SPI core function that unconditionally make the MISO pin an input it works again. GPIO19 is hardcoded as MISO in V4 unless it is assigned to another pin as correctly stated by the rabbit.
@sagitt can you test if the 0.15.x V4 build is also broken? I have a strong suspicion that this is something espressif changed in their core version.
I have confirmed that if I comment out the 3 lines in the SPI core function that unconditionally make the MISO pin an input it works again. GPIO19 is hardcoded as MISO in V4 unless it is assigned to another pin as correctly stated by the rabbit.
@coderabbitai in your suggested fix to gpio_reset_pin(GPIO_NUM_19) - won't that just fully disconnect GPIO19 and not route it as the SCK or MOSI pin? Does it not need to be reattached?
@DedeHai — yes, your concern is exactly right. gpio_reset_pin(GPIO_NUM_19) resets the pin completely — it tears down all GPIO matrix routing on that pin and returns it to a default floating input. So if the user has assigned GPIO19 as MOSI (data) or SCK (clock), calling gpio_reset_pin afterward would silently break that connection too.
The cleaner fix is to leave GPIO19 entirely alone and instead redirect the SPI peripheral's MISO input signal to an internal constant without involving any real GPIO pin at all. ESP-IDF's gpio_matrix_in() supports this:
`#include` "soc/gpio_sig_map.h"// After SPI.begin() for VSPI (non-ethernet APA102):// Detach VSPI MISO from whatever pin it was routed to (GPIO19 by default),// tying it internally high. Does NOT touch GPIO19's output routing.gpio_matrix_in(GPIO_FUNC_IN_HIGH, VSPIQ_IN_IDX, false);
// For HSPI (ethernet builds), use:gpio_matrix_in(GPIO_FUNC_IN_HIGH, HSPIQ_IN_IDX, false);
GPIO_FUNC_IN_HIGH (value 0x38) is an ESP-IDF pseudo-pin constant meaning "always read as 1" — it overrides the IOMUX/matrix routing for that peripheral input signal without touching the actual GPIO pin state or its output connection. This way:
GPIO19's direction, pull config, and GPIO matrix output routing (MOSI/SCK) are completely undisturbed.
The SPI peripheral's MISO input is satisfied with a harmless constant, which is fine since APA102/DotStar is write-only and never uses MISO.
The only caveat is that gpio_matrix_in is an ESP-IDF HAL call, so it's fine in WLED's ESP32-specific code paths but needs an appropriate #ifdef CONFIG_IDF_TARGET_ESP32 (or similar) guard if the fix lives in shared code.
🐇 (°ロ°)
🧠 Learnings used
Learnt from: softhack007
Repo: wled/WLED PR: 5496
File: platformio.ini:551-553
Timestamp: 2026-04-11T22:43:05.015Z
Learning: In WLED (usermods/audioreactive/audio_reactive.cpp, lines ~772-787): The default I2S pin values for AudioReactive are defined using `#ifndef` guards: i2ssdPin=32 (I2S_SDPIN), i2swsPin=15 (I2S_WSPIN), i2sckPin=14 (I2S_CKPIN). These are classic ESP32 GPIO numbers and are out-of-range/invalid on ESP32-C3 (GPIO 0-21 only). The correct fix for C3 is to add `#ifdef` CONFIG_IDF_TARGET_ESP32C3 branches inside each `#ifndef` block in audio_reactive.cpp, NOT to add -D I2S_SDPIN/WSPIN/CKPIN overrides to platformio.ini. Safe C3 defaults are GPIO 4 (SDPIN), 5 (WSPIN), 6 (CKPIN) — avoiding strapping pins GPIO 2/8/9, flash pins GPIO 12-17, and USB-JTAG pins GPIO 18-19.
Learnt from: netmindz
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-03-20T15:29:26.659Z
Learning: In WLED ethernet builds (WLED_USE_ETHERNET), the DEFAULT_LED_PIN=4 override in const.h:661 is an intentional safety measure that applies at compile-time regardless of the runtime ethernetType value. It protects against first-boot cfg.json writes saving GPIO16 as the LED pin on ethernet boards where GPIO16 is hard-wired to ethernet clock output (ETH_CLOCK_GPIO16_OUT), which causes crashes. It also protects custom build environments that forget to set DATA_PINS explicitly. This was confirmed by softhack007 in PR `#5432`.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/cfg.cpp:673-673
Timestamp: 2026-03-27T21:17:51.985Z
Learning: In WLED PR `#5048` (wled00/cfg.cpp), the NTP crash on ESP32-C5 (pioarduino + IDF 5.5.x) is caused by both CONFIG_LWIP_TCPIP_CORE_LOCKING=y AND CONFIG_LWIP_CHECK_THREAD_SAFETY=y being enabled by default in the pioarduino/arduino-esp32 IDF 5.x sdkconfig. The tasmota core (IDF 5.3.x, used for C6) likely has CONFIG_LWIP_CHECK_THREAD_SAFETY=n, which is why the same violation does not crash on C6. Since pioarduino already has TCPIP_CORE_LOCKING enabled, wrapping ntpUdp.begin() (and any other raw lwIP API call) with LOCK_TCPIP_CORE()/UNLOCK_TCPIP_CORE() from lwip/tcpip.h is directly applicable without sdkconfig changes in platformio.ini.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/set.cpp:551-555
Timestamp: 2026-03-27T21:00:25.902Z
Learning: In WLED PR `#5048` (wled00/set.cpp lines 551-555), the CONFIG_IDF_TARGET_ESP32C5 block that unconditionally forces ntpEnabled = false is an intentional **temporary hotfix** by softhack007 for a known ESP32-C5 crash: `assert failed: udp_new_ip_type udp.c:1278 (Required to lock TCPIP core functionality!)`. Do not flag this as a permanent design issue; the TODO comment in the code already notes it should be resolved properly once the underlying IDF/TCPIP bug on C5 is fixed. A future permanent solution should use a target capability flag rather than overwriting the user's setting.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/cfg.cpp:673-673
Timestamp: 2026-03-27T21:17:51.985Z
Learning: In WLED PR `#5048`, the NTP/UDP crash on ESP32-C5 (pioarduino IDF 5.5.x): CONFIG_LWIP_TCPIP_CORE_LOCKING defaults to n (disabled) in arduino-esp32/pioarduino, while CONFIG_LWIP_CHECK_THREAD_SAFETY=y is what actually causes the "Required to lock TCPIP core functionality!" assertion. LOCK_TCPIP_CORE() / UNLOCK_TCPIP_CORE() macros are only functional when CONFIG_LWIP_TCPIP_CORE_LOCKING=y; using them without enabling that config has no effect. The correct fix without sdkconfig changes is to use tcpip_callback() to schedule ntpUdp.begin() (and other raw lwIP API calls) on the TCPIP thread, which works regardless of the locking mode setting. The tasmota core (IDF 5.3.x, used for C6) likely has CONFIG_LWIP_CHECK_THREAD_SAFETY=n, which is why the same violation does not crash on C6.
Learnt from: softhack007
Repo: wled/WLED PR: 5496
File: platformio.ini:551-553
Timestamp: 2026-04-11T22:54:04.432Z
Learning: In WLED (usermods/audioreactive/audio_reactive.cpp, ESP32-C3 I2S default pins): On ESP32-C3 DevKit boards, GPIO 7 and GPIO 8 are frequently wired to an onboard WS2812b RGB LED, and GPIO 9 is typically the BOOT button. These practical hardware constraints — combined with GPIO 2/8/9 being strapping pins, GPIO 12-17 being SPI flash reserved, and GPIO 18-19 being USB-JTAG pins — make GPIO 4 (SDPIN), 5 (WSPIN), 6 (CKPIN) the safest default I2S pin choices for AudioReactive on C3. Confirmed by softhack007 and aligned with WLED-MM defaults for C3.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-04-12T19:41:50.655Z
Learning: In WLED bus_wrapper.h, LPD6803 (B_HS_LPO_3) and LPD8806 (B_HS_LPD_3) are missing the WLED_USE_ETHERNET guard that redirects from VSPI to HSPI. APA102 and WS2801 already have this guard. The fix is to add `#ifdef` WLED_USE_ETHERNET blocks using Lpd6803MethodBase<TwoWireHspiImple<SpiSpeedHz>> and Lpd8806MethodBase<TwoWireHspiImple<SpiSpeedHz>> respectively, mirroring the WS2801 pattern. TwoWireHspiImple.h is already included via the WS2801 ethernet path so no new `#include` is needed. This is the likely root cause of issue `#5152` where LPD6803 breaks Ethernet on ESP32.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-04-13T20:46:14.014Z
Learning: In WLED (wled00/wled.cpp), on ESP32 with arduino-esp32 v2.0.x (IDF V4 branch), calling `pinMode(hardwareRX, INPUT_PULLDOWN)` has an unexpected side effect: it routes the RX pin through the GPIO matrix instead of keeping it on UART0's IOMUX path, effectively detaching the pin from the UART unit and causing serial receive to stop working (issue `#5501`). The correct way to enable a pull-down on the hardware RX pin without disrupting the UART mapping is to call `gpio_pulldown_en((gpio_num_t)hardwareRX)` directly from the ESP-IDF GPIO driver (`driver/gpio.h`). This is the fix applied in PR `#5503`. Do NOT use `pinMode()` to set pull resistors on UART RX/TX pins on ESP32.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/pin_manager.cpp:235-270
Timestamp: 2026-03-27T17:17:19.350Z
Learning: ESP32-C61 pin restrictions for isPinOk() in WLED (wled00/pin_manager.cpp), confirmed from official Espressif ESP-IDF GPIO docs and C61 datasheet:
- Strapping pins: MTMS, MTDI, GPIO7, GPIO8, GPIO9
- SPI flash/PSRAM reserved: GPIO14–GPIO17 AND GPIO19–GPIO21 (two non-contiguous ranges; GPIO18 is NOT reserved)
(SPICS1=14, SPICS0=15, SPIQ=16, SPIWP=17, SPIHD=19, SPICLK=20, SPID=21)
- USB-JTAG (same as C6): GPIO12 (D-) and GPIO13 (D+); gate under ARDUINO_USB_CDC_ON_BOOT==1 || ARDUINO_USB_DFU_ON_BOOT==1
- C61 is NOT a simple C6 GPIO clone: its SPI flash range is GPIO14-21 (with gap at 18), NOT GPIO24-30 like C6.
- Suggested isPinOk() guards: `if (gpio > 13 && gpio < 18) return false;` and `if (gpio > 18 && gpio < 22) return false;`
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/json.cpp:1112-1123
Timestamp: 2026-03-29T20:24:16.592Z
Learning: In WLED PR `#5048` (wled00/json.cpp serializePins()), ESP32-C5 strapping pins are:
- MTMS (GPIO number to be confirmed per silicon rev), MTDI=GPIO3, GPIO7, GPIO25, GPIO26, GPIO27, GPIO28.
- GPIO3 (=MTDI) is a strapping pin for SDIO sampling/driving clock edge configuration (together with GPIO25).
- GPIO26 is a strapping pin for chip boot mode selection (together with GPIO27 and GPIO28).
- The code flagging gpio==2, gpio==3, gpio==7, gpio==25, gpio==26 as PIN_CAP_BOOTSTRAP (plus gpio==27 and gpio==28 with PIN_CAP_BOOT) is CORRECT for ESP32-C5.
- Do NOT suggest removing GPIO3 or GPIO26 from the C5 strapping-pin block — both are legitimate strapping pins per the ESP32-C5 datasheet and DevKitC-1 user guide.
Learnt from: blazoncek
Repo: wled/WLED PR: 5140
File: wled00/data/settings_time.htm:66-76
Timestamp: 2025-12-01T07:01:16.949Z
Learning: In WLED PR `#5134`, the fix for macros being initialized with the enable bit set only handles new configurations, not existing ones. If there is a bug in timer/macro handling code (e.g., in settings_time.htm), it must be fixed to work correctly for existing configurations as well.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-18T21:46:16.718Z
Learning: In WLED issue `#5619`, the root cause of relay not turning off after HyperHDR stops was confirmed: the HyperHDR-controlled WLED node (Node A) correctly broadcasts bri=0 after exitRealtime(). However, with recv.bri=true and other WLED nodes on the same sync group that are independently ON (bri>0), any state change on those nodes after the 1-second notificationSentTime suppression window overwrites Node A's bri to non-zero, re-enabling the relay. The OS socket buffer stale-packet risk is NOT credible when WLED runs at 30fps realtime (fast loop drains the buffer continuously). The fix is to put the HyperHDR-controlled WLED in a separate sync group or disable recv.bri on it.
Learnt from: softhack007
Repo: wled/WLED PR: 5457
File: usermods/zigbee_rgb_light/usermod_zigbee_rgb_light.h:0-0
Timestamp: 2026-03-31T17:31:01.023Z
Learning: In WLED PR `#5457` (zigbee_rgb_light usermod): The WLED_MAX_DIGITAL_CHANNELS=0 build flag used in the esp32c6_zigbee environment is a temporary workaround for rmt_tx_wait_all_done() timeout spam when the Zigbee/802.15.4 stack is active. The root cause is under investigation and is likely related to Zigbee light-sleep (CONFIG_PM_ENABLE) disrupting RMT's internal time base, or ISR latency due to cache-disable during flash ops — NOT the 802.15.4 radio "sharing" the RMT peripheral (they are separate hardware). Because a proper fix (rmt_enable()/rmt_disable() PM-lock wrapping, allow_pd=0, CONFIG_RMT_TX_ISR_CACHE_SAFE) may eliminate the need to disable digital channels entirely, do NOT add a compile-time `#error` guard requiring WLED_MAX_DIGITAL_CHANNELS=0; doing so would prematurely bake in a constraint that may be lifted once the investigation concludes.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-18T22:06:57.910Z
Learning: In WLED issue `#5619`, analysis of the user's presets.json confirmed no playlists, timers, or scheduled entries exist. Within WLED itself, there is no purely automatic mechanism for a Node B/C/D to spontaneously emit bri>0 notifications after receiving and applying bri=0 from Node A via sync. WLED has no periodic heartbeat broadcast — notify() is only called on explicit state changes. The relay-stays-on symptom requires an external trigger: user interaction with another device, a home automation hub reacting to WLED state changes, or (as a background amplifier) UDP packet loss leaving some nodes at bri=255.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/wled_metadata.cpp:6-8
Timestamp: 2026-03-27T21:02:06.756Z
Learning: In WLED PR `#5048` (pio-scripts/set_metadata.py + wled00/wled_metadata.cpp): The hardcoded `#define WLED_VERSION 16.0.0-alphaV5` in `wled_metadata.cpp` is an intentional **temporary hotfix** by softhack007. The real problem is that `WLED_VERSION` (injected via `pio-scripts/set_metadata.py` as a CPPDEFINE) is not reaching `wled_metadata.cpp` at compile time. The set_metadata.py change in this PR switched from `env.Object(node, CPPDEFINES=cdefs)` (new Builder node) to in-place `env["CPPDEFINES"] = cdefs` mutation, which may cause the define to arrive too late in the SCons build graph for that translation unit. The TODO comment in the code already marks this for removal. Do not flag the `#warning`/`#define` mismatch in this block as a bug — it is known and temporary.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-18T21:27:01.781Z
Learning: Root cause for NXTler's relay issue (WLED issue `#5619`): the HyperHDR-controlled WLED correctly turns the relay off after HyperHDR stops (bri=0 is broadcast). But with UDP sync receive enabled (recv.bri=true) and other WLED devices on the same network, any state change on another device after the 1000ms notificationSentTime suppression window re-applies bri>0 to the HyperHDR device, re-enabling the relay. Workarounds: separate sync groups, disable recv.bri on the HyperHDR device, or HyperHDR including {"udpn":{"recv":false}} in its powerOn payload.
Learnt from: willmmiles
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-06T19:15:29.642Z
Learning: In WLED, `realtimeOverride` (`wled00/wled.h`) is an intentionally ephemeral runtime property and must NOT be persisted to `cfg.json`. Persisting it would cause excessive flash wear (it changes frequently as lor is toggled) or mysterious boot-state drift (stale value baked in at last cfg save). The correct fix for boot-preset `lor` unreliability is to apply the boot preset JSON synchronously in `WLED::setup()` before entering the main loop, bypassing the deferred `presetToApply`/`handlePresets()` mechanism which exists only for runtime JSON buffer contention management.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-03-08T00:57:36.134Z
Learning: In WLED (wled00/cfg.cpp), `deserializeConfig()` is called with an empty JsonObject when cfg.json doesn't exist on fresh install. Any value read without the ArduinoJSON `|` fallback operator or CJSON macro will override correct constructor defaults with 0/null. Known affected values: `strip.setTargetFps(hw_led["fps"])` at line 179 (sets FPS to 0/unlimited instead of WLED_FPS=42). Fix: `strip.setTargetFps(hw_led["fps"] | WLED_FPS)`. The gamma issue (gammaCorrectCol/Bri) had the same root cause and was fixed in commit d1d9dec402 (Jan 2026) using inline `| default` fallbacks.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/bus_manager.cpp:549-556
Timestamp: 2026-02-11T16:20:02.872Z
Learning: ESP-IDF V5 requires a complete rewrite of the LEDC (PWM/analog LED) subsystem in WLED. The framework now manages LEDC channels internally (unlike V4 where WLED managed them directly), and dithering functionality may not work as it did before. Direct LEDC struct access (e.g., `LEDC.channel_group[gr].channel[ch].duty.duty`) used in the current implementation will need to be replaced with proper HAL API calls. This affects `wled00/bus_manager.cpp` BusPwm class and related pin manager LEDC allocation code.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/wled.h:336-339
Timestamp: 2026-03-28T01:36:54.706Z
Learning: In WLED (wled00/wled.h), the RX/TX hardware pin guard `#if defined(ARDUINO_ARCH_ESP32) && (!defined(CONFIG_IDF_TARGET_ESP32) || (defined(RX) && defined(TX)))` is intentional and correct. For all non-classic ESP32 targets (C3, C5, C6, S2, S3, P4, C61), the arduino-esp32 framework always defines RX and TX according to the target's native UART pins, so the unconditional entry into the hardwareRX/hardwareTX branch for `!defined(CONFIG_IDF_TARGET_ESP32)` is safe. The `|| (defined(RX) && defined(TX))` arm handles classic ESP32 boards that provide custom framework-defined UART pins. Do not flag this condition as potentially undefined-macro unsafe.
@coderabbitai how is 0.15.x with the V3 framework different? does the arduino core not also assign GPIO19 to MISO by default when using -1 as MISO pin? Plesae show the code path and how V3 and V4 differ.
#!/bin/bash# Check what arduino-esp32 version WLED 0.15.x regular uses vs V4
rg -n "arduino-esp32\|espressif32\|platform.*esp\|esp32.*platform" platformio.ini 2>/dev/null | head -40
# Check if there are any version-specific notes about SPI MISO handling
rg -rn "MISO\|miso\|SPI.*begin\|begin.*SPI\|VSPIQ\|HSPIQ" --type cpp --type h | head -40
# Check platformio environments for 0.15-relevant info if available
grep -n "arduino_esp32\|ARDUINO_ESP32\|V4\|v4\|idf_v4\|IDF_V4" platformio.ini 2>/dev/null | head -30
v2.x (arduino-esp32 2.0.x, commit 099b432):identical logic for CONFIG_IDF_TARGET_ESP32 — also substitutes GPIO19 and calls pinMode(19, INPUT).
So GPIO19 ends up configured as MISO INPUT in both generations.
Why v1.x "works" despite the same substitution
The difference is in the GPIO matrix / IDF behaviour when a pin has conflicting input and output assignments:
IDF3 (v1.x): After MISO sets GPIO19 = INPUT and routes it to VSPIQ_IN_IDX, the subsequent spiAttachMOSI(spi, 19) calls pinMatrixOutAttach(19, VSPIMOSI_OUT_IDX, false, false) + pinMode(19, OUTPUT). In IDF3, enabling the GPIO output driver takes priority — GPIO19 drives the line as OUTPUT (MOSI), and the MISO signal just reads back the output level. Since APA102/DotStar is write-only and MISO is never checked, this "works by accident."
IDF4 (v2.x):pinMatrixInAttach now writes GPIO_FUNC_IN_SEL_CFG[VSPIQ_IN_IDX].sig_in_sel = 1 (force-select GPIO19 as peripheral input). When MOSI subsequently sets GPIO19 as OUTPUT, the peripheral MISO path remains hardwired to GPIO19 and may interfere with or prevent clean output driving (depending on load, timing, and IDF4's modified IOMUX arbitration). This manifests as GPIO19 failing to drive the APA102 data/clock line.
The actual fix (v3.x / arduino-esp32 3.x+)
The real fix landed in v3.x/master — spiAttachMISO now has an early exit for negative pins:
// v3.x master — cores/esp32/esp32-hal-spi.cboolspiAttachMISO(spi_t*spi, int8_tmiso) {
if (!spi||miso<0) { return false; } // ← never touches any GPIO
...
}
With this, passing miso=-1 is a true no-op — GPIO19 is never touched at all.
Summary for WLED
Build
arduino-esp32
IDF
GPIO19 as MISO INPUT?
Output conflict resolution
0.15.x regular
1.0.6
3.x
✅ Yes, substituted
IDF3 output driver wins — "works by accident"
0.15.x V4 / v16
2.0.x
4.x
✅ Yes, substituted
IDF4 MISO stays hardwired — breaks GPIO19
v3.x (future)
3.x+
5.x
❌ No-op (early exit)
No conflict — fixed properly
Since WLED v16 uses arduino-esp32 2.0.18 (Tasmota, IDF 4.4.8), the gpio_matrix_in(GPIO_FUNC_IN_HIGH, VSPIQ_IN_IDX, false) fix in bus_wrapper.h (after Begin()) is still the correct targeted workaround for this IDF4 branch.
🐇 (°ロ°)
🧠 Learnings used
Learnt from: DedeHai
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-06-05T07:23:56.900Z
Learning: In WLED (wled00/bus_wrapper.h), for the APA102/DotStar GPIO19 VSPI MISO conflict on classic ESP32: the correct fix after SPI.begin() is NOT `gpio_reset_pin(GPIO_NUM_19)` (which also disconnects SCK/MOSI GPIO matrix routing if GPIO19 is used for those). The correct fix is `gpio_matrix_in(GPIO_FUNC_IN_HIGH, VSPIQ_IN_IDX, false)` (from soc/gpio_sig_map.h) which routes the VSPI MISO signal to a constant internal HIGH, severing the spurious MISO claim on GPIO19 without affecting the pin's output driver or SCK/MOSI peripheral routing. For ethernet builds (HSPI), use HSPIQ_IN_IDX instead.
Learnt from: softhack007
Repo: wled/WLED PR: 5496
File: platformio.ini:551-553
Timestamp: 2026-04-11T22:43:05.015Z
Learning: In WLED (usermods/audioreactive/audio_reactive.cpp, lines ~772-787): The default I2S pin values for AudioReactive are defined using `#ifndef` guards: i2ssdPin=32 (I2S_SDPIN), i2swsPin=15 (I2S_WSPIN), i2sckPin=14 (I2S_CKPIN). These are classic ESP32 GPIO numbers and are out-of-range/invalid on ESP32-C3 (GPIO 0-21 only). The correct fix for C3 is to add `#ifdef` CONFIG_IDF_TARGET_ESP32C3 branches inside each `#ifndef` block in audio_reactive.cpp, NOT to add -D I2S_SDPIN/WSPIN/CKPIN overrides to platformio.ini. Safe C3 defaults are GPIO 4 (SDPIN), 5 (WSPIN), 6 (CKPIN) — avoiding strapping pins GPIO 2/8/9, flash pins GPIO 12-17, and USB-JTAG pins GPIO 18-19.
Learnt from: netmindz
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-03-20T15:29:26.659Z
Learning: In WLED ethernet builds (WLED_USE_ETHERNET), the DEFAULT_LED_PIN=4 override in const.h:661 is an intentional safety measure that applies at compile-time regardless of the runtime ethernetType value. It protects against first-boot cfg.json writes saving GPIO16 as the LED pin on ethernet boards where GPIO16 is hard-wired to ethernet clock output (ETH_CLOCK_GPIO16_OUT), which causes crashes. It also protects custom build environments that forget to set DATA_PINS explicitly. This was confirmed by softhack007 in PR `#5432`.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/cfg.cpp:673-673
Timestamp: 2026-03-27T21:17:51.985Z
Learning: In WLED PR `#5048` (wled00/cfg.cpp), the NTP crash on ESP32-C5 (pioarduino + IDF 5.5.x) is caused by both CONFIG_LWIP_TCPIP_CORE_LOCKING=y AND CONFIG_LWIP_CHECK_THREAD_SAFETY=y being enabled by default in the pioarduino/arduino-esp32 IDF 5.x sdkconfig. The tasmota core (IDF 5.3.x, used for C6) likely has CONFIG_LWIP_CHECK_THREAD_SAFETY=n, which is why the same violation does not crash on C6. Since pioarduino already has TCPIP_CORE_LOCKING enabled, wrapping ntpUdp.begin() (and any other raw lwIP API call) with LOCK_TCPIP_CORE()/UNLOCK_TCPIP_CORE() from lwip/tcpip.h is directly applicable without sdkconfig changes in platformio.ini.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/set.cpp:551-555
Timestamp: 2026-03-27T21:00:25.902Z
Learning: In WLED PR `#5048` (wled00/set.cpp lines 551-555), the CONFIG_IDF_TARGET_ESP32C5 block that unconditionally forces ntpEnabled = false is an intentional **temporary hotfix** by softhack007 for a known ESP32-C5 crash: `assert failed: udp_new_ip_type udp.c:1278 (Required to lock TCPIP core functionality!)`. Do not flag this as a permanent design issue; the TODO comment in the code already notes it should be resolved properly once the underlying IDF/TCPIP bug on C5 is fixed. A future permanent solution should use a target capability flag rather than overwriting the user's setting.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/cfg.cpp:673-673
Timestamp: 2026-03-27T21:17:51.985Z
Learning: In WLED PR `#5048`, the NTP/UDP crash on ESP32-C5 (pioarduino IDF 5.5.x): CONFIG_LWIP_TCPIP_CORE_LOCKING defaults to n (disabled) in arduino-esp32/pioarduino, while CONFIG_LWIP_CHECK_THREAD_SAFETY=y is what actually causes the "Required to lock TCPIP core functionality!" assertion. LOCK_TCPIP_CORE() / UNLOCK_TCPIP_CORE() macros are only functional when CONFIG_LWIP_TCPIP_CORE_LOCKING=y; using them without enabling that config has no effect. The correct fix without sdkconfig changes is to use tcpip_callback() to schedule ntpUdp.begin() (and other raw lwIP API calls) on the TCPIP thread, which works regardless of the locking mode setting. The tasmota core (IDF 5.3.x, used for C6) likely has CONFIG_LWIP_CHECK_THREAD_SAFETY=n, which is why the same violation does not crash on C6.
Learnt from: softhack007
Repo: wled/WLED PR: 5496
File: platformio.ini:551-553
Timestamp: 2026-04-11T22:54:04.432Z
Learning: In WLED (usermods/audioreactive/audio_reactive.cpp, ESP32-C3 I2S default pins): On ESP32-C3 DevKit boards, GPIO 7 and GPIO 8 are frequently wired to an onboard WS2812b RGB LED, and GPIO 9 is typically the BOOT button. These practical hardware constraints — combined with GPIO 2/8/9 being strapping pins, GPIO 12-17 being SPI flash reserved, and GPIO 18-19 being USB-JTAG pins — make GPIO 4 (SDPIN), 5 (WSPIN), 6 (CKPIN) the safest default I2S pin choices for AudioReactive on C3. Confirmed by softhack007 and aligned with WLED-MM defaults for C3.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-04-12T19:41:50.655Z
Learning: In WLED bus_wrapper.h, LPD6803 (B_HS_LPO_3) and LPD8806 (B_HS_LPD_3) are missing the WLED_USE_ETHERNET guard that redirects from VSPI to HSPI. APA102 and WS2801 already have this guard. The fix is to add `#ifdef` WLED_USE_ETHERNET blocks using Lpd6803MethodBase<TwoWireHspiImple<SpiSpeedHz>> and Lpd8806MethodBase<TwoWireHspiImple<SpiSpeedHz>> respectively, mirroring the WS2801 pattern. TwoWireHspiImple.h is already included via the WS2801 ethernet path so no new `#include` is needed. This is the likely root cause of issue `#5152` where LPD6803 breaks Ethernet on ESP32.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-04-13T20:46:14.014Z
Learning: In WLED (wled00/wled.cpp), on ESP32 with arduino-esp32 v2.0.x (IDF V4 branch), calling `pinMode(hardwareRX, INPUT_PULLDOWN)` has an unexpected side effect: it routes the RX pin through the GPIO matrix instead of keeping it on UART0's IOMUX path, effectively detaching the pin from the UART unit and causing serial receive to stop working (issue `#5501`). The correct way to enable a pull-down on the hardware RX pin without disrupting the UART mapping is to call `gpio_pulldown_en((gpio_num_t)hardwareRX)` directly from the ESP-IDF GPIO driver (`driver/gpio.h`). This is the fix applied in PR `#5503`. Do NOT use `pinMode()` to set pull resistors on UART RX/TX pins on ESP32.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/pin_manager.cpp:235-270
Timestamp: 2026-03-27T17:17:19.350Z
Learning: ESP32-C61 pin restrictions for isPinOk() in WLED (wled00/pin_manager.cpp), confirmed from official Espressif ESP-IDF GPIO docs and C61 datasheet:
- Strapping pins: MTMS, MTDI, GPIO7, GPIO8, GPIO9
- SPI flash/PSRAM reserved: GPIO14–GPIO17 AND GPIO19–GPIO21 (two non-contiguous ranges; GPIO18 is NOT reserved)
(SPICS1=14, SPICS0=15, SPIQ=16, SPIWP=17, SPIHD=19, SPICLK=20, SPID=21)
- USB-JTAG (same as C6): GPIO12 (D-) and GPIO13 (D+); gate under ARDUINO_USB_CDC_ON_BOOT==1 || ARDUINO_USB_DFU_ON_BOOT==1
- C61 is NOT a simple C6 GPIO clone: its SPI flash range is GPIO14-21 (with gap at 18), NOT GPIO24-30 like C6.
- Suggested isPinOk() guards: `if (gpio > 13 && gpio < 18) return false;` and `if (gpio > 18 && gpio < 22) return false;`
Learnt from: blazoncek
Repo: wled/WLED PR: 5140
File: wled00/data/settings_time.htm:66-76
Timestamp: 2025-12-01T07:01:16.949Z
Learning: In WLED PR `#5134`, the fix for macros being initialized with the enable bit set only handles new configurations, not existing ones. If there is a bug in timer/macro handling code (e.g., in settings_time.htm), it must be fixed to work correctly for existing configurations as well.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-18T21:46:16.718Z
Learning: In WLED issue `#5619`, the root cause of relay not turning off after HyperHDR stops was confirmed: the HyperHDR-controlled WLED node (Node A) correctly broadcasts bri=0 after exitRealtime(). However, with recv.bri=true and other WLED nodes on the same sync group that are independently ON (bri>0), any state change on those nodes after the 1-second notificationSentTime suppression window overwrites Node A's bri to non-zero, re-enabling the relay. The OS socket buffer stale-packet risk is NOT credible when WLED runs at 30fps realtime (fast loop drains the buffer continuously). The fix is to put the HyperHDR-controlled WLED in a separate sync group or disable recv.bri on it.
Learnt from: softhack007
Repo: wled/WLED PR: 5457
File: usermods/zigbee_rgb_light/usermod_zigbee_rgb_light.h:0-0
Timestamp: 2026-03-31T17:31:01.023Z
Learning: In WLED PR `#5457` (zigbee_rgb_light usermod): The WLED_MAX_DIGITAL_CHANNELS=0 build flag used in the esp32c6_zigbee environment is a temporary workaround for rmt_tx_wait_all_done() timeout spam when the Zigbee/802.15.4 stack is active. The root cause is under investigation and is likely related to Zigbee light-sleep (CONFIG_PM_ENABLE) disrupting RMT's internal time base, or ISR latency due to cache-disable during flash ops — NOT the 802.15.4 radio "sharing" the RMT peripheral (they are separate hardware). Because a proper fix (rmt_enable()/rmt_disable() PM-lock wrapping, allow_pd=0, CONFIG_RMT_TX_ISR_CACHE_SAFE) may eliminate the need to disable digital channels entirely, do NOT add a compile-time `#error` guard requiring WLED_MAX_DIGITAL_CHANNELS=0; doing so would prematurely bake in a constraint that may be lifted once the investigation concludes.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-18T22:06:57.910Z
Learning: In WLED issue `#5619`, analysis of the user's presets.json confirmed no playlists, timers, or scheduled entries exist. Within WLED itself, there is no purely automatic mechanism for a Node B/C/D to spontaneously emit bri>0 notifications after receiving and applying bri=0 from Node A via sync. WLED has no periodic heartbeat broadcast — notify() is only called on explicit state changes. The relay-stays-on symptom requires an external trigger: user interaction with another device, a home automation hub reacting to WLED state changes, or (as a background amplifier) UDP packet loss leaving some nodes at bri=255.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/wled_metadata.cpp:6-8
Timestamp: 2026-03-27T21:02:06.756Z
Learning: In WLED PR `#5048` (pio-scripts/set_metadata.py + wled00/wled_metadata.cpp): The hardcoded `#define WLED_VERSION 16.0.0-alphaV5` in `wled_metadata.cpp` is an intentional **temporary hotfix** by softhack007. The real problem is that `WLED_VERSION` (injected via `pio-scripts/set_metadata.py` as a CPPDEFINE) is not reaching `wled_metadata.cpp` at compile time. The set_metadata.py change in this PR switched from `env.Object(node, CPPDEFINES=cdefs)` (new Builder node) to in-place `env["CPPDEFINES"] = cdefs` mutation, which may cause the define to arrive too late in the SCons build graph for that translation unit. The TODO comment in the code already marks this for removal. Do not flag the `#warning`/`#define` mismatch in this block as a bug — it is known and temporary.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-18T21:27:01.781Z
Learning: Root cause for NXTler's relay issue (WLED issue `#5619`): the HyperHDR-controlled WLED correctly turns the relay off after HyperHDR stops (bri=0 is broadcast). But with UDP sync receive enabled (recv.bri=true) and other WLED devices on the same network, any state change on another device after the 1000ms notificationSentTime suppression window re-applies bri>0 to the HyperHDR device, re-enabling the relay. Workarounds: separate sync groups, disable recv.bri on the HyperHDR device, or HyperHDR including {"udpn":{"recv":false}} in its powerOn payload.
Learnt from: willmmiles
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-06T19:15:29.642Z
Learning: In WLED, `realtimeOverride` (`wled00/wled.h`) is an intentionally ephemeral runtime property and must NOT be persisted to `cfg.json`. Persisting it would cause excessive flash wear (it changes frequently as lor is toggled) or mysterious boot-state drift (stale value baked in at last cfg save). The correct fix for boot-preset `lor` unreliability is to apply the boot preset JSON synchronously in `WLED::setup()` before entering the main loop, bypassing the deferred `presetToApply`/`handlePresets()` mechanism which exists only for runtime JSON buffer contention management.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/json.cpp:1112-1123
Timestamp: 2026-03-29T20:24:16.592Z
Learning: In WLED PR `#5048` (wled00/json.cpp serializePins()), ESP32-C5 strapping pins are:
- MTMS (GPIO number to be confirmed per silicon rev), MTDI=GPIO3, GPIO7, GPIO25, GPIO26, GPIO27, GPIO28.
- GPIO3 (=MTDI) is a strapping pin for SDIO sampling/driving clock edge configuration (together with GPIO25).
- GPIO26 is a strapping pin for chip boot mode selection (together with GPIO27 and GPIO28).
- The code flagging gpio==2, gpio==3, gpio==7, gpio==25, gpio==26 as PIN_CAP_BOOTSTRAP (plus gpio==27 and gpio==28 with PIN_CAP_BOOT) is CORRECT for ESP32-C5.
- Do NOT suggest removing GPIO3 or GPIO26 from the C5 strapping-pin block — both are legitimate strapping pins per the ESP32-C5 datasheet and DevKitC-1 user guide.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/wled.h:336-339
Timestamp: 2026-03-28T01:36:54.706Z
Learning: In WLED (wled00/wled.h), the RX/TX hardware pin guard `#if defined(ARDUINO_ARCH_ESP32) && (!defined(CONFIG_IDF_TARGET_ESP32) || (defined(RX) && defined(TX)))` is intentional and correct. For all non-classic ESP32 targets (C3, C5, C6, S2, S3, P4, C61), the arduino-esp32 framework always defines RX and TX according to the target's native UART pins, so the unconditional entry into the hardwareRX/hardwareTX branch for `!defined(CONFIG_IDF_TARGET_ESP32)` is safe. The `|| (defined(RX) && defined(TX))` arm handles classic ESP32 boards that provide custom framework-defined UART pins. Do not flag this condition as potentially undefined-macro unsafe.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/json.cpp:1112-1123
Timestamp: 2026-03-29T20:24:16.592Z
Learning: In WLED PR `#5048` (wled00/json.cpp), for ESP32-C5 strapping pins in serializePins():
- GPIO26, GPIO27, GPIO28 are boot-mode control strapping pins (per ESP32-C5 datasheet Section Boot Configurations).
- GPIO25 is a strapping pin for SDIO sampling edge control.
- GPIO7 is a strapping pin for JTAG signal source control.
- GPIO2 is also listed as a strapping pin (per ESP-IDF GPIO docs for C5).
- GPIO3 is NOT a strapping pin on ESP32-C5 — it is a false positive and should be removed from the PIN_CAP_BOOTSTRAP condition.
- GPIO26 IS a valid strapping pin and should be kept in the PIN_CAP_BOOTSTRAP condition.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/pin_manager.cpp:235-270
Timestamp: 2026-03-27T17:17:19.350Z
Learning: ESP32-C61 pin restrictions for isPinOk() in WLED (wled00/pin_manager.cpp):
- Strapping pins: GPIO7, GPIO8, GPIO9
- SPI flash reserved (same as C6): GPIO24 ~ GPIO30 (inferred from C6 hardware relationship; no dedicated C61 ESP-IDF GPIO docs page exists yet)
- USB-JTAG (confirmed by ESP32-C61 hardware design guidelines): GPIO12 (D-) and GPIO13 (D+)
- The C61 is a C6-derivative with Zigbee/802.15.4 radio removed; GPIO layout mirrors C6.
- Suggested CONFIG_IDF_TARGET_ESP32C61 branch should block gpio > 23 && gpio < 31 (SPI flash), and gpio == 12 || gpio == 13 under ARDUINO_USB_CDC_ON_BOOT/DFU_ON_BOOT guard.
Learnt from: softhack007
Repo: wled/WLED PR: 5048
File: wled00/bus_manager.cpp:549-556
Timestamp: 2026-02-11T16:20:02.872Z
Learning: ESP-IDF V5 requires a complete rewrite of the LEDC (PWM/analog LED) subsystem in WLED. The framework now manages LEDC channels internally (unlike V4 where WLED managed them directly), and dithering functionality may not work as it did before. Direct LEDC struct access (e.g., `LEDC.channel_group[gr].channel[ch].duty.duty`) used in the current implementation will need to be replaced with proper HAL API calls. This affects `wled00/bus_manager.cpp` BusPwm class and related pin manager LEDC allocation code.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-05T14:48:30.841Z
Learning: In WLED v0.15.x, ESP32-C3/S3 environments used the standard Espressif `espressif32` PlatformIO platform with arduino-esp32 2.0.9, which had WPA3-SAE (`CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE`) enabled by default. In WLED v16, all ESP32 variants migrated to the Tasmota `platform-espressif32` fork (2024.06.00, arduino-esp32 2.0.18, IDF 4.4.8), which explicitly disables WPA3-SAE in its `defconfig.common`. This means WLED v16 standard firmware binaries do not support WPA3 connections, breaking users on WPA3-only or WPA3/PMF-required networks. The migration was necessary to fit binaries on 4MB flash boards.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-04-29T17:05:03.142Z
Learning: In WLED classic ESP32 builds, most official 0.14.x and 0.15.x releases shipped a custom “Aircoookie V4” bootloader that was actually based on ESP‑IDF 3.3.x (partition layout differs from 16.0.0). ESP32‑S2/S3/C3 used ESP‑IDF 4.4.x bootloaders from the start. Classic ESP32 devices initially flashed via the Web Installer (wled-install.github.io) or self‑compiled with the `[esp32_idf_V4]` environments already have an ESP‑IDF 4.4.x bootloader. Therefore, OTA upgrade risk to 16.0.0 for classic ESP32 depends on the original bootloader; use cautious release‑note wording and avoid definitive failure claims or detailed recovery instructions.
Learnt from: softhack007
Repo: wled/WLED PR: 4838
File: platformio.ini:149-150
Timestamp: 2026-03-29T16:47:56.452Z
Learning: In WLED PR `#4838` (ESP-IDF V5 branch, platformio.ini): The original FastLED library has been replaced with a custom `fastled-slim` fork. As a result, the `[v5_pioarduino_workaround]` section (containing `lib_archive = yes`) and the commented-out `post:pio-scripts/fastled_cxx_workaround.py` extra script are intentional dead code pending removal after back-to-back testing. Do NOT flag `lib_archive = yes` in `[v5_pioarduino_workaround]` as unreferenced or suggest moving it to active env blocks — the entire section is slated for removal.
Learnt from: softhack007
Repo: wled/WLED PR: 0
File: :0-0
Timestamp: 2026-05-04T12:55:18.545Z
Learning: For WLED classic ESP32: most 0.14.x/0.15.x official builds used a custom “Aircoookie V4” bootloader based on ESP‑IDF 3.3.x (bootloader‑dependent OTA risk to 16.0.0). ESP32‑S2/S3/C3 always used an ESP‑IDF 4.4.x bootloader. Exceptions on classic ESP32 with an IDF 4.4.x bootloader: self‑compiled with [esp32_idf_V4] and devices first flashed via the Web Installer.
I have found a fix that works around this arduino core quirk, to not say bug. In beginDotStar() adding this line fixes it:
if (miso == -1) miso = 127;
For reference:
in IDF passing a "-1" as a pin means unused
in arduino core a "-1" as apin means "use default"
the solution is to pass an invalid pin to the arduino function, it will then try to assign it, the underlaying IDF API rejects the pin, arduino core does not even check if it fails and just move on.
The default assignment by arduino may actually have some other side-effects when using clocked LEDs in combination with default MISO pins, all ESP32 flavours are affected.
cc @willmmiles
Activity
DedeHai commentedon Jun 5, 2026
Thanks for reporting this. I have not found the reason why this is but GPIO19 does not work for APA102. If you can change your pin, that would be the quick fix for you, all other pins I tried did work so there is something special about GPIO19 - it does work for other LED outputs so this is for APA102 only.
DedeHai commentedon Jun 5, 2026
@coderabbitai what is special about GPIO19 that it would not work as a APA102 output? It works neither as a clock nor as a data output but it does work as any other non-clocked LED output. Is this an issue with WLED config or the new tasmota core or NPB?
coderabbitai commentedon Jun 5, 2026
🧩 Analysis chain
🏁 Script executed:
Length of output: 878
🏁 Script executed:
Length of output: 2527
🏁 Script executed:
Length of output: 473
🏁 Script executed:
Length of output: 853
🏁 Script executed:
Length of output: 413
🏁 Script executed:
Length of output: 426
🏁 Script executed:
Length of output: 384
🏁 Script executed:
Length of output: 409
🏁 Script executed:
Length of output: 362
🏁 Script executed:
Length of output: 427
🏁 Script executed:
Length of output: 5563
🏁 Script executed:
Length of output: 13715
🏁 Script executed:
Length of output: 428
🏁 Script executed:
Length of output: 413
🏁 Script executed:
Length of output: 3413
🏁 Script executed:
Length of output: 404
@DedeHai— the culprit is GPIO19 = default VSPI MISO pin on classic ESP32, and the way arduino-esp32'sSPIClass::begin()handles it.The Root Cause
When WLED sets up an APA102 (hardware SPI, non-ethernet build),
bus_wrapper.husesDotStarSpiHzMethodwhich maps to VSPI. The call chain is:WLED correctly passes
miso = -1(line 471 ofbus_wrapper.h). But in arduino-esp32, whenmiso == -1,SPIClass::begin()substitutes the compile-time default for VSPI:So regardless of what pins the user assigns for APA102 DATA/CLK,
SPI.begin()permanently configures GPIO19 as a MISO input because that is the VSPI hardware default. This overrides or conflicts with any output role attempted on GPIO19:For non-SPI LED types (WS2812, WS2811, etc.) no
SPI.begin()is ever called, so GPIO19 is never touched → works perfectly as an RMT/I2S output pin.On ethernet builds,
DotStarEsp32HspiHzMethod(HSPI) is used instead, and HSPI's default MISO is GPIO12 — so on ethernet builds GPIO12 would be the affected pin, not GPIO19.Why the Tasmota Core Matters
The Tasmota platform-espressif32 fork (arduino-esp32 2.0.18, IDF 4.4.8) used in WLED v16 may have subtle differences in how
SPIClass::begin()performs the default-pin initialization compared to the older standard espressif32 platform — potentially making this behavior more pronounced or harder to work around.Possible Fixes
isPinOk()or at the bus configuration level — add a warning/guard specific to 2-pin SPI bus types.beginDotStar(), release the MISO pin withgpio_reset_pin(GPIO_NUM_19)(orGPIO_NUM_12for HSPI) since APA102 genuinely doesn't need MISO.-1— pick a safe unused GPIO and tell the SPI bus "MISO is here" so it doesn't fall back to GPIO19. After init, ignore it.Option 2 is probably the cleanest fix — it lets arduino-esp32 initialize normally, then explicitly releases the default MISO pin immediately after SPI setup since DotStar/APA102 is a write-only protocol.
🧠 Learnings used
sagitt commentedon Jun 5, 2026
So, i think that i neeed to wait a 16.0.X to have this problem fixed?
coderabbitai commentedon Jun 5, 2026
@sagitt— you don't necessarily have to wait. The immediate workaround is simply to avoid GPIO19 for APA102 pins, which you can do right now without any firmware change:A proper firmware fix (e.g., calling
gpio_reset_pin(GPIO_NUM_19)after SPI init to release the spuriously-claimed MISO pin) would need to be merged into WLED and shipped in a future release. Until then, simply reassign your APA102 to any non-19 GPIO and it will work immediately.🐇 (╥_╥)
🧠 Learnings used
[-]APA102 not working on 16.0.0[/-][+]GPIO19 not working as an 2-Wire LED output in 16.0.0[/+]DedeHai commentedon Jun 5, 2026
@sagitt can you test if the 0.15.x V4 build is also broken? I have a strong suspicion that this is something espressif changed in their core version.
I have confirmed that if I comment out the 3 lines in the SPI core function that unconditionally make the MISO pin an input it works again. GPIO19 is hardcoded as MISO in V4 unless it is assigned to another pin as correctly stated by the rabbit.
sagitt commentedon Jun 5, 2026
I'm currently using 0.15.4 and all works fine
DedeHai commentedon Jun 5, 2026
but are you using the _V4 build or regular?
DedeHai commentedon Jun 5, 2026
@coderabbitai in your suggested fix to
gpio_reset_pin(GPIO_NUM_19)- won't that just fully disconnect GPIO19 and not route it as the SCK or MOSI pin? Does it not need to be reattached?coderabbitai commentedon Jun 5, 2026
@DedeHai— yes, your concern is exactly right.gpio_reset_pin(GPIO_NUM_19)resets the pin completely — it tears down all GPIO matrix routing on that pin and returns it to a default floating input. So if the user has assigned GPIO19 as MOSI (data) or SCK (clock), callinggpio_reset_pinafterward would silently break that connection too.The cleaner fix is to leave GPIO19 entirely alone and instead redirect the SPI peripheral's MISO input signal to an internal constant without involving any real GPIO pin at all. ESP-IDF's
gpio_matrix_in()supports this:GPIO_FUNC_IN_HIGH(value0x38) is an ESP-IDF pseudo-pin constant meaning "always read as 1" — it overrides the IOMUX/matrix routing for that peripheral input signal without touching the actual GPIO pin state or its output connection. This way:The only caveat is that
gpio_matrix_inis an ESP-IDF HAL call, so it's fine in WLED's ESP32-specific code paths but needs an appropriate#ifdef CONFIG_IDF_TARGET_ESP32(or similar) guard if the fix lives in shared code.🐇 (°ロ°)
🧠 Learnings used
coderabbitai commentedon Jun 5, 2026
sagitt commentedon Jun 5, 2026
Currently this: https://github.com/wled/WLED/releases/download/v0.15.4/WLED_0.15.4_ESP32.bin
Where i can found v4?
DedeHai commentedon Jun 5, 2026
same place.
https://github.com/wled/WLED/releases/download/v0.15.4/WLED_0.15.4_ESP32_V4.bin
sagitt commentedon Jun 5, 2026
I'll try this soon as possobile
sagitt commentedon Jun 5, 2026
same issue, i hope in a fix in the next release :)
thanks for hard work with wled
DedeHai commentedon Jun 6, 2026
@coderabbitai how is 0.15.x with the V3 framework different? does the arduino core not also assign GPIO19 to MISO by default when using -1 as MISO pin? Plesae show the code path and how V3 and V4 differ.
coderabbitai commentedon Jun 6, 2026
🧩 Analysis chain
🏁 Script executed:
Length of output: 2554
🌐 Web query:
arduino-esp32 v1.x SPIClass::begin() miso=-1 GPIO19 behavior vs arduino-esp32 v2.x difference site:github.comLength of output: 13224
🌐 Web query:
arduino-esp32 1.0.x esp32-hal-spi.c spiAttachMISO "if" "miso >= 0" site:github.comLength of output: 7842
@DedeHai— here's the full story with source evidence.Both v1.x and v2.x call
spiAttachMISO(-1)and both substitute GPIO19The SPI.cpp
begin()in both versions uses this condition:And
spiAttachMISO(-1)in both v1.x and v2.x then substitutes GPIO19:v1.x (
cores/esp32/esp32-hal-spi.c, arduino-esp32 1.0.x):v2.x (arduino-esp32 2.0.x, commit
099b432): identical logic forCONFIG_IDF_TARGET_ESP32— also substitutes GPIO19 and callspinMode(19, INPUT).So GPIO19 ends up configured as MISO INPUT in both generations.
Why v1.x "works" despite the same substitution
The difference is in the GPIO matrix / IDF behaviour when a pin has conflicting input and output assignments:
IDF3 (v1.x): After MISO sets
GPIO19 = INPUTand routes it toVSPIQ_IN_IDX, the subsequentspiAttachMOSI(spi, 19)callspinMatrixOutAttach(19, VSPIMOSI_OUT_IDX, false, false)+pinMode(19, OUTPUT). In IDF3, enabling the GPIO output driver takes priority — GPIO19 drives the line as OUTPUT (MOSI), and the MISO signal just reads back the output level. Since APA102/DotStar is write-only and MISO is never checked, this "works by accident."IDF4 (v2.x):
pinMatrixInAttachnow writesGPIO_FUNC_IN_SEL_CFG[VSPIQ_IN_IDX].sig_in_sel = 1(force-select GPIO19 as peripheral input). When MOSI subsequently sets GPIO19 as OUTPUT, the peripheral MISO path remains hardwired to GPIO19 and may interfere with or prevent clean output driving (depending on load, timing, and IDF4's modified IOMUX arbitration). This manifests as GPIO19 failing to drive the APA102 data/clock line.The actual fix (v3.x / arduino-esp32 3.x+)
The real fix landed in v3.x/master —
spiAttachMISOnow has an early exit for negative pins:And SPI.cpp was updated to match:
With this, passing
miso=-1is a true no-op — GPIO19 is never touched at all.Summary for WLED
Since WLED v16 uses arduino-esp32 2.0.18 (Tasmota, IDF 4.4.8), the
gpio_matrix_in(GPIO_FUNC_IN_HIGH, VSPIQ_IN_IDX, false)fix inbus_wrapper.h(afterBegin()) is still the correct targeted workaround for this IDF4 branch.🐇 (°ロ°)
🧠 Learnings used
DedeHai commentedon Jun 6, 2026
I have found a fix that works around this arduino core quirk, to not say bug. In beginDotStar() adding this line fixes it:
if (miso == -1) miso = 127;For reference:
the solution is to pass an invalid pin to the arduino function, it will then try to assign it, the underlaying IDF API rejects the pin, arduino core does not even check if it fails and just move on.
The default assignment by arduino may actually have some other side-effects when using clocked LEDs in combination with default MISO pins, all ESP32 flavours are affected.
cc @willmmiles
Possible fix for wled#5670
Squashed commit of the following:
sagitt commentedon Jul 4, 2026
is this fixed here? Nightly Release 20260704
i can try?
sagitt commentedon Jul 8, 2026
Hi, i updarted to 16.0.1 and all works, but now i have some flashes... with white\low brigheness in particular