CSS HTML ethernet Arduino

Bonjour, je souhaite intégrer dans mon programme ce morceaux de code au niveau du client.print mais j'ai des probleme de balise, l'url se transforme en commentaire alors j'aimerai de l'aide
merci

Code à integrer

<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.indigo-pink.min.css">
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

Dans ce code arduino

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

 byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
 byte ip[] = { 192, 168, 1, 177 }; // fixed IP addr in LAN
 byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
 byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
 EthernetServer server(80); //server port

 String readString;
 //////////////////////
 void setup(){
 pinMode(6, OUTPUT); //pin selected to control LED
 char erreur = 0;  
    Serial.println("Parametrage avec ip fixe...");
    // si une erreur a eu lieu cela signifie que l'attribution DHCP
    // ne fonctionne pas. On initialise donc en forçant une IP
    Ethernet.begin(mac, ip);
  
  Serial.println("Init...");
  // Donne une seconde au shield pour s'initialiser
  delay(1000);
  Serial.println("Pret !");
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
 Serial.begin(9600);
 }

 void loop(){
 // Create a client connection
 EthernetClient client = server.available();
 if (client) {
 while (client.connected()) {
 if (client.available()) {
 char c = client.read();

 //read char by char HTTP request
 if (readString.length() < 100) {

 //store characters to string
 readString += c;
 //Serial.print(c);
 }

 //if HTTP request has ended
 if (c == '\n') {

 ///////////////
 Serial.println(readString); //print to serial monitor for debuging
 client.println("HTTP/1.1 200 OK"); //send new page
 client.println("Content-Type: text/html");
 client.println();

 client.println("<HTML>");
 client.println("<HEAD>");
 client.println("<TITLE>Home Automation</TITLE>");
 client.println("</HEAD>");
 client.println("<BODY bgcolor='aqua'>");
 client.println("<H1>Home Automation</H1>");
 client.println("<hr />");
 client.println("
");

 client.println("<a href=\"/?lighton\"\">Turn On Light</a>");
 client.println("<a href=\"/?lightoff\"\">Turn Off Light</a>
");

 client.println("</BODY>");
 client.println("</HTML>");

 delay(1);
 //stopping client
 client.stop();

 ///////////////////// control arduino pin
 if(readString.indexOf("?lighton") >0)//checks for on
 {
 digitalWrite(6, HIGH); // set pin 6 high
 Serial.println("LED On");
 }
 else{
 if(readString.indexOf("?lightoff") >0)//checks for off
 {
 digitalWrite(6, LOW); // set pin 6 low
 Serial.println("LED Off");
 }
 }
 readString=""; //clearing string for next read

 }
 }
 }
 }
 }

bonjour
Ajoute un \ devant tous les " de ton texte a insérer pour dire au compilateur de traiter le " comme un caractere et non comme une balise texte.
A+

merci, ca fontionne, mais maintenant le probleme c'est que j'aimerai stocker tout mon code html dans mon programe mais client.print sans arret ca complique tout, quelqu'un aurait une idée afin d'avoir une commande simple et juste avoir a mettre le code tout simplement ?

De rien.
En modifiant le programme, tu pourrais stocker les pages et autres fichiers sur une µSD.
Ou alors, stocker sur un serveur annexe (privé en local ou sur un hébergeur).

a+

Mon but final est de creer un systeme domotique, tu l'a peut etre compris, et pour ce systeme je privilégie des modules connectés en ethernet, donc 1 au salon, 1 salle a manger, 1 cuisine , et 1 dans les deux chambres, 5/6 modules au final, donc avoir plusieurs site a aller voir, c'est plutot compliqué, alors je pensais rajouter un arduino où tout arriverais qui servirait de centre de controle, il se connecterait frequement a tout les autres afin de recuperer la temperature et l'humidité, et sur une seule page web j'aurai comme ca toutes les information ainsi que le controle des relais
j'ai essayé une page html stocké sur µsd mais le probleme c'est que tout ne s'affiche pas correctement, sur cette page ya besoin de 2 css que j'ai bien mit sur la carte mais j'ai apparement as acces, des idées ?

voila le code

/*--------------------------------------------------------------
  Program:      eth_websrv_SD

  Description:  Arduino web server that serves up a basic web
                page. The web page is stored on the SD card.
  
  Hardware:     Arduino Uno and official Arduino Ethernet
                shield. Should work with other Arduinos and
                compatible Ethernet shields.
                2Gb micro SD card formatted FAT16
                
  Software:     Developed using Arduino 1.0.3 software
                Should be compatible with Arduino 1.0 +
                SD card contains web page called index.htm
  
  References:   - WebServer example by David A. Mellis and 
                  modified by Tom Igoe
                - SD card examples by David A. Mellis and
                  Tom Igoe
                - Ethernet library documentation:
                  http://arduino.cc/en/Reference/Ethernet
                - SD Card library documentation:
                  http://arduino.cc/en/Reference/SD

  Date:         10 January 2013
 
  Author:       W.A. Smith, http://startingelectronics.org
--------------------------------------------------------------*/

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

// MAC address from Ethernet shield sticker under board
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(10, 0, 0, 20); // IP address, may need to change depending on network
EthernetServer server(80);  // create a server at port 80

File webFile;

void setup()
{
    Ethernet.begin(mac, ip);  // initialize Ethernet device
    server.begin();           // start to listen for clients
    Serial.begin(9600);       // for debugging
    
    // initialize SD card
    Serial.println("Initializing SD card...");
    if (!SD.begin(4)) {
        Serial.println("ERROR - SD card initialization failed!");
        return;    // init failed
    }
    Serial.println("SUCCESS - SD card initialized.");
    // check for index.htm file
    if (!SD.exists("index.htm")) {
        Serial.println("ERROR - Can't find index.htm file!");
        return;  // can't find index file
    }
    Serial.println("SUCCESS - Found index.htm file.");
}

void loop()
{
    EthernetClient client = server.available();  // try to get client

    if (client) {  // got client?
        boolean currentLineIsBlank = true;
        while (client.connected()) {
            if (client.available()) {   // client data available to read
                char c = client.read(); // read 1 byte (character) from client
                // last line of client request is blank and ends with \n
                // respond to client only after last line received
                if (c == '\n' && currentLineIsBlank) {
                    // send a standard http response header
                    client.println("HTTP/1.1 200 OK");
                    client.println("Content-Type: text/html");
                    client.println("Connection: close");
                    client.println();
                    // send web page
                    webFile = SD.open("index.htm");        // open web page file
                    if (webFile) {
                        while(webFile.available()) {
                            client.write(webFile.read()); // send web page to client
                        }
                        webFile.close();
                    }
                    break;
                }
                // every line of text received from the client ends with \r\n
                if (c == '\n') {
                    // last character on line of received text
                    // starting new line with next character read
                    currentLineIsBlank = true;
                } 
                else if (c != '\r') {
                    // a text character was received from client
                    currentLineIsBlank = false;
                }
            } // end if (client.available())
        } // end while (client.connected())
        delay(1);      // give the web browser time to receive the data
        client.stop(); // close the connection
    } // end if (client)
}

je souhaiterai utliser une fichier css avec ma page html mais apparement il n'y a pas de lien, comment vous faites vous pour utiliser un html + css avec arduino ?

Il faut implémenter un serveur web sur ton arduino qui soit capable de traiter les différentes requêtes HTTP que va lui envoyer le client (le navigateur) pour obtenir les différentes ressources dont il a besoin (page html, fichier css, images, ...)

Le code que tu as posté correspond à un serveur web très très basique puisqu'à n'importe quelle requête qu'il reçoit, il répond toujours de la même manière en renvoyant ta page index.htm

alors comment je dois faire afin qu'il envoi aussi les images, css , ..... ?