Arduino Ethernet board (not shield) and ping

I've been trying to connect to an Arduino Ethernet board via HTTP or telnet,
but I find that even ping returns "no route to host". The board simply
hangs, with no output even from startup(), when the EthernetClient is initialised.

The telnet client is a pretty simple program of a few lines copied directly
from the examples, so I can't see it as a programming problem - all I've added
is a serial connection so that I can check progress.

Does the Arduino Ethernet board use the same code as the Ethernet Shield,
and can anyone think how I can track the problem through the EthernetClient
library?

Thanks - Will

I've been trying to connect to an Arduino Ethernet board via HTTP or telnet,
but I find that even ping returns "no route to host".

That is a routing newbie error. You are probably assigning an ip that is not in the localnet of the router interface, or an upstream interface localnet that you forgot to route.

Alas, no. The ethernet socket and the board Rx leds light up on ping, so the packets
are getting there - the (standard example) sketch simply hangs on boot.

Looking at the bus with Wireshark shows a very odd DHCP packet as the first thing
the Arduino sends, so the next problem is to find out what's going on there.

I'd hoped the Arduino software would be a bit more reliable by now, but that's life.

"Request timed out" is the response you should get if the shield did not initialize correctly.

"No route to host" is the message when there is no interface (add: in the router) with that subnet routed through it. That is router talk for "I don't know where that subnet is".

How are you setting the Arduino? Are you assigning a static ip or using dhcp to get an ip? If you are using dhcp, you should use code something like this:

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

   // disable the SD SPI interface.
   // this will interfere with the dhcp call if not disabled
   pinMode(4,OUTPUT);
   digitalWrite(4,HIGH);

   pinMode(5,OUTPUT);
   digitalWrite(5,LOW);

   pinMode(6,OUTPUT);
   digitalWrite(6,LOW);

//   Serial.println("Starting dhcp request");

   if(Ethernet.begin(mac) == 0)
   {
      digitalWrite(5,HIGH);
//      Serial.println("No dhcp");
   }
   else
   {
      digitalWrite(6,HIGH);
//      Serial.println("Dhcp ok");
   }

   // rest of the setup stuff
}

What is the last message displayed on the serial monitor?

edit: If you are using an IDE older than v1.0.1 (like v1.0 or v0022), you might need to apply the "605 bug" fix also.
http://code.google.com/p/arduino/issues/detail?id=605

My bad on the serial output. The Arduino Ethernet (not the shield) has no usb port for the serial monitor, does it? I would change those serial messages to two digital pins for a test. Use digital pins 5 and 6 as OUTPUTs and change the pins to indicate the status. A voltmeter should tell you what is happening by the voltage on the pins. I changed the code to use those pins and commented out the serial outputs.

Thanks - that cracked it. I didn't realise that 1.0.1 existed, so when I used that,
used a 192.168.1.xxx address, and connected to the Arduino by a flipped cable
and not through a hub, ping worked.

The distribution examples seem a bit flakey - from your sketch, none of their
initialisation code is needed, and in fact hangs the sketch. I don't think turning
off the SD port is needed, either - the sketch works ok without it; since I want to
use both Ethernet and SD, I'll have to dig further.

I'm running the board through a USB=>Serial converter, so the Serial.print stuff
is fine.

Thanks again - after three or four days I was starting to suspect I'd got a dead
board, but with ping working I know the hardware itself is good, which is a relief.

Will

The examples may have a few typos or errors. They had to be changed to match v1.0 format.

Disabling or initializing the SD SPI is not needed, but is highly recommended. The alternative is suffering from the same problems I had with it. It only took me about a week of serious frustration to discover that was the problem. You will start to get trash on the SPI, but now right away. Mine would be fine for 8 to 24 hours, then trash, then crash. :frowning:

I'd hoped the Arduino software would be a bit more reliable by now, but that's life.

Thanks - that cracked it. I didn't realise that 1.0.1 existed, so when I used that, used a 192.168.1.xxx address, and connected to the Arduino by a flipped cable and not through a hub, ping worked.

Its always the arduino! :slight_smile: