he quitado código porque es demasiado largo
void loop(){
//MODIFICAR TIEMPO
//modificarTiempo(10);
//LEER TIEMPO EEPROM
tiempo = leerTiempo();
//Serial.print("tiempo: ");
//Serial.println(tiempo);
//OBTENER TEMPERATURA
tempValor = ( 5.0 * analogRead(pinTemperatura) * 100.0) / 1024.0;
// Serial.printlnln(tempValor);
//delay(2000);
//RTC
// rtc_prueba();
// releOn( 19, 01, 10, tiempo);
// 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() < 30)
{
//store characters to string
readString += c;
}
//output chars to serial port
//if HTTP request has ended
if (c == '\n') {
//lets check if LED should be lighted
readString.trim();
/* Serial.print("sstring: ");
Serial.println(readString);
Serial.println(" ");
Serial.print("sub: ");
Serial.println(readString.substring(6, 19));
Serial.println(" ");
*/
/* for (int i=20; i <= readString.length(); i++){
String numero;
if(readString.substring(i) != "\n"){
numero = numero + readString.substring(i);
Serial.println("numero: " +numero);
}
Serial.println(numero);
}
*/
// Serial.println(readString);
if(readString == ("GET /?opcion=TIEMPO HTTP/1.1") ) //MODIFICAR TIEMPO
{
sprintf(url, "http://bybrural.com/p1.php?modTiempo");
sprintf(meta, "<meta http-equiv='Refresh' content='0;url=%s'>", url);
client.println("HTTP/1.1 200 OK");
client.println("<body><html>");
client.println("Content-Type: text/html");
client.println();
// Serial.println(meta);
client.println(meta);
client.println("</body></html>");
}
else if(readString.substring(6,19) == ("cambiartiempo") )
{
int Triego = readString.substring(20,22).toInt();
Serial.println(Triego);
modificarTiempo(Triego);
//redireccionar a la web
client.println("HTTP/1.1 200 OK");
client.println("<body><html>");
client.println("Content-Type: text/html");
client.println();
client.println("<meta http-equiv='Refresh' content='0;url=http://bybrural.com/p1.php'>");
client.println("</body></html>");
}
else if(readString == ("GET /?opcion=LED HTTP/1.1") )
{
//led has to be turned ON
digitalWrite(ledPin, HIGH); // set the LED on
//redireccionar a la web
client.println("HTTP/1.1 200 OK");
client.println("<body><html>");
client.println("Content-Type: text/html");
client.println();
client.println("<meta http-equiv='Refresh' content='0;url=http://bybrural.com/p1.php'>");
client.println("</body></html>");
}
else if(readString == ("GET /?opcion=TEMP HTTP/1.1")) //PEDIR TEMPERATURA
{
//CONSTRUIMOS LA URL PARA LA REDIRECCION
sprintf(url, "http://bybrural.com/p1.php?temp=%d", tempValor);
sprintf(meta, "<meta http-equiv='Refresh' content='0;url=%s'>", url);
client.println("HTTP/1.1 200 OK");
client.println("<body><html>");
client.println("Content-Type: text/html");
client.println();
client.println(meta);
client.println("</body></html>");
}
else if(readString == ("GET /?opcion=PedirTiempo HTTP/") ) //PEDIR TIEMPO
{
tiempo = leerTiempo();
//CONSTRUIMOS LA URL PARA LA REDIRECCION
sprintf(url, "http://bybrural.com/p1.php?tiempo=%d", tiempo);
sprintf(meta, "<meta http-equiv='Refresh' content='0;url=%s'>", url);
client.println("HTTP/1.1 200 OK");
client.println("<body><html>");
client.println("Content-Type: text/html");
client.println();
client.println(meta);
client.println("</body></html>");
}
else{
//led has to be turned OFF
digitalWrite(ledPin, LOW); // set the LED OFF
//redireccionar a la web
client.println("HTTP/1.1 200 OK");
client.println("<body><html>");
client.println("Content-Type: text/html");
client.println();
client.println("<meta http-equiv='Refresh' content='0;url=http://bybrural.com/p1.php'>");
client.println("</body></html>");
}
//clearing string for next read
readString="";
//stopping client
client.stop();
}
}
}
}
}
y este el html
<html>
<body>
<?php
if(isset($_GET['modTiempo'])){
?>
<form method=get name=LED action="http://peru10.no-ip.info">
<input type=text name=cambiartiempo>
<input type=submit value=submit>
</form>
<?php
}
if(isset($_REQUEST['temp']))
echo "temp: ".$_REQUEST['temp'];
if(isset($_REQUEST['tiempo']))
echo "tiempo de riego: ".$_REQUEST['tiempo'];
?>
<form method=get name=LED action="http://peru10.no-ip.info">
<input type=radio name=opcion value=LED>LED ON
<input type=radio name=opcion value=TEMP>TEMPERATURA
<input type=radio name=opcion value=TIEMPO>MODIFICAR TIEMPO
<input type=radio name=opcion value=PedirTiempo>PEDIR TIEMPO
<input type=submit value=submit>
</form>
</body>
</html>
gracias