Skip to content

Change default LED pin to 4 in esp32 ethernet builds#5323

Merged
softhack007 merged 4 commits intomainfrom
ethernet_led_pin
Jan 28, 2026
Merged

Change default LED pin to 4 in esp32 ethernet builds#5323
softhack007 merged 4 commits intomainfrom
ethernet_led_pin

Conversation

@softhack007
Copy link
Member

@softhack007 softhack007 commented Jan 27, 2026

change default LED pin to 4 in ethernet builds, and set AR default to "no mic" mode.
The "normal" default LED pin 16 is conflicting with pins needed by many ethernet boards, which can cause random crashes.

This should avoid some stability problems reported by ethernet users:

Ethernet-related ESP-NOW and WIFI AP problems are not addressed by this PR.

Summary by CodeRabbit

  • Bug Fixes

    • Prevents LED pin conflicts on Ethernet-enabled ESP32 boards by changing the default LED pin when Ethernet is active, improving startup reliability.
  • Chores

    • Adds build-time options to control pin allocation and data-pin count.
    • Re-enables ESP-NOW by default while preserving a note about its interaction with Ethernet.

✏️ Tip: You can customize this high-level summary in your review settings.

GPIO 4 seems to be one of the few pins that is not used in ANY supported ethernet config.

See #5155 (comment)
LED pin: 16 -> 4
AR: no microphone, no pins
clarify comment when to disable ESP-NOW
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

Walkthrough

Added build flags in platformio.ini and made DEFAULT_LED_PIN conditional: it becomes 4 when WLED_USE_ETHERNET is defined (with a compile-time warning), otherwise 16.

Changes

Cohort / File(s) Summary
Build configuration
platformio.ini
Added build flags: -D SR_DMTYPE=-1, -D DATA_PINS=4; removed active -D WLED_DISABLE_ESPNOW (left as comment/note about ESP‑NOW vs Ethernet).
Constants / Macros
wled00/const.h
DEFAULT_LED_PIN now defined as 4 when WLED_USE_ETHERNET is set (emit compile‑time warning), otherwise 16. Replaced prior unconditional definition.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • DedeHai
  • blazoncek
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: modifying the default LED pin to GPIO4 for ESP32 Ethernet builds to resolve pin conflicts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@platformio.ini`:
- Line 514: Replace the incorrect preprocessor flag SR_DTYPE with the correct
flag SR_DMTYPE in the platformio build defines: change the define that currently
reads SR_DTYPE to SR_DMTYPE so the Audio Reactive code (referenced by
audio_reactive.cpp and its SR_DMTYPE checks) receives the intended -1 value to
disable pin allocation at startup (i.e., use -D SR_DMTYPE=-1).

* ethernet warning was repeating too often
* make sure that AR usermod will not grab any PINs at startup
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@platformio.ini`:
- Line 516: The platformio.ini change enabled ESP-NOW by default by removing the
-D WLED_DISABLE_ESPNOW flag which can crash Ethernet-only boards using
ETH_CLOCK_GPIO0_OUT/ETH_CLOCK_GPIO16_OUT/ETH_CLOCK_GPIO17_OUT; either restore
the default-safe behavior by re-adding/commenting in -D WLED_DISABLE_ESPNOW with
a clear comment on how to enable ESP-NOW for compatible boards, or implement a
compile-time guard in the build/config logic (check WLED_USE_ETHERNET and
WLED_DISABLE_ESPNOW/ESP-NOW flags) to emit a build warning/error when
WLED_USE_ETHERNET is enabled without explicit confirmation that the board
supports ESP-NOW (reference symbols: -D WLED_DISABLE_ESPNOW, WLED_USE_ETHERNET,
ETH_CLOCK_GPIO0_OUT, ETH_CLOCK_GPIO16_OUT, ETH_CLOCK_GPIO17_OUT).

@softhack007 softhack007 merged commit 4e07296 into main Jan 28, 2026
51 checks passed
softhack007 added a commit that referenced this pull request Jan 28, 2026
Change default LED pin to 4 in esp32 ethernet builds and set AR default to "no mic" mode.
The "normal" default LED pin 16 is conflicting with pins needed by many ethernet boards, which can cause random crashes.
@softhack007 softhack007 modified the milestones: 0.15.4, 16.0.0 beta Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crashes when trying to save LED configuration (esp32 ethernet) WT32-ETH01 Error 8 Effect RAM depleted

1 participant

Comments