erreur bouton webserveur

Bonsoir,

je reviens à nouveau vers vous concernant mon projet domotique
j'ai vraiment du mal à comprendre le code pour les webserveurs.....

le code qui va suivre est donc un webserveur qui, au niveau visuel pourrait je pense fonctionner pour tout le monde il fonctionne vraiment très bien.
le seul hic....
j'y ai rajouter une portion pour pouvoir avoir des boutons actifs qui permettrons d'activer une led ou envoyer un signal .... qui fonctionne sur d'autre programme que j'ai tester.
mais sur ce programme ça ne fonctionne pas.
il me renvoi à une erreur du type fichier non trouvé alors que le "if" utilisé allume la led broche 13 sur la carte.....
une fois ce problème résolu ce code pourrais être la base pour tout projet utilisant un webserveur avec des commandes de broches ou envoie de signal via l'infrarouge ou le 433Mz ou autre....

//This version includes a readout buffer that reads a specific amount of data from the SD card before it writes it to the wiznet chip.  This increases transfer
//speed considerably, up to 6x download speed.
#include <SPI.h>
#include <SD.h>
#include <Ethernet.h>
#include <Wire.h>

const int LED=13;
#define maxLength 40
String inString = String(maxLength);       // allocate a new String


uint8_t bufindex;  //Buffer index, used to keep track of current buffer byte
const uint8_t maxbyte=255;  //The maximum allowable buffer length
uint8_t buf[maxbyte];  //Creates the buffer with a length equal to the max length

byte mac[] = {0x90,0xA2,0xDA,0x00,0x26,0xEB};
byte ip[] = {192,168,1,4};
char rootFileName[] = "index.htm";
EthernetServer server(80);

Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;

#define error(s) error_P(PSTR(s))
void error_P(const char* str) {
  PgmPrint("error: ");
  SerialPrintln_P(str);
  if (card.errorCode()) {
    PgmPrint("SD error: ");
    Serial.print(card.errorCode(), HEX);
    Serial.print(',');
    Serial.println(card.errorData(), HEX);
  }
  while(1);
}

void setup() {
  pinMode(LED, OUTPUT);
  Serial.begin(256000);
  PgmPrint("Free RAM: ");
  Serial.println(FreeRam());
  pinMode(10, OUTPUT);
  digitalWrite(10, HIGH);
  if (!card.init(SPI_FULL_SPEED, 4)) error("card.init failed!");
  if (!volume.init(&card)) error("vol.init failed!");
  PgmPrint("Volume is FAT");
  Serial.println(volume.fatType(),DEC);
  Serial.println();
  if (!root.openRoot(&volume)) error("openRoot failed");
  PgmPrintln("Files found in root:");
  root.ls(LS_DATE | LS_SIZE);
  Serial.println();
  PgmPrintln("Files found in all dirs:");
  root.ls(LS_R);
  Serial.println();
  PgmPrintln("Done");
  Ethernet.begin(mac, ip);
  server.begin();
}
#define BUFSIZ 100

void loop()
{
  char clientline[BUFSIZ];
  char *filename;
  int index = 0;
  int image = 0;
EthernetClient  client = server.available();
  if (client) {
    boolean current_line_is_blank = true;
    index = 0;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (c != '\n' && c != '\r') {
          clientline[index] = c;
          index++;
          if (index >= BUFSIZ)
            index = BUFSIZ -1;
          continue;
        }
        clientline[index] = 0;
        filename = 0;
        Serial.println(clientline);
        if (strstr(clientline, "GET / ") != 0) {
          filename = rootFileName;
        }
        if (strstr(clientline, "GET /") != 0) {
          if (!filename) filename = clientline + 5;
          (strstr(clientline, " HTTP"))[0] = 0;
          Serial.println(filename);
          if (! file.open(&root, filename, O_READ)) {
            client.println("HTTP/1.1 404 Not Found");
            client.println("Content-Type: text/html");
            client.println();
            client.println("<h2>File Not Found!</h2>");
            break;
          }
          Serial.println("Opened!");
          client.println("HTTP/1.1 200 OK");
          if (strstr(filename, ".htm") != 0)
            client.println("Content-Type: text/html");
          else if (strstr(filename, ".css") != 0)
            client.println("Content-Type: text/css");
          else if (strstr(filename, ".png") != 0)
            client.println("Content-Type: image/png");
          else if (strstr(filename, ".jpg") != 0)
            client.println("Content-Type: image/jpeg");
          else if (strstr(filename, ".gif") != 0)
            client.println("Content-Type: image/gif");
          else if (strstr(filename, ".3gp") != 0)
            client.println("Content-Type: video/mpeg");
          else if (strstr(filename, ".pdf") != 0)
            client.println("Content-Type: application/pdf");
          else if (strstr(filename, ".js") != 0)
            client.println("Content-Type: application/x-javascript");
          else if (strstr(filename, ".xml") != 0)
            client.println("Content-Type: application/xml");
            if (inString.startsWith("GET /?cmd=ON1")>0){digitalWrite(LED,HIGH); // met la broche au niveau haut (5V) – allume la LED

delay(500); // pause de 500 millisecondes (ms)
         
              }
          else
            client.println("Content-Type: text");
          client.println();
          int16_t c;
          bufindex=0;  //reset buffer index
          while ((c = file.read()) >= 0) {
            buf[bufindex++]=((char)c);  //fill buffer
            if(bufindex==maxbyte)  //empty buffer when maximum length is reached.
            {
              client.write(buf, maxbyte);
              bufindex=0;
            }
          }
          file.close();  //close the file
          if(bufindex>0)  //most likely, the size of the file will not be an even multiple of the buffer length, so any remaining data is read out.
          {
            client.write(buf, bufindex);
          }
          bufindex=0; //reset buffer index (reset twice for redundancy
        } 
        else {
          client.println("HTTP/1.1 404 Not Found");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<h2>File Not Found!</h2>");
        }
        break;
      }
    }
    delay(1);
    client.stop();
  }
}

si quelqu'un aurait une solution ce serait super cool
mon but est de faire quelque chose qui ressemble à cela http://idomoduino.blogspot.fr/
mais je n'arrive pas à interagir avec l'arduino.... c'est dommage.... ça me bloque.....
je n'arrive pas a faire fonctionner ces boutons correctement....l'arduino comprends que je demande une page.... :confused: