Compiling WLED with AudioReactive for MagWLED-1
The MagWLED-1 uses an ESP32-C3 with a built-in I2S microphone. Compiling WLED with USERMOD_AUDIOREACTIVE requires specific build flags to map the I2S pins correctly. Without these, the device will boot loop.
Required build flags
Use the following platform_override.ini configuration as a starting point:
[env:c3_magwled]
extends = env:esp32c3dev
build_flags = ${env:esp32c3dev.build_flags}
-D BTNPIN=9
-D RLYPIN=5
-D I2S_SDPIN=10
-D I2S_WSPIN=8
-D I2S_CKPIN=7
-D MCLK_PIN=-1
-D SERVERNAME="\"MagWLED\""
-D WLED_DISABLE_ALEXA
-D ESPHTTPD_SINGLE_REQUEST
${esp32.AR_build_flags}
lib_deps =
${env:esp32c3dev.lib_deps}
${esp32.AR_lib_deps}
Key pin assignments
| Pin | GPIO | Purpose |
|---|---|---|
| Button | 9 | Onboard power button |
| Relay | 5 | Output relay |
| I2S Data (SD) | 10 | Microphone data |
| I2S Word Select (WS) | 8 | Microphone clock |
| I2S Clock (SCK) | 7 | Microphone bit clock |
| MCLK | -1 | Not used (set to -1) |
Important notes
- Check out the
v0.15.3tag (or the latest tagged release) before building — building from main/nightly branches may introduce instability. - The
-D MCLK_PIN=-1flag is required; omitting it can cause the AudioReactive usermod to fail to initialize. - If the device boot loops after flashing, hold the onboard power button while plugging in USB to enter flash mode, then reflash.
Known issues and workarounds
- Bootloop with
-D USERMOD_AUDIOREACTIVE: If the device bootloops with AudioReactive enabled, double-check that-D MCLK_PIN=-1is present in your build flags. Omitting it is the most common cause. - Branch compatibility: Build from a tagged release (e.g.
v0.15.3), not from themainbranch. Main can be unstable on ESP32-C3. - Library conflicts: If you’ve added other usermods, try building with AudioReactive alone first to isolate conflicts.
- Still stuck? The WLED Discord
#audioreactivechannel is the best place for live help with custom compilation issues.
Pre-built firmware
If you don’t need a custom build, the pre-built firmware at install.magwled.com includes AudioReactive support out of the box — no compilation needed.