The sketch mounted on the arduino is the same of the first page with the same IP address (even if I modifie it there is no resolution of the problem) and mac modified:
/* FILE: ARD_Ethernet_Shield_HCARDU0034_Example.pde
DATE: 25/04/13
VERSION: 0.2
This is an example of how to use the HobbyComponents Arduino Ethernet shield
(HCARDU0033). This Ethernet shield is based on the W5100 Ethernet controller and
is compatible with the standard Aduino Ethernet libraries. It requires no additional
libraries to work.
This program will serve a basic webpage at the ip address specified below. As an
example of content, the webpage contains the current status of the 6 analogue input
pins.
REVISIONS:
V0.1 Initial version
V0.2 Added line to configure pin 53 as an output on Mega's to stop the SPI
master potentially being configured as a slave by hardware.
You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used directly for the purpose of selling products that
directly compete with Hobby Components Ltd's own range of products.
THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/
#include <SPI.h>
/* Include the standard Ethernet library */
#include <Ethernet.h>
/* MAC address of the Ethernet shield. If you are using this on your
own network, then the MAC address below will be fine, but remember if
you use more than one shield on your network they will need to be assigned
unique MAC addresses */
byte mac[] = { 0x12, 0x51, 0x62, 0x29, 0x92, 0x21 };
/* The IP address of the shield. Make sure this matches the IP
address range of your network and is not in use by any other
device on it */
IPAddress ip(192, 168, 1, 55 );
/* The port number the shield will respond to. Use port 80
for standard HTTP requests */
EthernetServer server(80);
/* Start the Ethernet interface */
void setup()
{
//pinMode(53, OUTPUT); //Uncomment this line if using a Mega
Ethernet.begin(mac, ip);
server.begin();
}
void loop()
{
/* All client requests are terminated with a blank line. This flag will
signify if the current line received from this client is a blank line */
boolean bBlankLineFlag = true;
/* Used to hold the current byre received from the client */
char cCurrentByte;
/* Loop counter used for reading the 6 analogue inputs */
int k;
/* Wait for a request from a client */
EthernetClient ethernet = server.available();
if (ethernet)
{
/* Continue to read data from the client one byte at a time until
there is no more data */
while (ethernet.connected())
{
/* Is there still data available to be read? ethernet class
ethernet.connected() returns the number of bytes available */
if (ethernet.available())
{
/* If data is available read the next byte */
cCurrentByte = ethernet.read();
/* If the next byte read is a new line termination ? */
if (cCurrentByte == '\n')
{
/* If so was it a blank line? */
if (bBlankLineFlag)
{
/* If it was then we can now send a response to the client’s http request... */
ethernet.println("HTTP/1.1 200 OK");
ethernet.println("Content-Type: text/html");
ethernet.println();
/* ...and add some useful content by reading the 6
analogue inputs and returning their status */
ethernet.println("<body>");
ethernet.println("<big><span style=\"font-weight: bold;\">
www.hobbycomponents.com Ethernet Shield Example</span></big><br>");
ethernet.println("****************************************************<br>");
for (k = 0; k < 6; k++)
{
ethernet.println("Analogue input ");
ethernet.print(k);
ethernet.print(": ");
ethernet.print(analogRead(k));
ethernet.print("<br>");
}
ethernet.println("****************************************************<br>");
ethernet.println("</body>");
/* Disconnect from the client */
ethernet.stop();
}
/* The last received byte was the start of a new line so flag as no
data received for this line yet */
bBlankLineFlag = true;
/* If the last byte received wasn't a new line then it must be data... */
} else if (cCurrentByte != '\r')
{
/* ...and so flag this as not a blank line. */
bBlankLineFlag = false;
}
}
}
}
}
The leds active on the ethernet are always the same:
No part of the shield's PCB is coming into contact with my Arduino board:
The results is always the same: no connection...