už se pár dnů snažím načíst obsah webové stránky do proměnné, ale vůbec se mi to nedaří, tak bych chtěl požádat někoho o pomoc.
Našel jsem spoustu věcí pro php nějaké javascripty a funkci file_get_contents, ale nic s toho se mi nepodařilo zapracovat do html kódu na mém arduinu
![Sad :-(](./images/smilies/icon_sad.gif)
Mám jedno arduino hlavní a druhé na ip adrese http://192.168.9.25:88/ a potřeboval bych tu stránku z adresy http://192.168.9.25:88 uložit do proměnné jako text a zobrazit na stránce toho hlavního arduina v html kódu níže:
Kód: Vybrat vše
//---------------web stranka
WiFiClient client = server.available();
if (client) { //Připojil se klient?
Serial.println("new client");
boolean current_line_is_blank = true;
String buffer = "";
while (client.connected()) {
if (client.available()) {
char c = client.read();
buffer = buffer + c;
if (c == '\n' && current_line_is_blank) {
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close");
client.println(""); // do not forget this one
client.println("<!DOCTYPE HTML>");
client.println("<html>");
client.println("<head>");
client.println("<title>Teplomer Hlavni</title>");
client.println("</head>");
client.println("<body bgcolor=#f9a46f>");
client.println("<h1>TEPLOMER</h1>");
client.print("<h3>Teplota: ");
client.print(teplomer1());
client.print("°C");
client.print("</h3>");
client.print("<br>");
//SEM BYCH POTŘEBOVAL DOSTAT OBSAH STRÁNKY
client.print("http://192.168.9.25:88/");
client.print("</body>");
client.print("<meta http-equiv=\"refresh\" content=\"5\">");
client.println("</html>");
break;
}
if (c == '\n') {
current_line_is_blank = true;
} else if (c != '\r') {
current_line_is_blank = false;
}
}
}
delay(20);
client.stop();
Serial.println("Client disconnected");
Serial.println("");
}
//--------------konec web stranky