Dfrobot Ethernet Shield w5200 V1.1 Please Help

Hello I am having some difficulty with this ethernet shield I’ve been doing alot of research on the project that I am doing and troubleshooting but have not found anything. I simply at the moment am trying to assign a mac address and obtain an IP and be able to ping the apparatus using command prompt and a direct ethernet connection.

My Project:
Create an apparatus that can monitor sound and communicate the values to a mySQL database.

Components:
Arduino Uno R3
Arduino IDE V 1.0.6 (Researched that it couldnt work with newer version)
DFrobot Ethernet shield w5200 v1.1
Sparkfun Sound detector

Problem:
cant assign a Mac address or IP to board I’ve been using the sample W5200 webserver code from the library download example and trying to ping the device from my laptop on a static connection to see if im actually assigning a Mac and IP address.

Code:
Hello I am having some difficulty with this ethernet shield I’ve been doing alot of research on the project that I am doing and troubleshooting but have not found anything. I simply at the moment am trying to assign a mac address and obtain an IP and be able to ping the apparatus using command prompt and a direct ethernet connection.

My Project:
Create an apparatus that can monitor sound and communicate the values to a mySQL database.

Components:
Arduino Uno R3
Arduino IDE V 1.0.6 (Researched that it couldnt work with newer version)
DFrobot Ethernet shield w5200 v1.1
Sparkfun Sound detector

Problem:
cant assign a Mac address or IP to board I’ve been using the sample W5200 webserver code from the library download example and trying to ping the device from my laptop on a static connection to see if im actually assigning a Mac and IP address.
Hello I am having some difficulty with this ethernet shield I’ve been doing alot of research on the project that I am doing and troubleshooting but have not found anything. I simply at the moment am trying to assign a mac address and obtain an IP and be able to ping the apparatus using command prompt and a direct ethernet connection.

My Project:
Create an apparatus that can monitor sound and communicate the values to a mySQL database.

Components:
Arduino Uno R3
Arduino IDE V 1.0.6 (Researched that it couldnt work with newer version)
DFrobot Ethernet shield w5200 v1.1
Sparkfun Sound detector

Problem:
cant assign a Mac address or IP to board I’ve been using the sample W5200 webserver code from the library download example and trying to ping the device from my laptop on a static connection to see if im actually assigning a Mac and IP address.

Code:

/*
Web Server

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

Circuit:

  • Ethernet shield attached to pins 10, 11, 12, 13
  • Analog inputs attached to pins A0 through A5 (optional)

created 18 Dec 2009
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe

*/

#include <SPI.h>
#include <Ethernet.h>
//注意!官网的SPI接口使用的是 D10作为 SS接口,这里需要根据实际SS接线情况定义一次SS管脚
////端口定义Dreamer MEGA X1 PORT
//#define SS 53 //Gadgeteer PIN 6
//#define nRST 46 //Gadgeteer PIN 4
//#define nPWDN 45 //Gadgeteer PIN 5
//#define nINT 2 //Gadgeteer PIN 3

//端口定义Dreamer MEGA X2 PORT
#define SS 10 //Gadgeteer PIN 6
#define nRST 8 //Gadgeteer PIN 4
#define nPWDN 9 //Gadgeteer PIN 5
#define nINT 3 //Gadgeteer PIN 3

// 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,1);

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

void setup() {
////下面是非常重要的设置,如果没有可靠的复位设置,W5200可能不工作 !!! /////////
pinMode(SS,OUTPUT); //端口定义Dreamer MEGA X2 PORT Gadgeteer PIN 6 use SS
pinMode(nRST,OUTPUT);
pinMode(nPWDN,OUTPUT);
pinMode(nINT,INPUT);
digitalWrite(nPWDN,LOW); //enable power

digitalWrite(nRST,LOW); //Reset W5200
delay(10);
digitalWrite(nRST,HIGH);
delay(200); // wait W5200 work
/////////////////////////////////////////////////////////////
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

// 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”);
}
}

Sorry I didnt post my code right im new here :confused:

/*
Web Server

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

Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
* Analog inputs attached to pins A0 through A5 (optional)

created 18 Dec 2009
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe

*/

#include <SPI.h>
#include <Ethernet.h>
//注意!官网的SPI接口使用的是 D10作为 SS接口,这里需要根据实际SS接线情况定义一次SS管脚
////端口定义Dreamer MEGA X1 PORT
//#define SS 53 //Gadgeteer PIN 6
//#define nRST 46 //Gadgeteer PIN 4
//#define nPWDN 45 //Gadgeteer PIN 5
//#define nINT 2 //Gadgeteer PIN 3

//端口定义Dreamer MEGA X2 PORT
#define SS 10 //Gadgeteer PIN 6
#define nRST 8 //Gadgeteer PIN 4
#define nPWDN 9 //Gadgeteer PIN 5
#define nINT 3 //Gadgeteer PIN 3

// 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,1);

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

void setup() {
////下面是非常重要的设置,如果没有可靠的复位设置,W5200可能不工作 !!!! /////////
pinMode(SS,OUTPUT); //端口定义Dreamer MEGA X2 PORT Gadgeteer PIN 6 use SS
pinMode(nRST,OUTPUT);
pinMode(nPWDN,OUTPUT);
pinMode(nINT,INPUT); 
digitalWrite(nPWDN,LOW); //enable power

digitalWrite(nRST,LOW); //Reset W5200
delay(10);
digitalWrite(nRST,HIGH); 
delay(200); // wait W5200 work
/////////////////////////////////////////////////////////////
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


// 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("<!DOCTYPE HTML>");
client.println("<html>");
// 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("</html>");
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");
}
}

do you have the current version of the Ethernet library?

yes i have the Ethernet shield library from dfrobot installed into my ide

Dariustl2016:
yes i have the Ethernet shield library from dfrobot installed into my ide

try the new version of the Arduino Ethernet library. it supports the W5200. try the WebClient example of the updated Ethernet library first

I got a really large error it wouldnt even compile.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows NT (unknown)), Board: "Arduino Uno"
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In static member function 'static int EthernetClass::begin(uint8_t*, long unsigned int, long unsigned int)':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:36: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:36: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:39: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:46: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:50: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In static member function 'static void EthernetClass::begin(uint8_t*, IPAddress, IPAddress, IPAddress, IPAddress)':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:84: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:84: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:95: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In static member function 'static int EthernetClass::maintain()':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:137: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:137: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:141: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In static member function 'static void EthernetClass::MACAddress(uint8_t*)':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:155: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:155: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:157: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In static member function 'static IPAddress EthernetClass::localIP()':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:163: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:163: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:165: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In static member function 'static IPAddress EthernetClass::subnetMask()':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:172: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:172: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:174: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In static member function 'static IPAddress EthernetClass::gatewayIP()':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:181: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:181: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:183: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In member function 'void EthernetClass::setMACAddress(const uint8_t*)':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:189: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:189: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:191: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In member function 'void EthernetClass::setLocalIP(IPAddress)':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:196: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:196: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:199: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In member function 'void EthernetClass::setSubnetMask(IPAddress)':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:204: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:204: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:207: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In member function 'void EthernetClass::setGatewayIP(IPAddress)':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:212: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:212: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:215: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In member function 'void EthernetClass::setRetransmissionTimeout(uint16_t)':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:221: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:221: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:223: error: 'class SPIClass' has no member named 'endTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp: In member function 'void EthernetClass::setRetransmissionCount(uint8_t)':
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:228: error: 'class SPIClass' has no member named 'beginTransaction'
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:228: error: 'SPISettings' was not declared in this scope
C:\Users\dlashley\Documents\Arduino\libraries\Ethernet-master\src\Ethernet.cpp:230: error: 'class SPIClass' has no member named 'endTransaction'

The new version of the Ethernet library won't work with Arduino IDE 1.0.6. I would definitely try to use a recent version of the Arduino IDE. 1.0.6 is very outdated. What specific findings in your research indicated that you needed to use Arduino IDE 1.0.6?

you have now two Ethernet libraries? what is Ethernet-master? the DFRobot library?

Through research of different forums (this is the specific one)
https://www.dfrobot.com/forum/viewtopic.php?f=8&t=1654&p=7972&hilit=ethernet+shield+w5200+ethernet+shield#p7972

I found that the updated IDE didnt work

I also found that when i had 2 ethernet libraries it kept using the library that came with the IDE it kept pulling the non dfrobot library so i deleted it. the ethernet master is the original library i re downloaded from github.

(sorry id reply faster if i didnt have this 5 minute wait time)

the update of the Ethernet library supporting W5200 was published a month ago. every older forum topic or doc is obsolete.
install the current IDE and the current Ethernet library.

Completely deleted 1.8 and re downloaded and ran example code while changing ip to my static address i have set up, got this error.

avrdude: ser_open(): can't set com-state for "\.\COM6"
An error occurred while uploading the sketch

(ps I am leaving my workstation at my internship where i have the IDE installed but will be back tomorrow at 7:00 am if you dont hear from me i want to thankyou for your patience and your help)

Okay so no im having a problem with the com

I fixed it but there was no response to from the arduino when I pinged it with a static IP

Is the Ethernet shield connected to switch or router?

Its connected directly to my laptop

any other suggestions?

Dariustl2016:
Its connected directly to my laptop

that is the problem. did you setup a network between you computer and the arduino? you must use different network IP address set then on the other network interface of you computer. for example if your computer connects to LAN with 192.168.1.x, on the network interface connected to arduino use 192.168.2.1 and on arduino set 192.168.2.2. of course there is no DHCP on this small network. and to access the rest of the LAN from arduino, you must route traffic from 192.168.2.x network to 192.168.1.x network on the computer. the computer is the gateway of this network. and this network has no DNS server

Youre a genius the arduino is now communicating with the sample code i dont know what these analog input pins are communicating but its doing something

Ive got it to send sound sensor data now im working to send it into a mysql database i want to thankyou for all of your help truly