Make a LinkSprite Serial Web Server Using Arduino

How to make a linksprite serial web server using Arduino Ethernet sheild

LinkSprite has a serial web server that allow to use AT command to configure, and otherwise, is a transparent DTU. It's data sheet can be download at:

http://www.cutedigi.com/product_info.php?products_id=4204
http://www.linksprite.com/product_info.php?products_id=3536

In this tutorial, we are going to show how to make a Linksprite serial web server using ardino ethernet shield.

Hardware:

It requires a router. We use a Netgear one.
The Arduino Duemilanove USB board, which can be ordered from:http://www.cutedigi.com/product_info.php?cPath=277&products_id=4221
The Arduino Ethernet Shield, which can be ordered from: http://www.cutedigi.com/product_info.php?cPath=277&products_id=4222

Sketch:

/*
 * Serial Web Server
 * http://www.cutedigi.com
 * tech@cutedigi.com
 *  8/11.2009
 * use under GNU
 */

#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10, 0, 0, 177 };

Server server(5000);

int incomingByte = 0;      // for incoming serial data


void setup()
{
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.begin(9600);  
}

void loop()
{
       
  Client client = server.available();
  
  if (Serial.available() > 0)  
    server.write(Serial.read());
    
  if (client) {
       
        char c = client.read();
        if(c!=NULL)
           Serial.print(c);
      }

}

Quick Test:

We will download a serial port monitor from: http://www.linksprite.com/pub/software/LinkSprite-NEC-serial-v1.0.rar
The TCP/IP debugger from: http://www.simplecomtools.com/tcptesttool.html