domotique ethernet server xbee

Bonjour a tous ,
je débute sur arduino et je m'interresse à ce projet :
http://www.dfrobot.com/community/2011/07/tutorial-using-the-arduino-xboard-to-control-a-magnetic-door-lock-from-a-web-interface/
le control d un relay via un mini serveur dans un arduino (xboard V2 : qui est un shield ethernet uno avec un slot xbee ...voir le lien ci dessus)... mon but étant de commander trois volets roulants depuis mon navigateur android ou via un ordinateur.
Donc j imaginais :
1 Module arduino ethernet + xbee en reception,
3 modules arduino avec xbee pour controler les volets roulants

j ai trouvé ce sketch chez DFRobot qui ne fonctionne pas avec les versions arduino actuels ,mais qui répondrait à mes attentes:
quelqu'un saurait il y apporté les modifications nécessaires ??? ...merci de votre aide à tous!

#include <Client.h>
#include <Ethernet.h>
#include <Server.h>
#include <Udp.h>
#include <SPI.h>
/*

  • Web Server
  • A simple web server: Displays a button to open/close
  • a door and door status
    */
    //-----------------------BEGIN Variable setup -------------------------------

String readString = String(30); //string for fetching data from address
boolean LEDON = false; //LED status flag

int state;
int val=0;

byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = {
192, 168, 0, 177 }; //Change your IP Address here
Server server(80); //Standard HTTP server port

//-----------------------END Variable setup-------------------------------

void setup()
{
pinMode(4, OUTPUT);

Ethernet.begin(mac, ip);
server.begin();
delay(100);
Serial.begin(57600); //XBee module Baud rate
delay(100);
}
void loop()
{
//---------------Web Server initialization------------------------------
Client client = server.available();
if (client) {

boolean current_line_is_blank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
if (readString.length() < 100)
{

readString += c;
}
///////////Check button status to determine actions to take for submit button///////////////
if(readString.indexOf("IO=1") >0){ // If door open request sent;
// send instruction to remote arduino
if (LEDON== false){ //Ensure it only send the info once
//led has to be turned ON
LEDON = true; //Change LED state to print on the page
Serial.print('G'); //Send command to remote Arduino
}
}
if(readString.indexOf("IO=0") >0){//Same as above but not used in
//this application
if (LEDON== true){
//led has to be turned OFF
LEDON = false;
Serial.print('K');
}
}
///////////////Finish checking and actions for submit button//////////////////

//------------------Standard web Server Jargon-------------------------------
if (c == 'n' && current_line_is_blank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: html");
client.println();
client.println("<html>");
client.println("<head>");
client.println("<title>Xboard interface--Door control</title>");
client.println("</head>");
client.println("<body>");
client.print("welcome to DFRobot"); //Print your own message here
client.println("<br />");
client.print("//");
client.println("<br />");
client.println("<br />");
client.print("//
");
client.println("<br />");
client.println("<br />");
client.print("<form>");
client.print("<input type=radio name=IO value=1 /> Open<br />");
client.print("<input type=submit value=Submit </form><br />");
client.println("</body>");
break;
}

if (c == 'n') {
// we're starting a new line
current_line_is_blank = true;
}
else if (c != 'r') {
// we've gotten a character on the current line
current_line_is_blank = false;
}
}
}
//------------------END Standard web Server Jargon-------------------------------

//-----------------Print door status on web page and auto refresh----------------
if (LEDON){
//printing LED status
client.print("<font size='5'>DOOR status: ");
client.println("<font color='green' size='5'>OPEN");
client.println("<META HTTP-EQUIV=REFRESH CONTENT=2;url=http://192.168.0.177/&gt;"); //Autorefresh
//Auto-refresh the site after 2 seconds to reset the door status to closed
}
else{
client.print("<font size='5'>DOOR status: ");
client.println("<font color='grey' size='5'>CLOSED");
}
client.println("<hr />");
client.println("<hr />");
client.println("</body></html>");
//clearing string for next read
readString="";
//-----------------END Print door status on web page and auto refresh----------------
client.stop();
}

/*Routine to read response from remote Arduino
*and light local LED on PIN4
*/
if (Serial.available() > 0) {
val = Serial.read();
if (val == 'H') { //These values ('H')can be changed to what ever you want
//just make sure you change them in both the server
//program and the client program
digitalWrite(4, HIGH);
delay (20);
}
if (val == 'L') {
digitalWrite(4, LOW);
delay (20);
}
}
}

Bonjour, essaie de compiler le code suivant à la place de celui du dessus car il n'est pas bon.

#include <Client.h>
#include <Ethernet.h>
#include <Server.h>
#include <Udp.h>
#include <SPI.h>
/*
 * Web Server
 *
 * A simple web server: Displays a button to open/close
 * a door and door status
 */
 //-----------------------BEGIN Variable setup -------------------------------

String readString = String(30); //string for fetching data from address
boolean LEDON = false; //LED status flag

int state;
int val=0;

byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] =  {
  192, 168, 0, 177 }; //Change your IP Address here
Server server(80); //Standard HTTP server port

//-----------------------END Variable setup-------------------------------

void setup()
{
  pinMode(4, OUTPUT);    

  Ethernet.begin(mac, ip);
  server.begin();
  delay(100);
  Serial.begin(57600);  //XBee module Baud rate
  delay(100);
  }
void loop()
{
//---------------Web Server initialization------------------------------
  Client client = server.available();
  if (client) {

    boolean current_line_is_blank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (readString.length() < 100)
      {

        readString += c;
      }
///////////Check button status to determine actions to take for submit button///////////////
       if(readString.indexOf("IO=1") >0){ // If door open request sent;
                                          // send instruction to remote arduino
             if (LEDON== false){          //Ensure it only send the info once
             //led has to be turned ON
             LEDON = true;                //Change LED state to print on the page
             Serial.print('G');           //Send command to remote Arduino
            }
           }
           if(readString.indexOf("IO=0") >0){//Same as above but not used in
                                             //this application
           if (LEDON== true){
             //led has to be turned OFF
             LEDON = false;
             Serial.print('K');
           }
           }
///////////////Finish checking and actions for submit button//////////////////

//------------------Standard web Server Jargon-------------------------------
        if (c == 'n' && current_line_is_blank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: html");
          client.println();
          client.println("<html>");
          client.println("<head>");
          client.println("<title>Xboard interface--Door control</title>");
          client.println("</head>");
          client.println("<body>");
          client.print("welcome to DFRobot"); //Print your own message here
          client.println("
");
          client.print("//*************************************");
          client.println("
");
          client.println("
");
          client.print("//*************************************");
          client.println("
");
          client.println("
");
          client.print("<form>");
          client.print("<input type=radio name=IO value=1 /> Open
");
          client.print("<input type=submit value=Submit </form>
");
          client.println("</body>");
            break;
            }

        if (c == 'n') {
          // we're starting a new line
          current_line_is_blank = true;
        }
        else if (c != 'r') {
          // we've gotten a character on the current line
          current_line_is_blank = false;
        }
      }
    }
//------------------END Standard web Server Jargon-------------------------------

//-----------------Print door status on web page and auto refresh----------------
     if (LEDON){
          //printing LED status
         client.print("<font size='5'>DOOR status: ");
         client.println("<font color='green' size='5'>OPEN");
         client.println("<META HTTP-EQUIV=REFRESH CONTENT=2;url=http://192.168.0.177/>"); //Autorefresh
                        //Auto-refresh the site after 2 seconds to reset the door status to closed
     }
     else{
          client.print("<font size='5'>DOOR status: ");
          client.println("<font color='grey' size='5'>CLOSED");
     }
          client.println("<hr />");
          client.println("<hr />");
          client.println("</body></html>");
          //clearing string for next read
          readString="";
//-----------------END Print door status on web page and auto refresh----------------
    client.stop();
  }

/*Routine to read response from remote Arduino
 *and light local LED on PIN4
 */
   if (Serial.available() > 0) {
    val = Serial.read();
    if (val == 'H') { //These values ('H')can be changed to what ever you want
                      //just make sure you change them in both the server
                      //program and the client program
      digitalWrite(4, HIGH);
      delay (20);
     }
    if (val == 'L') {
      digitalWrite(4, LOW);
       delay (20);
    }
   }
}

Chez moi la compilation fonctionne sans erreur sur IDE v0.22
:wink: