arduino-libraries / Ethernet

Ethernet Library for Arduino
http://arduino.cc/
257 stars 262 forks source link

ESP32, W5500 not responding for 5~50 seconds after every reboot #172

Closed wildstray closed 2 years ago

wildstray commented 2 years ago

On ESP32 with W5500 I'm experiencing this issue: when I reboot, Ethernet is responding for two seconds, then not responding for a variable time of 5~50 seconds, then responding again.

PING 10.1.1.254 (10.1.1.254) 56(84) bytes of data.
64 bytes from 10.1.1.254: icmp_seq=1 ttl=128 time=0.074 ms
64 bytes from 10.1.1.254: icmp_seq=2 ttl=128 time=0.126 ms
64 bytes from 10.1.1.254: icmp_seq=3 ttl=128 time=0.112 ms
64 bytes from 10.1.1.254: icmp_seq=4 ttl=128 time=0.118 ms
64 bytes from 10.1.1.254: icmp_seq=5 ttl=128 time=0.116 ms
64 bytes from 10.1.1.254: icmp_seq=6 ttl=128 time=0.074 ms

64 bytes from 10.1.1.254: icmp_seq=16 ttl=128 time=0.237 ms
64 bytes from 10.1.1.254: icmp_seq=17 ttl=128 time=0.108 ms

64 bytes from 10.1.1.254: icmp_seq=51 ttl=128 time=0.119 ms
64 bytes from 10.1.1.254: icmp_seq=52 ttl=128 time=0.149 ms
64 bytes from 10.1.1.254: icmp_seq=53 ttl=128 time=0.073 ms
64 bytes from 10.1.1.254: icmp_seq=54 ttl=128 time=0.073 ms
64 bytes from 10.1.1.254: icmp_seq=55 ttl=128 time=0.126 ms

This issue can be reproduced also with the simplest code from scratch...

#include <Ethernet.h>
byte _mac[6] = {0};
IPAddress ip (10,1,1,254);
IPAddress subnet (255,255,255,0);
IPAddress gateway (10,1,1,1);
IPAddress dns (10,1,1,1);

void setup()
{
    Serial.begin(115200);
    esp_read_mac(_mac, ESP_MAC_ETH);
    Ethernet.begin(_mac, ip, dns, gateway, subnet);
}
wildstray commented 2 years ago

Additional information: the platform I'm using is ProDino ESP32 Ethernet, I take for granted the Ethernet.init() and not mentioned in the code, but there is. SPI clock 24MHz, CS pin 33, RST pin 12.

wildstray commented 2 years ago

Ok, found that the issue was caused by spanning tree, turning it off on the switch the issue disappeared. Excuse me for bothering you!