Cannot get network shield to work

I purchased the Seeed Studios Ethernet shield today and cannot get it going at all there is little documentation, ive tried the sample program that is on their Wiki but no luck… The serial monitor is saying that my server is set at a given IP however when i navigate to that IP my browser says page not available. Im no networking genius but this is crazy.
my sketch
/*
Web Server

A simple web server that shows the value of the analog input pins.
using an Arduino Wiznet Ethernet shield.
*/

#include <SPI.h>
#include <EthernetV2_0.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,1,177);

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);
#define W5200_CS 10
#define SDCARD_CS 4

void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
pinMode(SDCARD_CS,OUTPUT);
digitalWrite(SDCARD_CS,HIGH);//Deselect the SD card
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
}

void loop() {
// listen for incoming clients
EthernetClient client = server.available();
if (client) {
Serial.println(“new client”);
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.write(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(“Connnection: close”);
client.println();
client.println("");
client.println("");
// add a meta refresh tag, so the browser pulls again every 5 seconds:
client.println("<meta http-equiv=“refresh” content=“5”>");
// output the value of each analog input pin
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
int sensorReading = analogRead(analogChannel);
client.print(“analog input “);
client.print(analogChannel);
client.print(” is “);
client.print(sensorReading);
client.println(”
“);
}
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();
Serial.println(“client disonnected”);
}
}

I am so sorry I have been fighting this all day... and it turns out my brother in law had pinched my cat5 new wire problem solved

Thought those electronics were small enough to get through anything... :slight_smile:

Glad you got it working..

I have been having the exact same problem with that sketch, or any sketch that includes EthernetV2_0.h. If I change it to Ethernet.h, all compile fine. Not sure if it is how I have the libraries installed, or what. Any suggestions on what to look for?

Are you using an ethernet shield with the w5200? If so, you must download and import the library for that IC.
Download the library from here.
http://www.seeedstudio.com/wiki/File:W5200_Ethernet_Shield_Library.zip
Then you can import it using the IDE.
Select Sketch/Import Library/Add Library

I obtain the following error compiling WebServerWthSD from the EthernetV2_0 library - can anybody help me. Thank you.

:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\EthernetV2_0.cpp: In member function ‘void EthernetClass::begin(uint8_t*, IPAddress, IPAddress, IPAddress, IPAddress)’:
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\EthernetV2_0.cpp:64:39: error: no matching function for call to ‘W5100Class::setIPAddress(IPAddress::&)’
W5100.setIPAddress(local_ip._address);
^
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\EthernetV2_0.cpp:64:39: note: candidate is:
In file included from C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\EthernetV2_0.cpp:1:0:
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\utility/w5200.h:410:6: note: void W5100Class::setIPAddress(uint8_t*)
void W5100Class::setIPAddress(uint8_t _addr) {
^
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\utility/w5200.h:410:6: note: no known conversion for argument 1 from ‘IPAddress::’ to 'uint8_t
{aka unsigned char*}’
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\EthernetV2_0.cpp:65:38: error: no matching function for call to ‘W5100Class::setGatewayIp(IPAddress::&)’
W5100.setGatewayIp(gateway._address);
^
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\EthernetV2_0.cpp:65:38: note: candidate is:
In file included from C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\EthernetV2_0.cpp:1:0:
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\utility/w5200.h:386:6: note: void W5100Class::setGatewayIp(uint8_t*)
void W5100Class::setGatewayIp(uint8_t _addr) {
^
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\utility/w5200.h:386:6: note: no known conversion for argument 1 from ‘IPAddress::’ to 'uint8_t
{aka unsigned char*}’
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\EthernetV2_0.cpp:66:38: error: no matching function for call to ‘W5100Class::setSubnetMask(IPAddress::&)’
W5100.setSubnetMask(subnet._address);
^
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\EthernetV2_0.cpp:66:38: note: candidate is:
In file included from C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\EthernetV2_0.cpp:1:0:
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\utility/w5200.h:394:6: note: void W5100Class::setSubnetMask(uint8_t*)
void W5100Class::setSubnetMask(uint8_t _addr) {
^
C:\Users\DP\Documents\Arduino\libraries\EthernetV2_0\utility/w5200.h:394:6: note: no known conversion for argument 1 from ‘IPAddress::’ to 'uint8_t
{aka unsigned char*}’
Error compiling.

I just compiled that sketch with IDE v1.0.6. No errors.

What IDE version are you using? Did you import the EthernetV2_0 library into the IDE? Did you close and restart the IDE?

I am using IDE v 1.6.0. I imported the EthernetV2_0 library from seeed into the IDE. None of the examples in that library compile. However, the SD in the shield works with the SD library.
Any idea? THANK YOU AGAIN.

A variable has changed in V1.6.0, and probably all v1.5.x also. it uses a union instead of an array.

You must find the folder where you have your sketches stored. In that folder is a folder called libraries, and in that folder should be a folder called EthernetV2_0. In that folder, open the file EthernetV2_0.cpp. At line 60, you will find this function, but it will be slightly different. Change the "_address" to "raw_address()" like below. It will compile, but I do not have a w5200 to check it with. Let me know if it works. I tested it with a w5100 and it worked.

This is the original code you must edit.

void EthernetClass::begin(uint8_t *mac, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
{
  W5100.init();
  W5100.setMACAddress(mac);
  W5100.setIPAddress(local_ip._address);
  W5100.setGatewayIp(gateway._address);
  W5100.setSubnetMask(subnet._address);
  _dnsServerAddress = dns_server;
}

Change it to this code.

void EthernetClass::begin(uint8_t *mac, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
{
  W5100.init();
  W5100.setMACAddress(mac);
  W5100.setIPAddress(local_ip.raw_address());
  W5100.setGatewayIp(gateway.raw_address());
  W5100.setSubnetMask(subnet.raw_address());
  _dnsServerAddress = dns_server;
}

edit: This will work with IDE v1.0.x also. I tested it with v1.0.5.
This has been corrected in the Seeed Studio version of this library on their Github site.

It still has this bug if you download it from the Seeed Studio wiki page.