Ethernet Shield: Immediate Hang. I need help!

Well, geez. I was doing so well with this Arduino thing. Sensors hooked up, LEDs a 'blinkin, code compiles great... and then I plugged in the Ethernet shield.

I can't get this thing to do squat. At first, I thought perhaps I had a connectivity issue, so I tried a ping. No host. So I started backtracking through the code, simplifying & simplifying some more.

I ended up at what you see below, code that does nothing more than send serial messages for debug, and try to initialize the ethernet. Even that, with no other code, does nothing. I get the "initializing ethernet..." message in the serial console, and then squat. Seems like once ethernet.begin() is called, the whole thing grinds to a halt. Here's the code;

#include <Ethernet.h>
#define byte uint8_t

byte mac[] = { 0xAD, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 101 };
byte gateway[] = { 192, 168, 1, 100 };
byte mask[] = { 255, 255, 255, 0 };

void setup()
{
  Serial.begin(9600);
  delay(2000);
  Serial.println("initializing ethernet...");
  Ethernet.begin(mac, ip, gateway, mask);
  Serial.println("done.");
}

void loop() 
{

}

"done." never appears on the console. The most basic thing I could hope to do with the ethernet shield has failed... :-?

I have tried;

-recompile/re-upload
-reset button on arduino
-reset button on shield
-ethernet cable plugged in
-ethernet cable unplugged

What next? This is depressing.

Are you certain of your routers ip addressing scheme? Most routers by default use 192.168.x.y where x is usually a 1 or a 0 depending on the brand. If you are certain of the ip scheme, your gateway address is suspicious. Generally the gateway will be 192.168.x.1

Are you certain of your routers ip addressing scheme? Most routers by default use 192.168.x.y where x is usually a 1 or a 0 depending on the brand. If you are certain of the ip scheme, your gateway address is suspicious. Generally the gateway will be 192.168.x.1

Thanks for the reply!

As far as I'm aware, these settings should have no bearing on if the board initializes properly. Regardless, the gateway you're seeing listed there is my laptop, which is acting as a bridge to my router.

IF I did binary conversion correctly in my head, the leading 0xAD in your MAC address makes it a multicast address, which is not valid as a MAC address for an actual NIC.

Try using the 0xDE in the example, or 0x02, or anything that has the last bit cleared and the next-to-last bit set.

-j

I made the above changes, to no avail.

Could this have anything to do with the fact that my Arduino inexplicably thinks pin 13 is HIGH all the time, even when unconnected, and pin 13 is one of the pins the shield uses to communicate?

Is there some way I can change the communication pins and jumper wire the shield to see if that is the problem?

Could this have anything to do with the fact that my Arduino inexplicably thinks pin 13 is HIGH all the time, even when unconnected, and pin 13 is one of the pins the shield uses to communicate?

Well, yeah!

I have no idea why your arduino (or its pin 13 LED) thinks that pin 13 is high all the time. If by "all the time" you mean literally all the time the Arduino is powered, it seems a pretty reasonable indication that there is a hardware problem, and a hardware problem on pin 13 would certainly prevent the ethernet shield from functioning.

-j

Aha! Hopefully the culprit!

Yes, it is literally all the time. So much so that the on-board pin 13 LED is lit any time pin 13 is set to OUTPUT, regardless of sketch, and nothing plugged in. I also wrote this code to test the inverse;

void setup() {
  for (int i=10; i<=13; i++) {
    pinMode(i, INPUT);
  }
  Serial.begin(9600);
}

void loop() {
  for (int i=10; i<=13; i++) {
    if (digitalRead(i) == HIGH) {
      Serial.println(i);
    }
    delay(500);
  }
}

Which sits there happily printing

13
13
13
13

in my serial console with absolutely nothing connected to the board. Also if you digitalWrite(13, HIGH), the internal LED will go OFF, but an external LED connected to pin 13 will turn ON. :o

My Arduino is an Illuminato, one of the first run from Liquidware. I contacted them about the issue about 4 days ago, and have yet to hear anything in return to acknowledge the oddity. I think perhaps I have a bum unit, but I'm too green of a user to identify a lemon right off.

I have nearly ordered a Duemilanove in frustration, but I am trying to save money. Plus, the Illuminato is such beautiful kit, I'd really prefer to use it (and have it work properly!!).

Shall I assume there is a hardware issue?

I have no experience with the Illuminato board; I'll have to leave this one to someone else.

-j

I understand your reluctance to pass judgement.

Is there a way I can edit the Ethernet library to use other pins, for further testing before I come to a conclusion? Poking about in the files didn't yield an obvious variable, but perhaps I simply don't know what to look for.

Thank you very much for your help!

The SPI hardware is tied to those particular pins on a standard arduino (13 is SCK, IIRC). There is no way to use any other pins without a) major rewiring, b) major rewriting of the library, and c) loss of performance as a result of giving up the dedicated SPI hardware.

Glancing at the schematic, I'm not even sure the Illuminato uses the same signal and pin mapping as the Arduino. It's a completely different processor.

You'll need to get help from the Illuminato folks for this one.

-j

Much appreciated. I'll try to get further feedback from them!

Well, 7 days have passed and I have been unable to get so much as a peep out of anyone from Liquidware about this issue. Very surprising and unsatisfactory. >:(

Also worth noting, I was forced to buy a Duemilanove just so I could have something to develop on, and it works seamlessly with the Ethernet shield.

Liquidware claims that the Illuminato works with any Arduino shield... :-X

EDIT: It is worth noting that I understand this is a product created by the hard work of just a few individuals. As such, imperfections can be expected. I do not expect immediate resolution, merely some form of communication acknowledging my issues, and indicating some sort of response will be forthcoming.

If the ethernet board uses an alternate functions of the IO pin (specifically SCK in this case), then that could explain the problem with it running on the Illuminato.

The theory is this: since the Illuminato uses a different processor, its alternate pin functions do not map 1 to 1 as the original Arduino processors. For example the SCK pin is on PB5 on the Mega 168, and SCK is on pin PB1 on the 645 (used on the illuminato).

If this theory holds true, then any shield that uses the pins as digital or analog I/O should work - but shields using their alternate functions (like SCK in this case) wont work as the pin mappings are different.

Just a theory, and welcome feedback and actually hope I'm proven wrong.

Just a theory, and welcome feedback and actually hope I'm proven wrong.

The glance I took at the datasheet tells me that's exactly what is happening.

-j

The glance I took at the datasheet tells me that's exactly what is happening.

That would be a serious oversight if so, considering they claim compatibility with any shield, and I ordered the Ethernet shield from them in the same shipment as the Illuminato...

Update; Mike from Liquidware has contacted me, and is eager to resolve the issue. Much better late than never! :slight_smile:

Howdy! that's really weird... AZRobbo (thanks) just emailed saying you'd posted here... I don't check the forums all the time :frowning: No "we" here, just me, matt... ok, I'm gonna see what's going on. I haven't done too much with the ethernet shield before, so i can't really say one way or another.

The part that makes me wish I knew what happened though is i don't know where your email went? I can't find it? Did I just totally miss it? Ugh... I usually respond to every email like in a couple hours (in between meetings at the day job). My fault :frowning: Serves me right for trying to do "open source" hardware stuff on the side (and it just got worse too with all the economy stuff going on...). Anyway, my real email is inthebitz at gmail ... goes straight to me!

by the way "Mike from Liquidware" sounds really funny... sounds a bit like "Peggy from Accounting" or "Bob from Finance" or "Jim from IT" :slight_smile:

that's funny because mike and i literally just met each other on forums, and got together to build an illuminato... much less formal than it seems!

Matt, thanks! It's really hard to keep track of you guys! I can't tell who's who and who's what! ;D

But I am getting help now, and that's all I could ever ask for!

Any updates on this? Did you manage to get the ethernet shield working? I am about to start a project that needs some ram and flash memory and I was hoping to use the illuminato because of the standard shield form factor.