Hi all,
I am having great trouble getting anything working with my Arduino Pro (3.3V) and the attached [Ethernet Shield. I’m using the Arduino 0022 IDE. I’ve tried using the built in Ethernet library (both WebServer and WebClient examples) with no luck. The Link, 100M, and Full Duplex LED’s are on, and the RX LED blinks once in awhile.
Here’s the code for the WebServer:
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x36, 0x6F };
//BU IP
//byte ip[] = { 128, 197, 180, 226 };
//illuminati IP
byte ip[] = { 192, 168, 1, 100 };
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
Server server(80);
void setup()
{
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
server.begin();
}
void loop()
{
// listen for incoming clients
Client client = server.available();
if (client) {
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.print(c);
// if you've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so you can send a reply
if (c == '\n' && currentLineIsBlank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
// output the value of each analog input pin
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
client.print("analog input ");
client.print(analogChannel);
client.print(" is ");
client.print(analogRead(analogChannel));
client.println("
");
}
break;
}
if (c == '\n') {
// you're starting a new line
currentLineIsBlank = true;
}
else if (c != '\r') {
// you've gotten a character on the current line
currentLineIsBlank = false;
}
}
}
// give the web browser time to receive the data
delay(1);
// close the connection:
client.stop();
}
}
Everything compiles and uploads fine, but I can’t ping the board from my laptop (I am able to ping the router and other computers on the network). I also do not see the board as an “Attached Device” in my router settings. And when I type the IP address in a browser the page does not display.
I have also tried the EthernetDHCP library as seen [here. When I try the PollingDHCP example the code is stuck in “Discovering Servers…”. I found [here that the EthernetDHCP library may not be compatible with the Arduino 0022 IDE, so I have even tried compiling/uploading the code with version 0018.
I’m kind of running out of options so I would love any help.](http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1283931573)](http://gkaindl.com/software/arduino-ethernet/dhcp)](Arduino Ethernet Shield - DEV-09026 - SparkFun Electronics)