Help with #include for Ethernet Shield 2

Using Ethernet Shield 2
Using Arduino Uno R3

Using some existing code, these are the includes:

#include <SPI.h>
#include <Ethernet.h>
#include <SD.h>
#include <utility/w5100.h>
#include <utility/socket.h>

Since I am using the Ethernet Shield 2 I change the #include <Ethernet.h> to #include <Ethernet2.h>

This gives me a compile error for #include <utility/w5100.h> and #include <utility/socket.h>.
I am told I need to use the WizNet lib on github.

How do I go about getting it for the shield 2 and installing it?

I don't use the Ethernet2 library. I use this one. Follow the instructions to change the #define.

Sorry. I am lost. I have the Arduino IDE 1.7.10 and see no listing for it.
Also, the instructions do not match my installed directory structure.

IDE V1.7.10? If you are using the IDE from arduino.org, then you shouldn't need the ethernet2 library. I understand it self detects the wiznet IC. I could be wrong.

Now I am completely confused. I definitely have Arduino IDE 1.7.10

This is the download site: Arduino - Home

For V1.6.10, this is the download site: https://www.arduino.cc/en/Main/Donate

Anyone know what is going on?

You seem to be asking about .org software here at the .cc site. Maybe some folks use both. I only use the .cc IDE.

Other than that, I don't know.

SurferTim:
IDE V1.7.10? If you are using the IDE from arduino.org, then you shouldn’t need the ethernet2 library. I understand it self detects the wiznet IC. I could be wrong.

Yes. I am using the IDE from arduino.org (V1.7.10).

For me, I must specifically change #include <Ethernet.h> to #include <Ethernet2.h> or the Ethernet Shield 2 will not respond to a web request.

When applied, the #include <utility/w5100.h> and #include <utility/socket.h> cause a compile error.

The sketch I am attempting to modify is located here: http://playground.arduino.cc/Code/WebServerST

I can get the sketch to compile, load, and work if I comment out #include <utility/w5100.h> and #include <utility/socket.h> as shown:

#include <SPI.h>
#include <Ethernet.h>
#include <SD.h>
//#include <utility/w5100.h>
//#include <utility/socket.h>

Then, in addition remove the methods (proceedures) that use their utilities.
Specifically the three following proceedures and two lines:

void myStuff() {…)
void ShowSockStatus() {…)
void checkSockStatus() {…)

myStuff(); // the procedure call in loop()
byte socketStat[MAX_SOCK_NUM];

CrossRoads:
You seem to be asking about .org software here at the .cc site. Maybe some folks use both. I only use the .cc IDE.

Other than that, I don't know.

Thanks for your reply. Until now, I thought they were one in the same and again that now raises another issue as to which one I should be using.

jack0987:
Yes. I am using the IDE from arduino.org (V1.7.10).

...

Hey Jack,

Nobody here knows anything about the .org version if the IDE. Since 1.6 or so, it has diverged from 'our' IDE, of which the latest version is 1.6.9 (1.6.10 is an unlabeled beta or something, use it with extreme caution.) If you want to download 1.6.9, which is very stable, and try compiling with that, I'm sure you will get much more sympathetic and helpful replies.

Of course you could go to the .org forum and ask there. They may be able to help you with your current software. Personally I hope you stay. I believe that we have better support in this forum, due to the presence of many knowledgeable 'gurus'.

ChrisTenone:
Of course you could go to the .org forum and ask there. They may be able to help you with your current software. Personally I hope you stay. I believe that we have better support in this forum, due to the presence of many knowledgeable ‘gurus’.

I have changed to Arduino IDE 1.6.10 and the include problem has gone away and it did autodetect.
The code compiled, uploaded and seems to have run OK.

Thanks

Last I checked, the arduino.cc ethernet library does not autodetect the model of Wiznet IC. I will check the library code to verify this. edit: It does not autodetect. It assumes w5100, and the ethernet shield v2 is a w5500.

SurferTim:
Last I checked, the arduino.cc ethernet library does not autodetect the model of Wiznet IC. I will check the library code to verify this. edit: It does not autodetect. It assumes w5100, and the ethernet shield v2 is a w5500.

My knowledge is limited in this field right now and I think stock (the IDE you download from the Arduino.cc website) will not autodetect. I used your github link and changed the library to the 1.5 version offered there. The last step of the instructions said to change the *.h (?) file, but I looked at it and made no changes as it seemed to already be set to w5500.

That library is compatible with the w5100, w5200, and w5500 Wiznet ICs. It uses the w5500 by default. I have changed the define to use that library with the w5100 and it works great. It does not autodetect. The define must be changed manually.