Hi there,
just received my Ethernet shield yesterday and I think it may be broken, here's my setup:
- Arduino UNO
- Ethernet Shield R3 (mac: 90-A2-DA-00-E4-4B
- laptop: 192.168.1.123/24 <- apache is running on it
- Arduino: 192.168.1.2/24
The shield is directly cabled to my laptop with a cross-over cable I can successfully ping the arduino from the PC.
I tried the examples that came with the Ethernet library but none on them worked so I used a "debug" program.
here it is:
#########
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xE4, 0x4B };
byte ip[] = { 192,168,1,2 };
byte subnet[] = { 255, 255, 255, 0 };
byte gateway[] = { 192,168,1,1 };
byte server[] = { 192,168,1,123 };
EthernetClient client;
void setup() {
Ethernet.begin(mac, ip, subnet, gateway);
Serial.begin(9600);
delay(1000);
if (!client.connect(server, 80))
Serial.println("Cannot connect to IP !");
else
Serial.println("connected to IP !");
}
void loop()
{
client.println("GET / HTTP/1.0");
delay(5000);
}
#########
When I check the logs from the apache server I receive a lots of garbage before the "GET / HTTP/1.0" sentence.
here's the apache output:
error.log:
[Sat Jan 28 16:46:43 2012] [error] [client 192.168.1.2] request failed: error reading the headers
access.log:
192.168.1.2 - - [28/Jan/2012:16:47:49 +0100]
"Z\xfa[\x9c1\x04\xa1{M\x06#\x8be\xb0\x10\xe9i:\xfd_\x94vI\\Tu\xc8@\xa5\xfa\xbf52\xeeD\x06ig\xa0\xb5n\b@\xec\x10\xd9\xf8k\xd5\xcd<\xdc\xc6\xde\xd7\x0f\x13\xc4\x02\x9c\xeb\xd9dwM\x8b}\xd5\x94T\xf4\t\x94G\x02\x88\xa2=\x8a\x03\xc5\xc0,\xc4\xbe\xd1\x83\x92\xe2\xa5\xcb\x84|\xc7,\x859Ys\xbce\xc5\xc3w>\x02=\xda\x0f\x05\x01\x80\x93e\xecn;\xc5\x84\x9f\xdd\xcb\xef\xb3\xf1$\xf7\x85\x98=0*\x8a\xcd"
400 301 "-" "-"
The problem is the same if the arduino act as server, the client that connects to it also get the garbage and is unable to parse the request.
H.E.L.P
Thanks
Romain