I recently purchased a SainSmart Arduino Mega2560 + SainSmart Ethernet Sheild w/SD card.
I have gotten the SD card to function correctly, but I'm having difficulty with the Ethernet. I can have the Arduino setup an IP Address using DHCP, but whenever I try connecting to a server, for example using the WebClient example (v1.01), it always fails to connect.
I have seen in a variety of forums that you have to modify the pins and spi.h file to get the Mega to play nicely with the Ethernet chip, but the board is labeled "Mega Compatible". I even saw where you still have to set Hardware SS (Pin 53) as an output to make the SPI library function.
I use the ethernet shield with a Mega2560. You need to initialize both devices (w5100 and SD) correctly if you want to use them together. The setup code in this link works for me.
edit: Insure you are using IDE v1.0.1. I had problems with the ethernet library prior to that.
I ran the code you linked to and both the ethernet and SD card initialized fine. Does this mean I just have issues on the network end, not the Arduino?
Like I said before, I can get an IP Address using DHCP, but I'm not able to connect to anywhere.
If it initialized ok, then the network should be fine. That required dhcp to start.
Once you have the two set up, now you must get the code for each to work together. I use this code for a test. It downloads Google home page every 10 seconds. Change the server ip to yours, and see if you can download the home page from there.
It disables the SD card while testing the download.
I did not say anything about pin 53. I'm on a Mega. I used the code I posted on my Mega 2560 with your Google server ip, and it downloaded that Google webpage ok.
I reverted back to using pin 10, but no change. Is there anything in the indicator lights that might tell me something? I see the Link and RX lights flashing but never the TX
So I did some more digging and this is what I found:
I traced the failure back through the different .cpp files. It starts here in EthernetClient.cpp, even though I modified it to give me some more debug info about how far it got in the process.