How to send data from website to Arduino Uno via wifi Shield

hi there,
Does anyone have a example I can follow that explains how to transmit data from a website or web server to Arduino that is hooked up to a wifi shield and LCD. for ex: I create a webpage on my computer which has a text box with a send button. when I write something in the text box and then click send that text is then sent to the Arduino and displays on the LCD. Any pointers or a a nudge in the right direction would be appreciated. thank you in advance.
cheers,
SNK

I hooked up a webpage to an arduino using node.js and other great things like sockets.io, johnny-five, serialport for incredibly fast response. I think mine was all running locally so didn't need a wifishield.

I'm sure there would be a way to do it without node etc and your arduino checks a file on a server. Try and adapt the webclient example from arduino: http://arduino.cc/en/Tutorial/WebClient

Good luck!

Does anyone have a example I can follow that explains how to transmit data from a website or web server to Arduino that is hooked up to a wifi shield and LCD.

You seem to be under the impression that a client (a browser) can send data to the Arduino. It can NOT.

How is the client supposed to know where the Arduino is?

If the Arduino IS the server, then clients CAN send GET requests to the server. But, if the Arduino is not the server, there is NO way for a client to talk to it.

You can't do it directly as PaulS stated, but you can use a LAMP (or WAMP) server as a relay. I've done that. Both the client computer and the Arduino contact the relay server as clients, and the server stores and relays data using PHP and MySQL. Not for the technologically weak-of-heart.

Not for the technologically weak-of-heart.

And not real-time, either.

PaulS:

Not for the technologically weak-of-heart.

And not real-time, either.

That is correct. There is a small delay (couple seconds) between the computer send and the Arduino receive.

I sped up the process considerably using UDP on the Arduino to contact the server. ;)

PaulS:

Does anyone have a example I can follow that explains how to transmit data from a website or web server to Arduino that is hooked up to a wifi shield and LCD.

If the Arduino IS the server, then clients CAN send GET requests to the server. But, if the Arduino is not the server, there is NO way for a client to talk to it.

hi there,
Say Arduino IS the server like in this example of LED.

/*
  WiFi Web Server LED Blink
 
 A simple web server that lets you blink an LED via the web.
 This sketch will print the IP address of your WiFi Shield (once connected)
 to the Serial monitor. From there, you can open that address in a web browser
 to turn on and off the LED on pin 9.
 
 If the IP address of your shield is yourAddress:
 http://yourAddress/H turns the LED on
 http://yourAddress/L turns it off
 
 This example is written for a network using WPA encryption. For 
 WEP or WPA, change the Wifi.begin() call accordingly.
 
 Circuit:
 * WiFi shield attached
 * LED attached to pin 9
 
 created 25 Nov 2012
 by Tom Igoe
 */
#include <SPI.h>
#include <WiFi.h>

//char ssid[] = "iPhone SN";      //  your network SSID (name) 
//char pass[] = "1234567890";   // your network password
char ssid[] = "ThomsonEEB616";      //  your network SSID (name) 
char pass[] = "FF07A32DE7";   // your network password
int keyIndex = 0;                 // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;
WiFiServer server(80);

void setup() {
  Serial.begin(9600);      // initialize serial communication
  pinMode(9, OUTPUT);      // set the LED pin mode

  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present"); 
    while(true);        // don't continue
  } 

  // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) { 
    Serial.print(F("Firmware version: "));
    Serial.println(WiFi.firmwareVersion());
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   // print the network name (SSID);

    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:    
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);
  } 
  server.begin();                           // start the web server on port 80
  printWifiStatus();                        // you're connected now, so print out the status
}


void loop() {
  WiFiClient client = server.available();   // listen for incoming clients

  if (client) {                             // if you get a client,
    Serial.println("new client");           // print a message out the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out the serial monitor
        if (c == '\n') {                    // if the byte is a newline character

          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {  
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:    
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            // the content of the HTTP response follows the header:
            
//            client.print("<input type=""text"" name=""fname"">
");
            client.print("Click <a href=\"/H\">here</a> turn the LED on pin 9 on
");
            
            client.print("Click <a href=\"/L\">here</a> turn the LED on pin 9 off
");

            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;         
          } 
          else {      // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        }     
        else if (c != '\r') {    // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }

        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(9, HIGH);               // GET /H turns the LED on
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(9, LOW);                // GET /L turns the LED off
        }
      }
    }
    // close the connection:
    client.stop();
    Serial.println("client disonnected");
  }
}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
  // print where to go in a browser:
  Serial.print("To see this page in action, open a browser to http://");
  Serial.println(ip);
}

but instead of the “click here” to turn on the LED there is a text box in which you can type in ‘on’ and then there is a button beside it that says ‘send’ (and lets forget the LCD for now) and when you click that button on the serial monitor it displays “LED ON”. can this be possible?
thank you

but instead of the "click here" to turn on the LED there is a text box in which you can type in 'on' and then there is a button beside it that says 'send' (and lets forget the LCD for now) and when you click that button on the serial monitor it displays "LED ON". can this be possible?

Yes. The code you showed creates a web page that a browser can display. You need to change the html stuff to make the page look like what you want. There are hyperlinks on that page that cause a new GET request to be made. You'll need a form with a submit button. That will also cause another GET request to be made.

    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out the serial monitor

This part is where the GET request is read, and shown on the Serial Monitor application. You'll need to know what the GET request looks like before you'll be able to parse it.