Ethernet Shield

I have been trying to figure out how to put my sensor data i get off of my arduino onto a webpage. I have the ethernet shield but i seem to be stuck.

I have tried just using a piece of given code of of the arduino website to test if it works at all.
Here it is:

Chat Server

A simple server that distributes any incoming messages to all
connected clients. To use, telnet to your device’s IP address and type.
You can see the client’s input in the serial monitor as well.
Using an Arduino Wiznet Ethernet shield.


  • Ethernet shield attached to pins 10, 11, 12, 13

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


#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.
// gateway and subnet are optional:
byte mac = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
IPAddress ip(192, 168, 1, 9);
IPAddress myDns(192,168,1, 1);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);

// telnet defaults to port 23
EthernetServer server(23);
boolean alreadyConnected = false; // whether or not the client was connected previously

void setup() {
// initialize the ethernet device
Ethernet.begin(mac, ip, myDns, gateway, subnet);
// start listening for clients
// Open serial communications and wait for port to open:
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only

Serial.print(“Chat server address:”);

void loop() {
// wait for a new client:
EthernetClient client = server.available();

// when the client sends the first byte, say hello:
if (client) {
if (!alreadyConnected) {
// clear out the input buffer:
Serial.println(“We have a new client”);
client.println(“Hello, client!”);
alreadyConnected = true;

if (client.available() > 0) {
// read the bytes incoming from the client:
char thisChar =;
// echo the bytes back to the client:
// echo the bytes to the server as well:

When is go to on my browser it just simply doesn’t work. It says “This Webpage is not available”. And the arduino is plugged into a LAN cable that i use for my computer otherwise so that shouldn’t be the problem.

If anyone knows why it doesn’t seem to be working, please help me out.

I have been trying to figure out how to put my sensor data i get off of my arduino onto a webpage. I have the ethernet shield but i seem to be stuck.

Server test code that puts the arduino analog pin values in a web page. There is other code available that uses ajax and other methods.

// zoomkat's meta refresh data frame test page 5/25/13
// use in your brouser for main page
// static data page
// meta refresh data page
// for use with W5100 based ethernet shields
// set the refresh rate to 0 for fastest update
// use STOP for single data updates

#include <SPI.h>
#include <Ethernet.h>

const int analogInPin0 = A0;
const int analogInPin1 = A1;
const int analogInPin2 = A2;
const int analogInPin3 = A3;
const int analogInPin4 = A4;
const int analogInPin5 = A5;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // arduino ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(84); //server port
unsigned long int x=0; //set refresh counter to 0
String readString; 


void setup(){
    // disable SD SPI if memory card in the uSD slot

  Ethernet.begin(mac, ip, gateway, gateway, subnet);
  Serial.println("meta refresh data frame test 5/25/13"); // so I can keep track of what is loaded

void loop(){
  EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c =;
         if (readString.length() < 100) {
          readString += c; 
        //check if HTTP request has ended
        if (c == '\n') {

          //check get atring received

          //output HTML data header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");

          //generate data page
          if(readString.indexOf("data") >0) {  //checks for "data" page
            x=x+1; //page upload counter
            //meta-refresh page every 1 seconds if "datastart" page
            if(readString.indexOf("datastart") >0) client.print("<meta http-equiv='refresh' content='1'>"); 
            //meta-refresh 0 for fast data
            if(readString.indexOf("datafast") >0) client.print("<meta http-equiv='refresh' content='0'>"); 
            client.print("<title>Zoomkat's meta-refresh test</title></head><BODY>
            client.print("page refresh number: ");
            client.print(x); //current refresh count

              //output the value of each analog input pin
            client.print("analog input0 is: ");
analog input1 is: ");
analog input2 is: ");
analog input3 is: ");
analog input4 is: ");
analog input5 is: ");
          //generate main page with iframe
            client.print("<HTML><HEAD><TITLE>Zoomkat's frame refresh test</TITLE></HEAD>");
            client.print("Zoomkat's Arduino frame meta refresh test 5/25/13");

Arduino analog input data frame:
            client.print("&nbsp;&nbsp;<a href='/datastart' target='DataBox' title=''yy''>META-REFRESH</a>");
            client.print("&nbsp;&nbsp;&nbsp;&nbsp;<a href='/data' target='DataBox' title=''xx''>SINGLE-STOP</a>");
            client.print("&nbsp;&nbsp;&nbsp;&nbsp;<a href='/datafast' target='DataBox' title=''zz''>FAST-DATA</a>
            client.print("<iframe src='/data' width='350' height='250' name='DataBox'>");
          //stopping client
          //clearing string for next read

Check out this site

I currently have used this to add an Ethernet shield to an Uno AND add a NRF24L01 network And a real time clock. I read the data from all my nodes and post it to a local web page on my network. Using an Uno is kind of tight memory wise but I have 4 nodes sending data and it all fits. A lot of memory is used to create the web page.