ethernet2 on mega - code not working

hello
I bought an ethernet2-shield (W5500), not knowing that it was produced by arduino.org and not by arduino.cc. I tried to run different code-examples that ran well on an ethernet-shield (W5100) from arduino.cc.

But now I am stuck with an example using an SD-card (another example using SD worked well though). I really don't know what to do and find nothing on the internet. Can somebody help?

Code: cf attachment
Ethernet2-shield on arduino ATmega 2560, IDE arduino-nightly

thanks a lot!

fagus

ether_ardlab_h_05052016.ino (3.13 KB)

I tried to run different code-examples that ran well on an ethernet-shield (W5100) from arduino.cc.

The W5500 chip is a good chip, but it needs a different library. It's google time.

yes I know I've installed the ethernet2 library. All my other code examples run on the ethernet2-shield ...

Many here have better luck with the Wiznet library.

Download and unpack it. Find the folder where your sketches are stored, and locate the "libraries' folder there. Create a folder named "Ethernet" there and copy the contents of the "Arduino IDE v1.5.x" folder from the library into that libraries/Ethernet folder.

Use the standard "#include <Ethernet.h>". When you compile sketches using the ethernet library, you should get a warning that the IDE found two ethernet libraries, and it is using the one in the libraries folder where your sketches are stored.

After that, you may get a message that there is an update for the ethernet library available. DO NOT update. It will overwrite the new Wiznet library with the one from the IDE.

That library is compatible with all the Wiznet ethernet controllers. I use it with my W5100. It requires a define change in /utility/w5100.h if you use that library with any IC besides the W5500.

edit: If you are having problems starting the SD card, disable the W5500 SPI first.

void setup() {
  pinMode(10,OUTPUT);
  digitalWrite(10,HIGH);

  // rest of your setup

I am running a W5500 shield on a Mega2560 using the Wiz library as Surfer Tim described above and it works fine, and lots faster than the W5100

ok I did everything you said and it helped me out for 1 code. it works now. also cardinfo-code worked well, which was not the case yesterday.

but for the code in attachment it still doesn't work. it must be something stupid I suppose ... from my serial it seems it keeps hanging at line 20 ...

ether_ardlab_h_05052016.ino (3.13 KB)