arduino-libraries / Ethernet

Ethernet Library for Arduino
http://arduino.cc/
259 stars 264 forks source link

ESP32 - W5500 communications error #246

Closed philm001 closed 10 months ago

philm001 commented 10 months ago

Hello all,

I have been having some trouble recently trying to get my ESP32 to communicate with the W5500 chip.

I have my pinouts as follow:

SCK - 18 MISO - 19 MOSI - 23 SS - 0

What happens is that on these lines here:

writeMR(0x08);
    int someValue = readMR();
    Serial.println(String(someValue));
    if (someValue != 0x08) return 0;
    writeMR(0x10);
    someValue = readMR();
    Serial.println(String(someValue));
    if (someValue != 0x10) return 0;
    writeMR(0x00);
    if (readMR() != 0x00) return 0;

the variable someValue always returns 0. So it is as if the ESP32 is unable to communicate with the W5500. I tried the dev board that uses the W5100 and I am able to communicate with that chip. However, for some reason, I am unable to. Here is a snippet of my initilization code:

Serial.println("Enabling SPI");
    SPI.begin(SCLK_PIN, MISO_PIN, MOSI_PIN);
    Ethernet.init(SS_PIN);
    Ethernet.begin(mac, ip);

    Serial.println(Ethernet.hardwareStatus());

From what I can tell, I am not doing anything wrong. Please let me know

per1234 commented 10 months ago

Hi @philm001. The "esp32" boards platform installation includes its own variant of the "Ethernet" library:

https://github.com/espressif/arduino-esp32/tree/master/libraries/Ethernet

That "platform bundled" library is used when you compile for an ESP32 board, not the standard "Ethernet" library that is hosted in this library.

So reports of problems using the "Ethernet" library with ESP32 boards are off topic for this issue tracker.

philm001 commented 10 months ago

Hello thank you for your feedback. I am actually not using the ETH library provided by the ESP32. Mainly because that library does not support the W5500 chip. Later versions of the core do support it, however, there is some issue with Espressif in releasing the SDK and as such the version 3.0 (which supports the W5500 chip) is not functional.

I am left to using the Ethernet Arduino library