Ethernet 2.0.0 Not compiling.

Hello all,

Hope you all are safe and doing well.

Ok so here I was trying to compile Ethernet 2.0.0 selecting chip esp8266 "Adafruit feather HUZZAH" . But I am getting errors.

It fails to Compile. I am trying to compile basic example provided "LinkStatus".

Below is the error.

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\libraries\Ethernet\src\Ethernet.cpp: In static member function 'static void EthernetClass::begin(uint8_t*, IPAddress, IPAddress, IPAddress, IPAddress)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\libraries\Ethernet\src\Ethernet.cpp:87:24: error: 'class IPAddress' has no member named '_address'

  W5100.setIPAddress(ip._address.bytes);

                        ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\libraries\Ethernet\src\Ethernet.cpp:88:29: error: 'class IPAddress' has no member named '_address'

  W5100.setGatewayIp(gateway._address.bytes);

                             ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\libraries\Ethernet\src\Ethernet.cpp:89:29: error: 'class IPAddress' has no member named '_address'

  W5100.setSubnetMask(subnet._address.bytes);

                             ^

delete the Ethernet library bundled with esp8266 Arduino core. the builder uses it and it is the old version

delete the Ethernet library bundled with esp8266 Arduino core.

I tried this, and that's when I got the error @I_think reported. The problem is the ESP8266 Core for Arduino platform's IPAddress class does not have the _address member used by the Ethernet 2.0.0 library:

this PR could help

it is merged

Good point Juraj!

I don't have time to actually wire up an Ethernet module to an ESP8266 board right now, but the sketch does compile when using the Ethernet library at the tip of the master branch. I know Paul Stoffregen did testing of the Ethernet library with ESP8266 for the 2.0.0 release, so I think it has a good chance of working.

@I_think if you want to give the beta testing version of the Ethernet library a try, do this:

  • Download the beta test version of the library: https://github.com/arduino-libraries/Ethernet/archive/master.zip
  • Unzip the downloaded file.
  • Delete the .zip file.
  • Rename the unzipped folder from Ethernet-master to Ethernet
  • (In the Arduino IDE) Sketch > Include Library > Add .ZIP Library
  • Select the Ethernet folder you got from the library download.
  • Click the "Open" button.
  • Try compiling the LinkStatus example sketch again.

I will test that. Also I will check with ESP and update here . Thanks.

WOW...................

It worked ...

Although I just tested the "Link Status" its working.

Thanks a ton.

I will replace this library with Ethernet2 and update it here.

Juraj:
this PR could help
compatibility for esp8266 core by d-a-v · Pull Request #96 · arduino-libraries/Ethernet · GitHub
it is merged

thanks

I'm glad to hear it's working. Thanks for taking the time to post an update.