Skip to content

Conversation

@troyhacks
Copy link
Collaborator

@troyhacks troyhacks commented Jan 15, 2026

This should allow anyone to add Ethernet to any board.

Some notes:

  • Apologies for the json files. Just ignore those, it's cruft from jumping between branches.

  • W5500 is SPI and that means it's slower than RMII - which is only on the original ESP32 and the ESP32-P4... but it's still highly functional. There's also things that can we tweaked in the IDF (when building Ardino-ESP32) as well as at WLED compile-time to potentially get more performance out of these.

  • chrome_Nu8JoBLC8Kchrome_WBmWmhJkq9

  • The "W5500 Lite" (the smaller DIP-style module on the left) will absolutely require additional 3.3v power. It seems I'm not alone in saying that nobody has ever run one off the 3.3v rail of an ESP32. It doesn't need a lot, it's just very picky. The older "blue W5500" boards (right) seem to be much more tolerant and can run off an ESP32 rail, but you might want to add a big cap to absorb the surges and avoid brownouts.

  • Research says also just having a dedicated regulator will help as well - the Lite version just doesn't do itself any favors. I have used a breadboard power supply like this to give enough juice for the W5500 Lite to work:

  • chrome_ymbjelhDaK
  • platformio/framework-arduinoespressif32 has to be any version ABOVE 3.20009.0 (I tested the next higher and the latest version and both worked). This may not strictly be needed if someone wanted to figure out the one missing function and "backport" it somehow, but the easy method is to just use a slightly newer version.

  • ETH.h is replaced with a backport LilyGo did from IDFv5 which I split out from their meta-library to: https://github.com/troyhacks/ETHClass2

  • I expanded the ethernet board struct to handle all 3 types of Ethernet - two RMII types and the W5500 - and it will likely handle ones we haven't used yet that Espressif supports. I think it's clever, @softhack007 may disagree. 😊

  • I think our move to IDFv4 means I don't need to use my modified AsyncUDP library anymore! Huzzah! It's sending tons of AsyncUDP data just fine. If we move to IDFv5 at some point, this PR will be mostly moot as support for all of these devices are in there natively.

  • There's some "saving the pins in the config file" logic I didn't touch - nothing uses them, as far as I know. If I'm wrong, I can dig into that. I assume most people pick the one that works from the drop-down and move on with their life.

I also checked to make sure it still works on the original ESP32 RMII Ethernet devices, and it does:

chrome_PWPxyABp64

...and on the existing S3 boards I have from LilyGo and WaveShare, which are now user-selectable instead of compile-time flags!

chrome_2kUlItVSt6

...and here it is on an original ESP32 doing W5500 Ethernet. This is based on some random board I had lying around, so pins could be changed. We do have global SPI defines we can do, but I didn't implement those - but the W5500 needs 3 more pins (interrupt, CS/SS, and reset). My TTGO "Koala" board seems to be marked as having "hardware" SPI pins at 12,13,14 for MISO, MOSI, and SCLK.

chrome_B2niz7FPBW

And proof of life of W5500 on a reggo ESP32:

---WLED =FASTPATH= 14.7.1 2601131 INIT---
 WLEDMM_14.7.1 esp32_4MB_PSRAM_S, build 2601131.
Running from: app0 which is 1703936 bytes and type 0 subtype 16 at address 10000
CPU:   ESP32-D0WD-V3 rev.3, 2 core(s), 240MHz.
CPU    ESP_RST_POWERON (code 1). Core#0 power-on (1); Core#1 restart (14).
FLASH: 4MB, Mode 2, speed 80MHz.
JSON garbage collection (initial).
PSRAM in use:54260 Bytes.

ETH initialized W5500!
initC: *** Ethernet successfully configured! ***

GPIO    | Assigned to           | Info
--------|-----------------------|------------
i/o   0   Button
i/o   1   ./.                     Serial TX
i/o   2   LEDs (digital)          (default) LED pin
i/o   3   ./.                     Serial RX
...
i/o  12   Ethernet
i/o  13   Ethernet                
i/o  14   Ethernet
...
i/o  16   PSRAM                   (reserved) PSRAM
i/o  17   PSRAM                   (reserved) PSRAM
...
i/o  25   Ethernet
i/o  26   Ethernet
i/o  27   Ethernet

Free heap 196448
WLED initialization done.

Connecting to Tarna / ********* ...
Ethernet link is up. Speed is 100 mbit and link is full duplex! (MAC: 0A:A6:F7:16:D2:81)

Connected! IP address: http://192.168.1.222 via Ethernet (disabling WiFi)
mDNS started: wled-16d280.local

Summary by CodeRabbit

  • New Features

    • Three new Ethernet board options added to the network settings and a dedicated SPI (W5500) Ethernet initialization path.
  • Improvements

    • Safer, per-interface Ethernet initialization with automatic pin management and clearer success/failure behavior.
    • Expanded Ethernet status reporting and richer connection/logging details (link, speed, duplex, normalized MAC).
  • Chores

    • Replaced dependency "web-resource-inliner" with "inliner" (^1.13.1) and updated build/platform environment metadata.

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

@troyhacks troyhacks changed the title W550 Support for ALL boards W5500 Support for ALL boards Jan 15, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Adds W5500 (SPI) Ethernet support and three new board types; extends EthernetSettings with SPI/RMII pin fields and PHY/clock macros; conditionally uses ETHClass2 and exposes a global ETH; splits Ethernet init into SPI and RMII flows with path-specific pin allocation, validation, and logging; updates platform and npm deps.

Changes

Cohort / File(s) Changes
Dependency update
\package.json``
Removed web-resource-inliner; added inliner ^1.13.1; dependency ordering adjusted.
Platform / libs
\platformio.ini``
Added ETHClass2 to lib_deps/lib_ignore; bumped espressif32 platform/packages to 6.12.0; added WaveShare_ESP32-S3-ETH env.
Ethernet type constants
\wled00/const.h``
WLED_NUM_ETH_TYPES 15 → 18; added three new Ethernet type constants.
UI settings
\wled00/data/settings_wifi.htm``
Appended three new Ethernet Type options to the Ethernet Type select.
Ethernet settings & macros
\wled00/wled_ethernet.h``
Added SPI/RMII pin fields (eth_miso_pin, eth_mosi_pin, eth_cs_pin, eth_rst_pin, eth_int_pin, eth_sclk_pin); added GPIO_NUM_NC and PHY/clock macros; non-RMII eth_type/eth_clk_modeint; adjusted reserved pins count.
Network events & board initializers
\wled00/network.cpp``
Guarded esp32_nonconfigurable_ethernet_pins under RMII; extended ethernetBoards[] with new pin fields and W5500 entries; improved ETH event logging, MAC normalization, and added unhandled-event log.
Ethernet abstraction / headers
\wled00/src/dependencies/network/Network.h`, `wled00/wled.h``
Conditional include of ETHClass2.h and extern ETHClass2 ETH when CONFIG_ETH_SPI_ETHERNET_W5500; fallback to <ETH.h> otherwise; new global ETH guarded by IDF/ESP macros.
Ethernet init logic
\wled00/wled.cpp``
Split init into W5500 (SPI) and RMII paths; path-specific pin allocation/validation, ETH.begin calls, deallocation on failure, SPI3_HOST fallback, and link/speed/duplex/MAC logging.
Serialization & status
\wled00/cfg.cpp`, `wled00/xml.cpp``
Serialize and emit additional Ethernet pins (MISO/MOSI/CS/RST/INT/SCLK); clock-mode emission conditional on PHY type.

Sequence Diagram(s)

sequenceDiagram
    participant Config as Configuration
    participant Init as Initialization (wled.cpp)
    participant PinMgr as Pin Manager
    participant ETH as ETH (ETHClass2 / ETH)
    participant Log as Logger

    rect rgba(100,150,200,0.5)
    Note over Init,ETH: W5500 (SPI) Path
    Init->>Config: Check eth_type == W5500 / CONFIG_ETH_SPI_ETHERNET_W5500
    Config-->>Init: W5500 config
    Init->>PinMgr: Allocate SPI pins (MISO,MOSI,CS,RST,INT,SCLK)
    PinMgr-->>Init: allocated / failure
    Init->>ETH: ETH.begin(SPI3_HOST, pins...)
    ETH-->>Init: success / failure
    alt Success
        Init->>Log: Log W5500 success
        Init->>Init: Mark Ethernet configured
    else Failure
        Init->>PinMgr: Deallocate pins
        Init->>Log: Log W5500 failure
    end
    end

    rect rgba(200,100,100,0.5)
    Note over Init,ETH: RMII Path (CONFIG_ETH_PHY_INTERFACE_RMII)
    Init->>Config: Check RMII config & clock mode
    Config-->>Init: RMII pin mapping
    Init->>PinMgr: Allocate RMII pins (non-configurable + MDC/MDIO/POWER/CLK)
    PinMgr-->>Init: allocated / failure
    Init->>ETH: ETH.begin(eth_type, address, MDC, MDIO, ...)
    ETH-->>Init: success / failure (link/speed/duplex/MAC)
    alt Success
        Init->>Log: Log RMII success (link/speed/duplex/MAC)
        Init->>Init: Mark Ethernet configured
    else Failure
        Init->>PinMgr: Deallocate pins
        Init->>Log: Log RMII failure
    end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 I hopped through wires and added three more,
SPI and RMII now knock at the door,
ETHClass2 hums and MACs go low,
Pins set with care — released if they blow,
A tiny rabbit cheers: the network will grow!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'W5500 Support for ALL boards' is directly related to the main objective of the PR, which is to add W5500 (SPI) Ethernet support across ESP32-based boards. This concisely summarizes the primary change.

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


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.

@troyhacks
Copy link
Collaborator Author

Checks will all fail because the exiting build environment is not prepped.

Copy link

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
wled00/network.cpp (1)

13-24: Fix array type mismatch for esp32_nonconfigurable_ethernet_pins.
The non‑RMII definition uses an empty initializer with unspecified size, which conflicts with the fixed‑size extern declaration and can break compilation. Make the definition match the declared size (or guard the declaration in the header).

🛠️ Suggested fix
 `#ifdef` CONFIG_ETH_PHY_INTERFACE_RMII
 const managed_pin_type esp32_nonconfigurable_ethernet_pins[WLED_ETH_RSVD_PINS_COUNT] = {
     { 21, true  }, // RMII EMAC TX EN  == When high, clocks the data on TXD0 and TXD1 to transmitter
     { 19, true  }, // RMII EMAC TXD0   == First bit of transmitted data
     { 22, true  }, // RMII EMAC TXD1   == Second bit of transmitted data
     { 25, false }, // RMII EMAC RXD0   == First bit of received data
     { 26, false }, // RMII EMAC RXD1   == Second bit of received data
     { 27, true  }, // RMII EMAC CRS_DV == Carrier Sense and RX Data Valid
 };
 `#else` 
-const managed_pin_type esp32_nonconfigurable_ethernet_pins[] = {};
+const managed_pin_type esp32_nonconfigurable_ethernet_pins[WLED_ETH_RSVD_PINS_COUNT] = {};
 `#endif`
🤖 Fix all issues with AI agents
In `@package.json`:
- Around line 28-30: Remove the unused "inliner" dependency declaration from
package.json and also remove its entry from package-lock.json; verify that
tools/cdata.js imports only "web-resource-inliner" (not "inliner") and then run
npm install (or npm ci) to regenerate the lockfile so package-lock.json no
longer contains "inliner". Ensure package.json still lists
"web-resource-inliner" and that no other files import or require "inliner"
before committing.
🧹 Nitpick comments (3)
wled00/src/dependencies/network/Network.h (1)

5-7: Include placement outside header guard may cause issues.

The ETHClass2.h include and extern ETHClass2 ETH declaration are placed before the #ifndef Network_h include guard (lines 10-11). This means every translation unit that includes Network.h will re-process these lines. While ETHClass2.h likely has its own guards, the extern declaration placement is unconventional and could cause confusion.

Consider moving these inside the include guard for consistency:

Suggested restructure
+#ifndef Network_h
+#define Network_h
+
 `#ifdef` ESP8266
   `#include` <ESP8266WiFi.h>
 `#else` // ESP32
   `#include` <WiFi.h>
-  // `#include` <ETH.h>
   `#include` "ETHClass2.h"
   extern ETHClass2 ETH;
 `#endif`

-#ifndef Network_h
-#define Network_h
-
 class NetworkClass
wled00/data/settings_wifi.htm (1)

214-216: Indentation uses spaces instead of tabs.

The new options use spaces for indentation, but per coding guidelines, web UI files under wled00/data/ should use tabs for indentation. The existing options in this file use tabs.

As per coding guidelines, after editing web UI files, run npm run build to regenerate embedded headers.

Fix indentation to use tabs
-        <option value="15">TTGO T-ETH-Lite S3 (W5500) ☾</option> <!-- WLEDMM -->
-        <option value="16">WaveShare ESP32-S3-ETH (W5500) ☾</option> <!-- WLEDMM -->
-        <option value="17">W5500 Generic ☾</option> <!-- WLEDMM -->
+				<option value="15">TTGO T-ETH-Lite S3 (W5500) ☾</option> <!-- WLEDMM -->
+				<option value="16">WaveShare ESP32-S3-ETH (W5500) ☾</option> <!-- WLEDMM -->
+				<option value="17">W5500 Generic ☾</option> <!-- WLEDMM -->
wled00/wled.h (1)

356-356: Global ETH instance declaration follows WLED pattern.

The WLED_GLOBAL ETHClass2 ETH; declaration follows the established pattern for WLED global variables. This works correctly with the extern ETHClass2 ETH; declaration in Network.h.

Consider grouping this with other network-related globals (near line 645 with udpConnected etc.) for better organization, though this is a minor nitpick.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f391de and 8a114b2.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • package.json
  • wled00/const.h
  • wled00/data/settings_wifi.htm
  • wled00/network.cpp
  • wled00/src/dependencies/network/Network.h
  • wled00/wled.cpp
  • wled00/wled.h
  • wled00/wled_ethernet.h
🧰 Additional context used
📓 Path-based instructions (3)
wled00/**/*.{cpp,h}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use spaces (2 per level) for C++ firmware source and headers in wled00

Files:

  • wled00/const.h
  • wled00/wled.cpp
  • wled00/src/dependencies/network/Network.h
  • wled00/network.cpp
  • wled00/wled.h
  • wled00/wled_ethernet.h
wled00/data/**/*.{htm,html,css,js}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

wled00/data/**/*.{htm,html,css,js}: Use tabs for indentation in web UI files (.htm/.html/.css/.js) under wled00/data
After editing web UI files, run npm run build to regenerate embedded headers
Manually validate web UI changes via local HTTP server and browser

Files:

  • wled00/data/settings_wifi.htm
wled00/data/**/*.{htm,html,js,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Check the browser console for JavaScript errors after web UI changes

Files:

  • wled00/data/settings_wifi.htm
🧠 Learnings (9)
📚 Learning: 2025-10-22T21:50:25.839Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 270
File: usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h:155-157
Timestamp: 2025-10-22T21:50:25.839Z
Learning: In WLED-MM PR `#270`, only Effect (Mode) IDs are migrated to 16-bit; Palette IDs and counts remain 8-bit. Usermod code should widen mode-related indices/loops to uint16_t while keeping palette-related indices/loops as uint8_t.

Applied to files:

  • wled00/const.h
📚 Learning: 2025-10-12T21:55:59.766Z
Learnt from: CR
Repo: MoonModules/WLED-MM PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-12T21:55:59.766Z
Learning: Applies to wled00/html_*.h : Do not edit generated embedded web header files: wled00/html_*.h

Applied to files:

  • wled00/const.h
  • wled00/data/settings_wifi.htm
  • wled00/wled.h
  • wled00/wled_ethernet.h
📚 Learning: 2025-12-21T22:26:03.261Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 293
File: wled00/udp.cpp:668-669
Timestamp: 2025-12-21T22:26:03.261Z
Learning: In MoonModules/WLED-MM on 32-bit ESP32 platforms, changing pixel index variables to `int` type to align with the `setPixelColor(int, ...)` API signature is intentional and safe. Maximum pixel addresses are bounded by UINT16_MAX, and `setPixelColor()` performs internal overflow checks.

Applied to files:

  • wled00/const.h
  • wled00/wled.h
📚 Learning: 2025-12-28T09:48:59.612Z
Learnt from: netmindz
Repo: MoonModules/WLED-MM PR: 0
File: :0-0
Timestamp: 2025-12-28T09:48:59.612Z
Learning: In QEMU mode with WLED_QEMU flag, Network.cpp must check tcpip_adapter directly instead of using the ETH object, because ETH.begin() is skipped to avoid hardware register crashes. Without this, Network.isConnected() always returns false, preventing initInterfaces() and server.begin() from being called.

Applied to files:

  • wled00/wled.cpp
  • wled00/src/dependencies/network/Network.h
  • wled00/wled.h
📚 Learning: 2025-11-02T22:07:15.689Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 0
File: :0-0
Timestamp: 2025-11-02T22:07:15.689Z
Learning: In MoonModules/WLED-MM, WLEDMM_FASTPATH will become the default code path. Code inside "#ifndef WLEDMM_FASTPATH" blocks represents deprecated paths that are being phased out and should be ignored during reviews.

Applied to files:

  • wled00/wled.cpp
  • wled00/wled.h
📚 Learning: 2025-10-12T21:55:59.766Z
Learnt from: CR
Repo: MoonModules/WLED-MM PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-12T21:55:59.766Z
Learning: Applies to wled00/data/**/*.{htm,html,css,js} : After editing web UI files, run npm run build to regenerate embedded headers

Applied to files:

  • package.json
📚 Learning: 2025-10-12T21:55:59.766Z
Learnt from: CR
Repo: MoonModules/WLED-MM PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-12T21:55:59.766Z
Learning: Applies to wled00/**/*.{cpp,h} : Use spaces (2 per level) for C++ firmware source and headers in wled00

Applied to files:

  • wled00/wled.h
📚 Learning: 2025-07-02T23:22:57.175Z
Learnt from: netmindz
Repo: MoonModules/WLED-MM PR: 248
File: platformio.ini:1613-1613
Timestamp: 2025-07-02T23:22:57.175Z
Learning: In WLED platformio.ini, the particle system disable flags (WLED_DISABLE_PARTICLESYSTEM1D and WLED_DISABLE_PARTICLESYSTEM2D) are intentionally varied across different build environments based on platform memory constraints. More memory-limited platforms (like ESP8266, ESP32-C3, ESP32-S2) disable both 1D and 2D particle systems, while platforms with more available memory (like esp32_4MB_V4_S with 4MB flash) may only disable the 1D version to preserve flash space while keeping 2D functionality available.

Applied to files:

  • wled00/wled.h
📚 Learning: 2026-01-07T23:30:25.779Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 308
File: platformio.ini:560-560
Timestamp: 2026-01-07T23:30:25.779Z
Learning: In platformio.ini, ESP32-S3 environments intentionally have WLED_USE_SHARED_RMT commented out (keeping RMTHI driver enabled) for testing purposes, while ESP32-S2 has it enabled (using shared RMT driver) to avoid boot loops. This inconsistency is temporary while investigating why RMTHI causes interrupt watchdog resets on S3. Once the S3 issue is understood, both S2 and S3 will use the same driver flags.

Applied to files:

  • wled00/wled.h
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: wled_build / Builds (esp32S3_WROOM-2_M)
  • GitHub Check: wled_build / Builds (esp32c3dev_4MB_M)
  • GitHub Check: wled_build / Builds (abc_wled_controller_v43_V4_S)
  • GitHub Check: wled_build / Builds (esp32S3_8MB_S)
  • GitHub Check: wled_build / Builds (esp8266pro_16MB_M)
  • GitHub Check: wled_build / Builds (esp32S3_16MB_PSRAM_M_HUB75)
  • GitHub Check: wled_build / Builds (esp32s2_PSRAM_M)
  • GitHub Check: wled_build / Builds (esp32S3_4MB_PSRAM_S)
  • GitHub Check: wled_build / Builds (esp32s2_PSRAM_S)
  • GitHub Check: wled_build / Builds (esp32S3_8MB_PSRAM_M)
  • GitHub Check: wled_build / Builds (esp32_4MB_PSRAM_S)
  • GitHub Check: wled_build / Builds (esp32dev_compat)
  • GitHub Check: wled_build / Builds (esp32_4MB_M_eth)
  • GitHub Check: wled_build / Builds (esp32_16MB_V4_M_debug)
  • GitHub Check: wled_build / Builds (esp32_4MB_V4_M)
🔇 Additional comments (8)
wled00/src/dependencies/network/Network.h (1)

5-7: ETHClass2 integration looks correct for ESP32 path.

The replacement of ETH.h with ETHClass2.h and the extern declaration aligns with the corresponding WLED_GLOBAL ETHClass2 ETH definition in wled.h. This follows WLED's established pattern for global variables.

Based on learnings, verify that QEMU mode (with WLED_QEMU flag) still works correctly, as the learning notes that ETH.begin() is skipped in QEMU to avoid hardware register crashes.

wled00/const.h (2)

312-312: LGTM! Ethernet type count updated correctly.

The count is correctly updated from 15 to 18 to accommodate the three new W5500-based Ethernet types. The comment accurately reflects the additions.


329-331: New Ethernet type constants are well-defined.

The three new constants (15, 16, 17) are sequential and properly follow the existing WLED_ETH_OLIMEX_GTW (14). The naming convention is consistent with existing entries. These values align with the UI options added in settings_wifi.htm.

wled00/wled.h (1)

111-112: ETHClass2 integration is consistent across headers.

The replacement of ETH.h with ETHClass2.h matches the change in Network.h. Keeping the commented-out original include is helpful for future reference. As per coding guidelines, 2-space indentation is used correctly.

wled00/wled_ethernet.h (1)

21-58: Struct extension for SPI pins looks solid.
The added pin fields and type adjustments align with the new W5500 path and keep RMII compatibility intact.

wled00/network.cpp (2)

26-306: Board pin table updates look consistent.
The added SPI pin fields and new W5500 board entries integrate cleanly with the expanded settings structure.


372-392: Ethernet link diagnostics are a nice improvement.
The added link/speed/duplex logging plus the default event log should help with field debugging.

wled00/wled.cpp (1)

1051-1135: Dual‑path Ethernet init is clean and well‑guarded.
Pin allocation, failure handling, and success logging look consistent across W5500 and RMII branches.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@softhack007
Copy link
Collaborator

Checks will all fail because the exiting build environment is not prepped.

Ok, I can fix that. It's just that https://github.com/troyhacks/ETHClass2 is missing in lib_deps ?

@troyhacks
Copy link
Collaborator Author

Checks will all fail because the exiting build environment is not prepped.

Ok, I can fix that. It's just that https://github.com/troyhacks/ETHClass2 is missing in lib_deps ?

Yes, that and raising the platform package version.

@troyhacks
Copy link
Collaborator Author

troyhacks commented Jan 16, 2026

PXL_20260116_013439012.jpg

Even works on the ESP32-C3... which also surprised me at 64x64 (4096 pixels) over Art-Net at over 45 FPS with Particle Effects even.

(This did require me to use the standard libs and not Tasmora as is currently the package for the C3. And some swearing and many failed attempts to figure out how to get this C3 to boot at all - even before the W5500 code. 😁)

@troyhacks
Copy link
Collaborator Author

Ooo, CodeRabbit called me a pro. 🏆

@softhack007 softhack007 added this to the 14.8.1 milestone Jan 16, 2026
Copy link

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
wled00/network.cpp (1)

13-24: Fix array size mismatch in non-RMII fallback declaration.

The empty array esp32_nonconfigurable_ethernet_pins[] in the non-RMII case will cause out-of-bounds access. Code in xml.cpp:244 and cfg.cpp:749 unconditionally loop over WLED_ETH_RSVD_PINS_COUNT (6 iterations) when ethernet is enabled, regardless of the RMII configuration. If WLED_USE_ETHERNET is enabled but CONFIG_ETH_PHY_INTERFACE_RMII is not, these loops will access indices 0–5 of a zero-sized array.

Change the non-RMII fallback to match the declared size:

Fix
 `#else` 
-const managed_pin_type esp32_nonconfigurable_ethernet_pins[] = {};
+const managed_pin_type esp32_nonconfigurable_ethernet_pins[WLED_ETH_RSVD_PINS_COUNT] = {};
 `#endif`

@netmindz
Copy link
Collaborator

We can't merge until the builds are green

@netmindz
Copy link
Collaborator

  • platformio/framework-arduinoespressif32 has to be any version ABOVE 3.20009.0 (I tested the next higher and the latest version and both worked). This may not strictly be needed if someone wanted to figure out the one missing function and "backport" it somehow, but the easy method is to just use a slightly newer version.

So how do we change this? Using a never version overall of the V4 IDF or some other configuration?

Copy link
Collaborator

@netmindz netmindz left a comment

Choose a reason for hiding this comment

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

Failing builds need to be addressed prior to merge

Copy link

@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`:
- Around line 462-463: The platform_packages upgrade for the esp32_idf_V4
profile (platform_packages = platformio/framework-arduinoespressif32 @
3.20017.241212+sha.dcc1105b) is newer than the V4 baseline and must be validated
by building a representative environment; run a full build of at least one
common environment such as esp32_4MB_V4_M (and optionally one S3/S2/C3 variant)
using the updated platform/platform_packages settings to confirm there are no
compile or linker regressions, report any failures, and only merge once the
build(s) succeed or adjust the platform_packages back to a known-good version.

Copy link

@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 `@wled00/wled.h`:
- Around line 359-363: Network.h currently includes "ETHClass2.h" and declares
extern ETHClass2 ETH without the same IDF-version guard used in wled.h, causing
use of ETHClass2 when it's unavailable; wrap both the `#include` "ETHClass2.h" and
the declaration extern ETHClass2 ETH inside the identical conditional `#if`
ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 5) (and matching `#endif`) so
Network.h only references ETHClass2 for IDF >= 4.4.5 exactly as wled.h does.

Comment on lines 359 to 363
#ifndef ESP8266
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 5)
WLED_GLOBAL ETHClass2 ETH;
#endif
#endif
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for ETHClass2, global ETH instances, and extern ETH declarations
rg -n "ETHClass2|extern\s+.*\bETH\b|^\s*ETH\s+ETH" wled00/ --max-count=20

Repository: MoonModules/WLED-MM

Length of output: 293


🏁 Script executed:

#!/bin/bash
# Also search for WLED_GLOBAL with ETH context
rg -n "WLED_GLOBAL.*ETH" wled00/ --max-count=20

Repository: MoonModules/WLED-MM

Length of output: 363


🏁 Script executed:

#!/bin/bash
# Find ETHClass2 definition/class
rg -n "class\s+ETHClass2|typedef.*ETHClass2" --max-count=20

Repository: MoonModules/WLED-MM

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check wled00/wled.h around lines 359-363 for guards
sed -n '350,370p' wled00/wled.h

Repository: MoonModules/WLED-MM

Length of output: 921


🏁 Script executed:

#!/bin/bash
# Check Network.h around lines 6-7 for guards
sed -n '1,20p' wled00/src/dependencies/network/Network.h

Repository: MoonModules/WLED-MM

Length of output: 411


🏁 Script executed:

#!/bin/bash
# Find and examine ETHClass2.h
find wled00 -name "ETHClass2.h" -type f

Repository: MoonModules/WLED-MM

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Find ETHClass2.h location
find wled00 -name "ETHClass2.h" -type f

Repository: MoonModules/WLED-MM

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check ETHClass2.h for any global ETH definitions
cat wled00/libraries/network/ETHClass2.h | head -100

Repository: MoonModules/WLED-MM

Length of output: 131


🏁 Script executed:

#!/bin/bash
# Search for ETHClass2.h file
find wled00 -name "ETHClass2.h" 2>/dev/null

Repository: MoonModules/WLED-MM

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Broader search for ETHClass2
find . -name "*ETHClass2*" 2>/dev/null | head -20

Repository: MoonModules/WLED-MM

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check git ls-files for any ETHClass2 files
git ls-files | grep -i ethclass

Repository: MoonModules/WLED-MM

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Search for where ETHClass2 might be defined (could be in Arduino libraries)
rg "class\s+ETHClass2|typedef.*ETHClass2" --type cpp --type h | head -20

Repository: MoonModules/WLED-MM

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check if ETHClass2 is from Arduino SDK or included from elsewhere
rg "#include.*ETHClass2" -B 5 -A 5

Repository: MoonModules/WLED-MM

Length of output: 1223


🏁 Script executed:

#!/bin/bash
# Check what guards are around the extern declaration in Network.h
sed -n '1,15p' wled00/src/dependencies/network/Network.h

Repository: MoonModules/WLED-MM

Length of output: 284


🏁 Script executed:

#!/bin/bash
# Check if ETHClass2.h is in the repo or expected from Arduino SDK
find . -type f -name "*.h" | xargs grep -l "class ETHClass2" 2>/dev/null

Repository: MoonModules/WLED-MM

Length of output: 47


🏁 Script executed:

#!/bin/bash
# Check for uses of ETH in Network.cpp to understand the dependency
rg "ETH\." wled00/src/dependencies/network/Network.cpp -n | head -20

Repository: MoonModules/WLED-MM

Length of output: 486


🏁 Script executed:

#!/bin/bash
# Get full context of IDF version guards in wled.h
sed -n '108,120p' wled00/wled.h

Repository: MoonModules/WLED-MM

Length of output: 488


🏁 Script executed:

#!/bin/bash
# Check if there's an alternate ETH definition or include for IDF < 4.4.5
sed -n '108,125p' wled00/wled.h

Repository: MoonModules/WLED-MM

Length of output: 601


🏁 Script executed:

#!/bin/bash
# Verify Network.h has no IDF version guard around extern
sed -n '1,12p' wled00/src/dependencies/network/Network.h | cat -n

Repository: MoonModules/WLED-MM

Length of output: 339


🏁 Script executed:

#!/bin/bash
# Check full Network.h header to ensure no other guards missed
head -20 wled00/src/dependencies/network/Network.h | cat -n

Repository: MoonModules/WLED-MM

Length of output: 551


🏁 Script executed:

#!/bin/bash
# Verify there's no conditional compilation elsewhere
rg "ifdef|if.*IDF.*VERSION" wled00/src/dependencies/network/Network.h

Repository: MoonModules/WLED-MM

Length of output: 77


🏁 Script executed:

#!/bin/bash
# Search for where ETHClass2 comes from - check if it's defined locally or expected from SDK
rg "ETHClass2" -t cpp -t h | grep -v "extern\|#include\|WLED_GLOBAL" | head -10

Repository: MoonModules/WLED-MM

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Verify that for IDF < 4.4.5, there's a fallback to standard ETH.h in wled.h
rg "#include <ETH\.h>" wled00/

Repository: MoonModules/WLED-MM

Length of output: 161


Guard the extern declaration in Network.h to match wled.h's IDF version checks.

The extern ETHClass2 ETH; declaration in wled00/src/dependencies/network/Network.h (line 7) is not guarded by IDF version, but wled00/wled.h conditionally includes ETHClass2.h only for IDF ≥ 4.4.5 and falls back to standard <ETH.h> for earlier versions. This mismatch will cause Network.h to reference the non-existent ETHClass2 type when IDF < 4.4.5. Wrap the #include "ETHClass2.h" and extern ETHClass2 ETH; in Network.h with the same #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 5) guard to ensure consistency.

🤖 Prompt for AI Agents
In `@wled00/wled.h` around lines 359 - 363, Network.h currently includes
"ETHClass2.h" and declares extern ETHClass2 ETH without the same IDF-version
guard used in wled.h, causing use of ETHClass2 when it's unavailable; wrap both
the `#include` "ETHClass2.h" and the declaration extern ETHClass2 ETH inside the
identical conditional `#if` ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 5) (and
matching `#endif`) so Network.h only references ETHClass2 for IDF >= 4.4.5 exactly
as wled.h does.

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.

3 participants