tell arduino what time to do something via browser

I have created a timer control for my pool where I can control the pool from a control box and from a browser. I basically copied some code that i found in some tutorials on the web.

I created a timer function as well. I can set the pump to come on a 6am and off at 12pm. The trouble i have is that i can't find anything on sending the time to begin and end via a browser if i want to make a change to my current settings. Right now i have the 6am start time written to a variable called "startTime". I then have a variable called "duration". That sets how long the pump runs.

I would like to be able to change the variable "startTime" and "duration" via my browser. Can anyone point me in the right direction with a tutorial or something i can find online.

Many thanks

it will be nearly impossible for anyone to assist you without sharing your current hardware configuration or your sketch.

Ok, let me start over:

I am using the code below. If i open the web page I have a form with a text box called “text1”. If i type “hello” in that text box and submit it, i get the following in my address bar.

http://192.168.0.25/?text1=hello

The following is what is sent to the server (arduino)

GET GET /?text1=hello HTTP/1.1
Host: 192.168.0.25
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14
Accept-Language: en-us
Referer: http://192.168.0.25/?text1=hello
Accept-Encoding: gzip, deflate

Now for the fun part. I want to take the word “hello” that i typed into text1 and store it in the variable “text1” that has been declared on line 8 of my code.

In using some of the examples i found online to control and LED, i found that using “GET” to send the message to the server was the way to go. After many hours of reverse engineering the code, I’m not so sure.

If anyone can give me some insight on this, thank you in advance.

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


byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,0,25); // IP address, may need to change depending on network
EthernetServer server(80);  // create a server at port 80

String HTTP_req;          // stores the HTTP request

char text1[10];

void setup()
{
    Ethernet.begin(mac, ip);  // initialize Ethernet device
    server.begin();           // start to listen for clients
    Serial.begin(9600);       // for diagnostics
    pinMode(5, OUTPUT);       // LED on pin 2
}

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
                HTTP_req += c;  // save the HTTP request 1 char at a time
                // 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
                    client.println("<!DOCTYPE html>");
                    client.println("<html>");
                    client.println("<head>");
                    client.println("<title>Arduino LED Control</title>");
                    client.println("</head>");
                    client.println("<body>");

                    client.println("<form method=\"get\">");
                    client.println("<input name=\"text1\" id=\"text1\" type=\"text\"></p>");
                    client.println("<p><input type=\"submit\"></p>");
                    client.println("</form>");

                    client.println("</body>");
                    client.println("</html>");

                    Serial.print(HTTP_req);
                    Serial.println(text1);

                    HTTP_req = "";    // finished with request, empty string
                    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)
}

The general approach would be to have your Arduino act as a web server which provided a page which displayed the current settings, with a form that let you alter them and submit the new values back to the Arduino. The Arduino would need to process the form submission to extract the changed values, and save them wherever you keep the configuration. I suggest keeping them in EEPROM so that the changes persist if you reset the Arduino.

In using some of the examples i found online to control and LED, i found that using "GET" to send the message to the server was the way to go. After many hours of reverse engineering the code, I'm not so sure.

The browser did that. That's why the stuff you printed starts with GET. Of course, that might be a little hard to see, since you didn't define what you were printing.

I want to take the word "hello" that i typed into text1 and store it in the variable "text1" that has been declared on line 8 of my code.

Start by defining and bracketing what it is you are printing:

Serial.print("HTTP_req: [");
Serial.print(HTTP_req);
Serial.println("]");

Then, you'll be able to see that there IS a GET request. Using indexOf() and substring() methods of the String class, since you are using the dreaded String class, to get the portion of interest.