[Résolu]Page HTML sur un shield WiFi Arduino

Bonjour,

Un problème m'est apparue. Je n'arrive pas à ouvrir la page HTML à l'adresse WiFi.localIP() programmer sur mon module arduino UNO en passant par un shield WiFi. Disposer comme ceci:

Je vous présente mon code, si vous pouviez m'aider j'en serait ravi.

#include <SPI.h>
#include <WiFi.h>

char ssid[] = "Domotique";          //  SSID
char pass[] = "**********";   // mot de passe
int status = WL_IDLE_STATUS;
WiFiServer server(80); //port du serveur

String readString; 

//////////////////////

void setup(){

   pinMode(2, OUTPUT);
   pinMode(5, OUTPUT); 
     
     //Demarrage de la liaison serie:
  Serial.begin(9600);
  Serial.println("Connection au serveur par WPA...");
  Serial.print("SSID: ");
  Serial.println(ssid);

  status = WiFi.begin(ssid, pass);
  if ( status != WL_CONNECTED) {
    Serial.println("Impossible de se connecter au réseau WiFi");
    while(true);
  }
  else {
    server.begin();
    Serial.print("Connecte au WiFi. Mon adresse:");
    IPAddress myAddress = WiFi.localIP();
    Serial.println(myAddress);
    Serial.println("Serveur LED 1.0");
    
  }
}

void loop(){
  // Creation de la connection reseau
  WiFiClient client = server.available();
  if (client) {
  Serial.print("Client connecte");
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        //Lire char par une requete chat HTTP
        
        if (readString.length() < 100) {

          //stoquer les caractère dans string
          readString += c; 
          //Serial.print(c);
        } 

        //si la requete HTTP est termine
        if (c == '\n') {

          ///////////////
          Serial.println(readString); //print au moniteur serie pour debogage

          //maintenant sortie du HTML header
             if(readString.indexOf('?') >=0) { //ne pas envoyer une nouvelle page
               client.println("HTTP/1.1 204 Zoomkat");
               client.println();
               client.println();  
             } 
      
             else {
          client.println("HTTP/1.1 200 OK"); //Envoyer une nouvelle page
          client.println("Content-Type: text/html");
          client.println();

          client.println("<HTML>");
          client.println("<HEAD>");
          client.println("<TITLE>Projet domotique 2014</TITLE>");
          client.println("</HEAD>");
          client.println("<BODY>");
          
          

          client.println("<H1>Controle des lumieres</H1>");
          
          
          client.println("<a href=\"/?on\" target=\"inlineframe\">ON</a>"); 
          client.println("<a href=\"/?off\" target=\"inlineframe\">OFF</a>");
          
          client.println("<IFRAME name=inlineframe style=\"display:none\" >");          
          client.println("</IFRAME>");
          
          client.println("<H1>Controle des volets roulants</H1>");
         
         
          client.println("<a href=\"/?UP\" target=\"inlineframe1\">UP</a>");
          client.println("<a href=\"/?STOP\" target=\"inlineframe1\">STOP</a>");
          client.println("<a href=\"/?DOWN\" target=\"inlineframe1\">DOWN</a>");     

             }

          delay(1);
          //Arret du client
          client.stop();

          ///////////////////// Controle des pins de l'arduino
          if(readString.indexOf("on") >0)//checks for on
          {
            digitalWrite(2, HIGH);    // set pin 2 high
            Serial.println("Led On"); 
          }
          if(readString.indexOf("off") >0)//checks for off
          {
            digitalWrite(2, LOW);    // set pin 2 low
            Serial.println("Led Off");
          }
          if(readString.indexOf("UP") >0)//checks for UP
          {
            digitalWrite(5, HIGH);    // set pin 5 high
            Serial.println("Volet UP");
          }
          if(readString.indexOf("STOP") >0)//checks for STOP
          {
            digitalWrite(5, LOW);    // set pin 5 low
            Serial.println("Volet STOP");
          }
          if(readString.indexOf("DOWN") >0)//checks for DOWN
          {
            digitalWrite(5, LOW);    // set pin 5 low
            Serial.println("Volet Down");
          }
          
          //Nettoyage de string pour nouvelle lecture
          readString=""; 
          
          client.println("</BODY>");
          client.println("</HTML>");
        }

        }
      }
    }
  }

Merci d'avance.

Salut,

Déjà, aprés if (client) ajoute un Serial.print("Client connecte"), ça permettra de savoir où se situe le problème

J'ai ajouté le Serial.print("Client connecte"); (J'ai mis mon code à jour dans le premier message)

Dans le moniteur série mon programme s'arrête ici :

Connection au serveur par WPA...
SSID: Domotique
Connecte au WiFi. Mon adresse:192.168.0.106
Serveur LED 1.0

Alors ça marche ou pas ?

Le Led bleue du shield wifi clignote un peu quand tu essaies d'ouvrir la page ?

Si non, il manque un traitement que l'on trouve dans l'exemple wifiwebserver... Currentlineisblank ... Ça a peut être un intérêt ...

J'ai trouvé la solution à mon problème. Il fallait juste mettre à jour le firmware de mon shield.

Merci.