Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
af6aa5b
Stash
troyhacks Jan 15, 2026
2bb2664
W5500 "onnected" but no IP yet.
troyhacks Jan 15, 2026
dc41ebb
W5500 working oin ESP32 for Quindor
troyhacks Jan 15, 2026
7037edd
Fix for non-W5500 Ethernet (wrrong ETH.begin() order)
troyhacks Jan 15, 2026
8a114b2
W5500 addition should work for S3 and others now too
troyhacks Jan 15, 2026
60d28a9
Allow SPI2_HOST if no SPI3_HOST
troyhacks Jan 15, 2026
830861a
Adding a line to reconfigure interfaces just in case - and worst case…
troyhacks Jan 19, 2026
6ccb057
First attempt, new libs
troyhacks Jan 20, 2026
b745f8c
Moving ETHClass2 to top env.
troyhacks Jan 20, 2026
f4b2dd8
More platform changes
troyhacks Jan 20, 2026
25eaa8f
Fixes for <huge sigh> ESP8266
troyhacks Jan 20, 2026
28bd512
Let's try needing min 4.4.5
troyhacks Jan 20, 2026
52c3eb9
More guards for older IDF versions
troyhacks Jan 20, 2026
164614b
More guards for old IDF versions
troyhacks Jan 20, 2026
42d2f1c
Check for platform W5500 support
troyhacks Jan 20, 2026
ff28c9c
Comfort for the elderly
troyhacks Jan 20, 2026
199d505
Comfort anything without ETH_PHY_W5500 defined
troyhacks Jan 20, 2026
84da8cb
Retest
troyhacks Jan 20, 2026
6079b48
Try this again
troyhacks Jan 20, 2026
ac1a4ca
Changing of the guard
troyhacks Jan 20, 2026
e11e1f3
Ignore ETHClass2 where not supported
troyhacks Jan 20, 2026
6091344
More comforts
troyhacks Jan 20, 2026
7db76e0
Put back in the original code for IDFv3
troyhacks Jan 20, 2026
f698f06
Duped definition
troyhacks Jan 20, 2026
e0c8b47
Ignore ETHClass2 on esp32_4MB_M_eth
troyhacks Jan 20, 2026
7cd1b2f
Try making one Tasmota that was oversized.
troyhacks Jan 20, 2026
a430386
Try that again but ignore the lib too
troyhacks Jan 20, 2026
cfcd2dd
Ignore the right lib this time. Case matters.
troyhacks Jan 20, 2026
b1f44d4
Moved some back to Tasmota and ignored ETHClass2
troyhacks Jan 20, 2026
4917c13
Missed one.
troyhacks Jan 21, 2026
83bff2d
Pinning ETHClass2 to a commit to make the rabbit shut up.
troyhacks Jan 21, 2026
a540b96
This is not in the right place. What place should it be in? I dunno!
troyhacks Jan 21, 2026
33feac9
Testing this one
troyhacks Jan 21, 2026
84b35af
Tidy
troyhacks Jan 21, 2026
286d95e
Added WaveShare_ESP32-S3-ETH
troyhacks Jan 21, 2026
a4d0822
Fixing places that deal with pins, like reserved pins and saviing pin…
troyhacks Jan 21, 2026
68e1790
Build fixes
troyhacks Jan 21, 2026
41512dd
Fix esp32_nonconfigurable_ethernet_pins
troyhacks Jan 21, 2026
43fe29d
managed_pin_type fixes
troyhacks Jan 21, 2026
214be9a
Juggling initializers
troyhacks Jan 21, 2026
32a0c7b
Testing intializers
troyhacks Jan 21, 2026
f676134
Another initializer
troyhacks Jan 21, 2026
10d70c7
Initializers
troyhacks Jan 21, 2026
9772e36
Hopefully this is it.
troyhacks Jan 21, 2026
05a3fdd
Merge branch 'MoonModules:mdev' into mdev+W5500
troyhacks Jan 21, 2026
d7564ca
Added -Wno-parentheses so HUB75 is easier to debug without a billion …
troyhacks Jan 21, 2026
0c0d6f0
Merge branch 'mdev+W5500' of https://github.com/troyhacks/WLED into m…
troyhacks Jan 23, 2026
30f21e4
Adding back package json files from mdev
troyhacks Jan 23, 2026
48cce64
Hide W5500 from Ethernet UI when not available.
troyhacks Jan 23, 2026
cebfccf
Re-order to make more logical sense
troyhacks Jan 23, 2026
a332198
User can modify SPI pins and specify them for W5500 Ethernet - if ava…
troyhacks Jan 23, 2026
742d8a2
@TroyHacks to @softhack007: This is just to make my builds go green w…
troyhacks Jan 23, 2026
b44a460
Removed -fno-rtti from animartrix_build_flags which is just a temp ha…
troyhacks Jan 23, 2026
d3cad9b
Testing
troyhacks Jan 23, 2026
3fbc4d1
Testing
troyhacks Jan 23, 2026
d9ffac6
Testing with fixes
troyhacks Jan 24, 2026
fdd1217
External ETHClass2 fixes to enable ETH_PHY_IP101
troyhacks Jan 24, 2026
f4e17cb
Testing v4.4.7 Tasmota and v4.4.7 regular libs
troyhacks Jan 24, 2026
85a6992
Guard for CONFIG_ETH_SPI_ETHERNET_W5500
troyhacks Jan 24, 2026
7ada26b
Quiet down HUB75 build output for testing
troyhacks Jan 24, 2026
3ee6d34
Fixes
troyhacks Jan 24, 2026
13e823d
More testing
troyhacks Jan 24, 2026
d3dbec7
What happens if all boards have Ethernet enabled and PSRAM? Testing!
troyhacks Jan 24, 2026
042735e
Testing minimal required versiona
troyhacks Jan 24, 2026
374c9e5
Typo
troyhacks Jan 24, 2026
e968e14
Trying the lowest required Tasmota
troyhacks Jan 24, 2026
33124b9
Testing a bold hack.
troyhacks Jan 24, 2026
0a5b8b3
Moving Tasmota up to the latest 4.4.7
troyhacks Jan 24, 2026
a920eed
Even bolder
troyhacks Jan 24, 2026
3501192
Less forcing W5500 support suggestion
troyhacks Jan 24, 2026
040c1a5
W5500 Support message
troyhacks Jan 24, 2026
37620e4
Testing
troyhacks Jan 24, 2026
d736a74
Fixes for esp32_nonconfigurable_ethernet_pins
troyhacks Jan 24, 2026
813a735
Fixes for boards without RMII
troyhacks Jan 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"pioarduino.pioarduino-ide",
"platformio.platformio-ide"
],
"unwantedRecommendations": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
"engines": {
"node": ">=20.0.0"
}
}
}
37 changes: 31 additions & 6 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ default_envs =
abc_wled_controller_v43_V4_S
athom_music_esp32_4MB_V4_M
adafruit_matrixportal_esp32s3 ;; HUB75 supported, uses standard bootloader
WaveShare_ESP32-S3-ETH ;; Easiest ESP32-S3 with W5500 Ethernet and USB-C for programming
; adafruit_matrixportal_esp32s3_tinyUF2 ;; supports the adafruit "tinyUF2" bootloader

; Go to MoonModules environments for environments
Expand Down Expand Up @@ -263,6 +264,7 @@ lib_deps =
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.4.2
bitbank2/AnimatedGIF@^1.4.7
https://github.com/Aircoookie/GifDecoder.git#bc3af189b6b1e06946569f6b4287f0b79a860f8e
https://github.com/troyhacks/ETHClass2.git#a260165ec495738f7fecee3a3bfb573f2a281ed7
#For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line
#TFT_eSPI
#For compatible OLED display uncomment following
Expand Down Expand Up @@ -326,6 +328,7 @@ lib_deps =
${esp8266.lib8266_deps} ;; use proven library versions for 8266
lib_ignore =
NeoESP32RmtHI
ETHClass2

;; compatibilty flags - same as 0.14.0 which seems to work better on some 8266 boards. Not using PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48
build_flags_compat =
Expand Down Expand Up @@ -412,7 +415,7 @@ board_build.flash_mode = dio
;; WLEDMM begin

;; tasmota platform - reduces firmaware size by ~280KB
platformTasmota = https://github.com/tasmota/platform-espressif32/releases/download/2023.06.02/platform-espressif32.zip ;; Tasmota Arduino Core 2.0.9 with IPv6 support, based on IDF 4.4.4
platformTasmota = https://github.com/tasmota/platform-espressif32/releases/download/2024.04.00/platform-espressif32.zip ;; Tasmota Arduino Core 2.0.15 with IPv6 support, based on IDF 4.4.4
platform_packagesTasmota =

;; ** For compiling with latest Frameworks (IDF4.4.x and arduino-esp32 v2.0.x) **
Expand All @@ -422,7 +425,7 @@ platformV4_packages_pre =
toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 ; required for platform version < 5.3.0, remove this line when upgrading to platform >=5.3.0
;;; standard V4 platform
platformV4 = espressif32@ ~6.3.2
platformV4_packages = platformio/framework-arduinoespressif32 @ 3.20009.0 ;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)
platformV4_packages = platformio/framework-arduinoespressif32 @ 3.20011.230801 ;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)

;;; experimental: latest V4 platform with latest arduino-esp32 2.0.14 + ESP-IDF 4.4.6 (may or may not work)
platformV4_xp = espressif32@ ~6.5.0
Expand All @@ -438,7 +441,8 @@ build_flagsV4 = -g
; -D WLEDMM_SLOWPATH ;; don't use I2S for LED bus
; -DARDUINO_USB_CDC_ON_BOOT=0 ;; mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
-D NO_GFX ; Disable the use of Adafruit_GFX by the HUB75 driver

-D BOARD_HAS_PSRAM
-D WLED_USE_ETHERNET
;;; V4.4.x libraries (without LOROL_LITTLEFS; with newer NeoPixelBus)
lib_depsV4 =
esp32async/AsyncTCP @ 3.4.7
Expand All @@ -458,12 +462,14 @@ lib_depsV4 =
;; platform = espressif32@ ~6.3.2
;; platform_packages = platformio/framework-arduinoespressif32 @ 3.20009.0 ;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)

;; Tasmota Arduino Core 2.0.9 with IPv6 support, based on IDF 4.4.4. Warning: all kernel error asserts removed
;; Tasmota Arduino Core 2.0.9 with IPv6 support, based on IDF 4.4.7. Warning: all kernel error asserts removed
platform = ${esp32.platformTasmota}
platform_packages = ${esp32.platform_packagesTasmota}

build_unflags = ${common.build_unflags}
build_flags = -g
-D BOARD_HAS_PSRAM
-D WLED_USE_ETHERNET
-Wshadow=compatible-local ;; emit warning in case a local variable "shadows" another local one
-DARDUINO_ARCH_ESP32 -DESP32
#-DCONFIG_LITTLEFS_FOR_IDF_3_2
Expand All @@ -473,6 +479,8 @@ build_flags = -g
-DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
; -D WLEDMM_TWOPATH ;; use I2S1 as the second bus --> slightly faster on some setups
; -D WLEDMM_SLOWPATH ;; don't use I2S for LED bus
-D BOARD_HAS_PSRAM
-D WLED_USE_ETHERNET
default_partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
lib_deps =
esp32async/AsyncTCP @ 3.4.7
Expand Down Expand Up @@ -511,7 +519,8 @@ build_flags = -g
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_CDC_ON_BOOT
; -D WLED_USE_SHARED_RMT ;; un-comment to use the standard RMT driver instead of RMTHI

-D BOARD_HAS_PSRAM
-D WLED_USE_ETHERNET
lib_deps =
esp32async/AsyncTCP @ 3.4.7
makuna/NeoPixelBus @ 2.7.9 ;; experimental - reduces LED glitches on -S2
Expand All @@ -538,7 +547,8 @@ build_flags = -g
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_CDC_ON_BOOT
-D WLED_USE_SHARED_RMT ;; don't use the RMTHI driver (not compatible with -C3)

-D BOARD_HAS_PSRAM
-D WLED_USE_ETHERNET
lib_deps =
esp32async/AsyncTCP @ 3.4.7
makuna/NeoPixelBus @ 2.7.9 ;; experimental
Expand Down Expand Up @@ -569,6 +579,8 @@ build_flags = -g
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_MODE, ARDUINO_USB_CDC_ON_BOOT
;-D WLED_USE_SHARED_RMT ;; un-comment to use the standard RMT driver instead of RMTHI
-D BOARD_HAS_PSRAM
-D WLED_USE_ETHERNET
lib_deps =
esp32async/AsyncTCP @ 3.4.7
makuna/NeoPixelBus @ 2.7.9 ;; experimental
Expand Down Expand Up @@ -1189,6 +1201,8 @@ AR_build_flags = -D USERMOD_AUDIOREACTIVE -D UM_AUDIOREACTIVE_USE_NEW_FFT ;; WLE
AR_lib_deps = https://github.com/softhack007/arduinoFFT.git#develop @ 1.9.2 ;; used for USERMOD_AUDIOREACTIVE - optimized version, 10% faster on -S2/-C3

animartrix_build_flags = -D USERMOD_ANIMARTRIX ;; WLEDMM usermod: CC BY-NC 3.0 licensed effects by Stefan Petrick
-fexceptions ; Enable (needed for try/catch)
;; @TroyHacks to @softhack007: This is just to make my builds go green with your new code. :)
animartrix_lib_deps = https://github.com/netmindz/animartrix.git#af02653aaabdce08929389ca16d0d86071573dd4 ;; custom PSRAM allocator
animartrix_lib_ignore = animartrix ;; to remove the animartrix lib dependancy (saves a few bytes)

Expand All @@ -1197,6 +1211,8 @@ DMXin_lib_deps = https://github.com/someweisguy/esp_dmx.git#47db25d8c515e76fabcf
DMXin_lib_ignore = esp_dmx ;; to remove the esp-dmx lib dependancy (saves a few bytes)

HUB75_build_flags =
-Wno-shadow ;; Shush, you.
-Wno-parentheses ;; Shush, you.
-D WLED_ENABLE_HUB75MATRIX ;; - requires ESP-IDF v4.4.x
;-D SPIRAM_FRAMEBUFFER ;; ONLY SUPPORTED ON ESP32-S3 VARIANTS WITH OCTAL (not quad) SPIRAM/PSRAM
-D NO_GFX ;; Disable the use of Adafruit_GFX by the HUB75 driver
Expand Down Expand Up @@ -3311,3 +3327,12 @@ build_flags = ${env:adafruit_matrixportal_esp32s3_wled.build_flags}
[env:adafruit_matrixportal_esp32s3]
;; this buildenv is just an alias for the matrixportal UF2 build, to keep 3rd party build tools happy.
extends = env:adafruit_matrixportal_esp32s3_wled

[env:WaveShare_ESP32-S3-ETH]
;; This is the easiest-to-use W5500 board as it has USB-C for programming
extends = env:esp32S3_16MB_PSRAM_M_HUB75
build_unflags = -D LEDPIN -D BTNPIN -D RLYPIN -D I2S_SDPIN -D I2S_CKPIN -D I2S_WSPIN -D ARDUINO_TTGO_T7_S3
build_flags = ${env:esp32S3_16MB_PSRAM_M_HUB75.build_flags}
-D WLED_USE_ETHERNET
-D WLED_ETH_DEFAULT=16
-D LEDPIN=-1 -D BTNPIN=-1 -D RLYPIN=-1 -D I2S_SDPIN=-1 -D I2S_CKPIN=-1 -D I2S_WSPIN=-1
93 changes: 78 additions & 15 deletions wled00/cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,35 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
CJSON(spi_mosi, hw_if_spi[0]);
CJSON(spi_sclk, hw_if_spi[1]);
CJSON(spi_miso, hw_if_spi[2]);

#ifdef CONFIG_ETH_SPI_ETHERNET_W5500
CJSON(spi_cs, hw_if_spi[3]);
CJSON(spi_int, hw_if_spi[4]);
CJSON(spi_rst, hw_if_spi[5]);

JsonObject hw_if_spi_use = hw[F("if")][F("spi-use")];
if (!hw_if_spi_use[F("use-for-w5500")].isNull()) {
spi_use_for_w5500 = hw_if_spi_use[F("use-for-w5500")].as<bool>();
if (spi_use_for_w5500) USER_PRINTLN("use-for-w5500 is TRUE");
if (!spi_use_for_w5500) USER_PRINTLN("use-for-w5500 is FALSE");
} else {
USER_PRINTLN("use-for-w5500 was not found");
}

PinManagerPinType spi[6] = { { spi_mosi, true }, { spi_miso, true }, { spi_sclk, true } , { spi_cs, true } , { spi_int, true } , { spi_rst, true } };
if (spi_mosi >= 0 && spi_sclk >= 0 && pinManager.allocateMultiplePins(spi, 6, PinOwner::HW_SPI)) {
if (!spi_use_for_w5500) {
#ifdef ESP32
SPI.begin(spi_sclk, spi_miso, spi_mosi); // SPI global uses VSPI on ESP32 and FSPI on C3, S3
#else
SPI.begin();
#endif
}
DEBUG_PRINTF("pinmgr success for global spi %d %d %d %d %d %d\n", spi_mosi, spi_miso, spi_sclk, spi_cs, spi_int, spi_rst);
} else {
DEBUG_PRINTF("pinmgr not success for global spi %d %d %d %d %d %d\n", spi_mosi, spi_miso, spi_sclk, spi_cs, spi_int, spi_rst);
}
#else
PinManagerPinType spi[3] = { { spi_mosi, true }, { spi_miso, true }, { spi_sclk, true } };
if (spi_mosi >= 0 && spi_sclk >= 0 && pinManager.allocateMultiplePins(spi, 3, PinOwner::HW_SPI)) {
#ifdef ESP32
Expand All @@ -362,7 +391,12 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
} else {
DEBUG_PRINTF("pinmgr not success for global spi %d %d %d\n", spi_mosi, spi_miso, spi_sclk);
}
#endif

// NOTE: Ethernet initialization must be deferred until after deserializeConfigFromFS() releases the JSON buffer lock
// and completes. Calling initEthernet() here can trigger async events that may try to serialize config while
// the lock is held, potentially corrupting cfg.json. The fromFS parameter signals this case.

//int hw_status_pin = hw[F("status")]["pin"]; // -1

JsonObject light = doc[F("light")];
Expand Down Expand Up @@ -682,6 +716,14 @@ void deserializeConfigFromFS() {
bool needsSave = deserializeConfig(doc.as<JsonObject>(), true);
releaseJSONBufferLock();

// Initialize Ethernet AFTER releasing the JSON buffer lock to prevent race conditions.
// Ethernet events can trigger async operations that may try to serialize config.
#if defined(WLED_USE_ETHERNET) && defined(CONFIG_ETH_SPI_ETHERNET_W5500)
if (spi_use_for_w5500 && spi_mosi >= 0 && spi_sclk >= 0) {
WLED::instance().initEthernet();
}
#endif

if (needsSave) serializeConfig(); // usermods required new parameters
}

Expand Down Expand Up @@ -742,25 +784,38 @@ void serializeConfig() {
wifi[F("phy")] = force802_3g;

#ifdef WLED_USE_ETHERNET

#ifndef CONFIG_ETH_SPI_ETHERNET_W5500
#define ETH_PHY_W5500 ETH_PHY_MAX
#endif

JsonObject ethernet = doc.createNestedObject("eth");
ethernet["type"] = ethernetType;
if (ethernetType != WLED_ETH_NONE && ethernetType < WLED_NUM_ETH_TYPES) {
JsonArray pins = ethernet.createNestedArray("pin");
for (uint8_t p=0; p<WLED_ETH_RSVD_PINS_COUNT; p++) pins.add(esp32_nonconfigurable_ethernet_pins[p].pin);
if (ethernetBoards[ethernetType].eth_power>=0) pins.add(ethernetBoards[ethernetType].eth_power);
if (ethernetBoards[ethernetType].eth_mdc>=0) pins.add(ethernetBoards[ethernetType].eth_mdc);
if (ethernetBoards[ethernetType].eth_mdio>=0) pins.add(ethernetBoards[ethernetType].eth_mdio);
switch (ethernetBoards[ethernetType].eth_clk_mode) {
case ETH_CLOCK_GPIO0_IN:
case ETH_CLOCK_GPIO0_OUT:
pins.add(0);
break;
case ETH_CLOCK_GPIO16_OUT:
pins.add(16);
break;
case ETH_CLOCK_GPIO17_OUT:
pins.add(17);
break;
for (uint8_t p = 0; p < WLED_ETH_RSVD_PINS_COUNT; p++) pins.add(esp32_nonconfigurable_ethernet_pins[p].pin);
if (ethernetBoards[ethernetType].eth_power >= 0) pins.add(ethernetBoards[ethernetType].eth_power);
if (ethernetBoards[ethernetType].eth_mdc >= 0) pins.add(ethernetBoards[ethernetType].eth_mdc);
if (ethernetBoards[ethernetType].eth_mdio >= 0) pins.add(ethernetBoards[ethernetType].eth_mdio);
if (ethernetBoards[ethernetType].eth_miso_pin >= 0) pins.add(ethernetBoards[ethernetType].eth_miso_pin);
if (ethernetBoards[ethernetType].eth_mosi_pin >= 0) pins.add(ethernetBoards[ethernetType].eth_mosi_pin);
if (ethernetBoards[ethernetType].eth_cs_pin >= 0) pins.add(ethernetBoards[ethernetType].eth_cs_pin);
if (ethernetBoards[ethernetType].eth_rst_pin >= 0) pins.add(ethernetBoards[ethernetType].eth_rst_pin);
if (ethernetBoards[ethernetType].eth_int_pin >= 0) pins.add(ethernetBoards[ethernetType].eth_int_pin);
if (ethernetBoards[ethernetType].eth_sclk_pin >= 0) pins.add(ethernetBoards[ethernetType].eth_sclk_pin);
if (ethernetBoards[ethernetType].eth_type != ETH_PHY_W5500) {
switch (ethernetBoards[ethernetType].eth_clk_mode) {
case ETH_CLOCK_GPIO0_IN:
case ETH_CLOCK_GPIO0_OUT:
pins.add(0);
break;
case ETH_CLOCK_GPIO16_OUT:
pins.add(16);
break;
case ETH_CLOCK_GPIO17_OUT:
pins.add(17);
break;
}
}
}
#endif
Expand Down Expand Up @@ -889,6 +944,14 @@ void serializeConfig() {
hw_if_spi.add(spi_mosi);
hw_if_spi.add(spi_sclk);
hw_if_spi.add(spi_miso);
#ifdef CONFIG_ETH_SPI_ETHERNET_W5500
hw_if_spi.add(spi_cs);
hw_if_spi.add(spi_int);
hw_if_spi.add(spi_rst);

JsonObject spi_use = hw_if.createNestedObject(F("spi-use"));
spi_use[F("use-for-w5500")] = (spi_use_for_w5500) ? spi_use_for_w5500 : false;
#endif

//JsonObject hw_status = hw.createNestedObject("status");
//hw_status["pin"] = -1;
Expand Down
14 changes: 13 additions & 1 deletion wled00/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
#define BTN_TYPE_TOUCH_SWITCH 9 //WLEDMM not yet supported

//Ethernet board types
#define WLED_NUM_ETH_TYPES 15 //WLEDMM +1 for Olimex ESP32-Gateway
#define WLED_NUM_ETH_TYPES 18 //WLEDMM +1 for Olimex ESP32-Gateway + 3 for W5500

#define WLED_ETH_NONE 0
#define WLED_ETH_WT32_ETH01 1
Expand All @@ -326,6 +326,9 @@
#define WLED_ETH_LILYGO_T_POE_PRO 12
#define WLED_ETH_GLEDOPTO 13
#define WLED_ETH_OLIMEX_GTW 14
#define WLED_ETH_TTGO_T_ETH_LITE_S3 15
#define WLED_ETH_WAVESHARE_ESP32_S3_ETH 16
#define WLED_ETH_W5500_GENERIC 17

//Hue error codes
#define HUE_ERROR_INACTIVE 0
Expand Down Expand Up @@ -608,6 +611,15 @@
#ifndef HW_PIN_MISOSPI
#define HW_PIN_MISOSPI -1 //WLEDMM if not defined -1 will be used (not MISO/19)
#endif
#ifndef HW_PIN_CSSPI
#define HW_PIN_CSSPI -1 //WLEDMM if not defined -1 will be used (not MISO/19)
#endif
#ifndef HW_PIN_INTSPI
#define HW_PIN_INTSPI -1 //WLEDMM if not defined -1 will be used (not MISO/19)
#endif
#ifndef HW_PIN_RSTSPI
#define HW_PIN_RSTSPI -1 //WLEDMM if not defined -1 will be used (not MISO/19)
#endif

// WLEDMM: IRAM_ATTR for 8266 causes error: section `.text1' will not fit in region `iram1_0_seg'
// error only in MM, not in upstream... tbd: find out why
Expand Down
7 changes: 7 additions & 0 deletions wled00/data/settings_um.htm
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,13 @@
addField("if:MOSI", "pin", -1, false);
addField("if:MISO", "pin", -1, false);
addField("if:SCLK", "pin", -1, false);
// W5500-specific fields - only show if server supports W5500 (detected by checking if spi-use object exists)
if (json.hw?.if?.["spi-use"]) {
addField("if:CS", "pin", -1, false);
addField("if:INT", "pin", -1, false);
addField("if:RST", "pin", -1, false);
addField("if:use_for_w5500", "use", json.hw.if["spi-use"]["use-for-w5500"] ?? false);
}
}
if (isO(umCfg)) {
//WLEDMM: read url parameter. e.g. um=AudioReactive and if set only add the usermod with the same name
Expand Down
5 changes: 4 additions & 1 deletion wled00/data/settings_wifi.htm
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ <h3>Wireless Remote</h3>

<div id="ethd">
<h3>Ethernet Type</h3>
<select name="ETH">
<select name="ETH" id="eth_boards">
<option value="0">None</option>
<option value="6">IoTorero/ESP32Deux/RGB2Go</option>
<option value="9">ABC! WLED V43 & compatible</option>
Expand All @@ -211,6 +211,9 @@ <h3>Ethernet Type</h3>
<option value="3">WESP32</option>
<option value="1">WT32-ETH01</option>
<option value="13">Gledopto</option>
<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 -->
</select><br><br>
</div>
<hr>
Expand Down
Loading
Loading