-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
ESP32 ETH.h linkUp never reports true #6105
Comments
Yep, this is a bug indeed, introduced recently as it used to work just fine. arduino-esp32/libraries/Ethernet/src/ETH.cpp Lines 517 to 524 in caef400
The enum There are other functions which currently lack implementation too, like |
Hello, can you please retest this on v2.0.3-rc1? |
This also still has the same code as when it was reported: 2.0.3-RC1: arduino-esp32/libraries/Ethernet/src/ETH.cpp Lines 541 to 548 in 1e388a2
|
Adding to the roadmap. |
As I understand it, it has not been repaired to this day? |
That's correct. It is a seriously hacky fix, but at least it is workable. |
I have so far bypassed this problem by using a low-quality pin and connecting it directly to the LEDlink of the network card :) As I understand it, the same implementation problem does not allow changing the settings from a static address to DHCP, without reinitializing ETH.begin(); |
please tell me what procedure you are performing this? |
Well my code is rather complex and to be honest I hate how complex it has become to overcome all quirks regarding WiFi and now also Ethernet events and things not working how you'd expect them to. Example of how I keep track of states while establishing a connection: Implementation of my The subnet mask is also just an IP address: |
My own quick fix was: bool ETHClass::fullDuplex()
{
#ifdef ESP_IDF_VERSION_MAJOR
eth_duplex_t link_duplex;
esp_eth_ioctl(eth_handle, ETH_CMD_G_DUPLEX_MODE, &link_duplex);
return (link_duplex == ETH_DUPLEX_FULL);
#else
return eth_config.phy_get_duplex_mode();
#endif
}
bool ETHClass::linkUp()
{
#ifdef ESP_IDF_VERSION_MAJOR
return WiFiGenericClass::getStatusBits() & ETH_CONNECTED_BIT;
#else
return eth_config.phy_check_link();
#endif
} Not sure if this could be definitive, but it looks good to me, except the |
Thanks @ppescher |
Board
ESP32 All
Device Description
LoLin D32 Pro. ESP32-CAM, TTGO - all
Hardware Configuration
LAN 8720 Ethernet Adapter
Version
v2.0.1
IDE Name
Arduino 1.8.1
Operating System
ESP32
Flash frequency
1
PSRAM enabled
yes
Upload speed
900k+
Description
ETH.h has no code that ever sets the link up flag to true. This results the linkUp function to always report false even when the link is up and passing data. The link up flag is used when compiled for any ESP32 platform.
Sketch
Example sketch from the repository modified to call ETH.linkUp and print result.
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: