Sainsmart Ethernet Shield a fail?

Hi,

I bought the
http://www.sainsmart.com/arduino-compatibles/sainsmart-uno-atmega328p-pu-atmega8u2-microcontroller-for-arduino.html

and the

but it does not seem that it is the right shild because there is a lot of space between the two shields...
http://s1.directupload.net/images/130416/cvvc9le3.jpg

Or is this normal?
If not which shield should I use for the SainSmart UNO ATMEGA328P-PU ATMEGA8U2 Microcontroller For Arduino?

I tried the ethernet examples but they don't work.
Basic -> Blink works

There will be a gap between the shield and the Arduino.
edit: Insure the pins on the RJ45 connector are not touching the USB housing. They look very close to touching in that pic.

Try the SPI test sketch on this link.

Does the serial monitor show the correct ip?

Hi,

I put in the code that you gave me
http://s1.directupload.net/images/130416/oqfcgooz.png
and lift the ethernet shield a little bit up so there is space between the pins.
As you can see the left sketch uploadet successfully and the right not.
Any ideas?

Remove the ethernet shield from the Arduino and try the upload again. That appears to be a bootloader issue, not code.

And you are sure the RJ45 pins on the bottom of the shield are not touching the Arduino USB housing?

I did 2 things

  • I removed the ethernet shield completely from the arduino.
  • Removed and inserted the usb cable at the arduino.
  • started the arduino program and tried to upload the sample codes
  • got the same result as in the picture of my previous post
  • I removed the ethernet shield completely from the arduino.
  • Removed the usb cable at the arduino.
  • Put the ethernet shield on top of arduino and controlled that there is enough space between the ethernet shield and the arduino
  • inserted the usb cable at the arduino
  • started the arduino program and tried to upload the sample codes
  • got the same result as in the picture of my previous post

In both cases the blink example works but the other sample code did not work.
What do you mean with the bootloader how can I repair/reinstall the bootloader?

Edit:
Think will send the 2 boards back and get an original arduino uno + original arduino ethernet.
Sainsmart seems to be not so good.

Try compiling and uploading this code. Does it compile, then fail to upload?

#include <SPI.h>

void setup() {
  Serial.begin(9600);

  // disable SD card if one in the slot
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  SPI.begin();
}

void loop() {
  Serial.println("tick");
  delay(1000);
}

SurferTim:
Try compiling and uploading this code. Does it compile, then fail to upload?

#include <SPI.h>

void setup() {
 Serial.begin(9600);

// disable SD card if one in the slot
 pinMode(4,OUTPUT);
 digitalWrite(4,HIGH);

SPI.begin();
}

void loop() {
 Serial.println("tick");
 delay(1000);
}

Hi,

I got a crazy result.
I compiled/uploadet it nearly 15 times.
1-14. error as in the screenshot that I postet
15. upload works and serial monitor shows me "tick".
Don't know whats the reason for.
Just like lottery

I use Arduino 1.0.4 on Mac OS X 10.8.3
maybe its a Mac problem?

I got a crazy result.
I compiled/uploadet it nearly 15 times.
1-14. error as in the screenshot that I postet
15. upload works and serial monitor shows me "tick".
Don't know whats the reason for.
Just like lottery

Was that with the ethernet shield attached, or without it? Maybe a power problem? The w5100 is a bit power hungry compared to the Arduino processors.

SurferTim:

I got a crazy result.
I compiled/uploadet it nearly 15 times.
1-14. error as in the screenshot that I postet
15. upload works and serial monitor shows me "tick".
Don't know whats the reason for.
Just like lottery

Was that with the ethernet shield attached, or without it? Maybe a power problem? The w5100 is a bit power hungry compared to the Arduino processors.

It was attached.
This is a good idea with the power.

You need to find out if this is a hardware or software issue. Remove the ethernet shield and test all the code again, starting with that last code I posted. The SPI test with the Ethernet.begin() will compile, upload, and run without the shield attached. It will just fail, and print 0.0.0.0 for an ip. But that will determine if it is the ethernet library or the shield.

SurferTim:
You need to find out if this is a hardware or software issue. Remove the ethernet shield and test all the code again, starting with that last code I posted. The SPI test with the Ethernet.begin() will compile, upload, and run without the shield attached. It will just fail, and print 0.0.0.0 for an ip. But that will determine if it is the ethernet library or the shield.

Ok i tried the last example
and got a similar result.
The ethernet was not attached.

Sometimes it did not work

Some tries later it works
http://s7.directupload.net/images/130416/tn8gqk9t.png

Is this normal for an arduino?
Thought it should be "deterministic" that it
a) works always or
b) works never
but not the middle of a) and b).

The energy just comes out of an imac usb maybe its too less also if it is just 1 arduino without an ethernet shield?

Edit:

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,2,2);

void setup() {
Serial.begin(9600);

// disable SD card if one in the slot
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);

Serial.println("Starting w5100");
Ethernet.begin(mac,ip);

Serial.println(Ethernet.localIP());
}

void loop() {
}

Also works after a lot of tries.

Sounds like it may be a power issue. If it is that unreliable, it is either a bad connection from the computer to the usb port on the Arduino, or power. Check both.

SurferTim:
Sounds like it may be a power issue. If it is that unreliable, it is either a bad connection from the computer to the usb port on the Arduino, or power. Check both.

Thx