Go Down

Topic: Debugging Web Client with Ethernet shield (Read 3 times) previous topic - next topic


Thank you so much Fubushi for helping me out. I can't express how much gratitude I have towards you.

You can find the packet dump here: http://dl.getdropbox.com/u/263645/Arduino/ArduinoWireSharkDump1.pcap

I'm using an ethernet cable connected to my Macbook. Using Apple OSX's internet sharing options. I have made sure I manually select the IP of the Macbook machine and have cross checked the subnet.

And I've included the code that I'm using just to make sure below:

Code: [Select]

#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 169, 254, 196, 50 };
byte server[] = { 74, 125, 67, 100 }; // Google
byte subnet[] = { 255, 255, 0, 0 };    //subnet mask of the network
byte gateway[] = { 169, 254, 196, 45 };   //your router's IP address

Client client(server, 80);

void setup()
 Ethernet.begin(mac, ip, gateway, subnet);
 if (client.connect()) {
   client.println("GET /search?q=arduino HTTP/1.0");
 } else {
   Serial.println("connection failed");

void loop()
 if (client.available()) {
   char c = client.read();

 if (!client.connected()) {

Any ideas?


Loads of ideas.

I will have to check out the OSX Internet Sharing and come back to you.

Can you ping the Arduino from the Mac?


With a little bit more time :)

Soo... The MacBook has (most likely given by autoconfiguration).
The Arduino has

The Mac answers the Arduino's ARP request, which is fine!

For some reason, the MacBook also seems to have

So far, so good.

Try the following:

Set the Arduino IP address to, the Gateway to and the netmask to


It works! :-)

Thank you so much. So what was going on there? And if I write about how to figure this out, how should I go about explaining that?

I'm assuming that the macbook takes two IPs and one of them is accessible to the internet and the other is local?


Yep, that is more or less it. :)

You can then use addresses in 192.168.2.x to share your connection.

Call it bad documentation on Apple's side.

Go Up