Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ethernet option #4575

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 1 deletion wled00/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
#define BTN_TYPE_TOUCH_SWITCH 9

//Ethernet board types
#define WLED_NUM_ETH_TYPES 13
#define WLED_NUM_ETH_TYPES 14

#define WLED_ETH_NONE 0
#define WLED_ETH_WT32_ETH01 1
Expand All @@ -386,6 +386,7 @@
#define WLED_ETH_SERG74 10
#define WLED_ETH_ESP32_POE_WROVER 11
#define WLED_ETH_LILYGO_T_POE_PRO 12
#define WLED_ETH_THIRSTYICE 13

//Hue error codes
#define HUE_ERROR_INACTIVE 0
Expand Down
3 changes: 2 additions & 1 deletion wled00/data/settings_wifi.htm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
select.appendChild(option);

if (input.value === "" || input.value === "Your_Network" || found) input.replaceWith(select);
else select.remove();
else select.remove();
}
}

Expand Down Expand Up @@ -225,6 +225,7 @@ <h3>Ethernet Type</h3>
<option value="5">TwilightLord-ESP32</option>
<option value="3">WESP32</option>
<option value="1">WT32-ETH01</option>
<option value="13">Thirstyice</option>
</select><br><br>
</div>
<hr>
Expand Down
24 changes: 17 additions & 7 deletions wled00/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ const ethernet_settings ethernetBoards[] = {

// ABC! WLED Controller V43 + Ethernet Shield & compatible
{
1, // eth_address,
5, // eth_power,
23, // eth_mdc,
33, // eth_mdio,
1, // eth_address,
5, // eth_power,
23, // eth_mdc,
33, // eth_mdio,
ETH_PHY_LAN8720, // eth_type,
ETH_CLOCK_GPIO17_OUT // eth_clk_mode
},
Expand All @@ -134,7 +134,7 @@ const ethernet_settings ethernetBoards[] = {
ETH_PHY_LAN8720, // eth_type,
ETH_CLOCK_GPIO0_OUT // eth_clk_mode
},

// LILYGO T-POE Pro
// https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-Series/blob/master/schematic/T-POE-PRO.pdf
{
Expand All @@ -144,6 +144,17 @@ const ethernet_settings ethernetBoards[] = {
18, // eth_mdio,
ETH_PHY_LAN8720, // eth_type,
ETH_CLOCK_GPIO0_OUT // eth_clk_mode
},

// Thirstyice's ethernet hookup
// (Same as Quinled-Dig-Octa, but uses GPIO0 instead of GPIO17)
{
1, // eth_address,
-1, // eth_power,
23, // eth_mdc,
18, // eth_mdio,
ETH_PHY_LAN8720, // eth_type,
ETH_CLOCK_GPIO0_OUT // eth_clk_mode
}
};

Expand Down Expand Up @@ -206,7 +217,7 @@ bool initEthernet()
/*
For LAN8720 the most correct way is to perform clean reset each time before init
applying LOW to power or nRST pin for at least 100 us (please refer to datasheet, page 59)
ESP_IDF > V4 implements it (150 us, lan87xx_reset_hw(esp_eth_phy_t *phy) function in
ESP_IDF > V4 implements it (150 us, lan87xx_reset_hw(esp_eth_phy_t *phy) function in
/components/esp_eth/src/esp_eth_phy_lan87xx.c, line 280)
but ESP_IDF < V4 does not. Lets do it:
[not always needed, might be relevant in some EMI situations at startup and for hot resets]
Expand Down Expand Up @@ -425,4 +436,3 @@ void WiFiEvent(WiFiEvent_t event)
break;
}
}