Programming an esp8266?

Hi friends,
can any suggests how to control an led using esp8266 through client server page. I need to control an led using esp8266.

Thanks

What code does your server have, so far?

The client will be a browser on some other machine.

i need to control from client server to this module?.
I mean esp has some ip address i am not able to log on to this ip using browser.i am using station ip.
Also my esp baudrate is 115200,once i change using at command it wont remain same baudrate if i turn off the module.

i need to control from client server to this module?.

What you need to do is understand that there are clients and there are servers. There are NO client servers.

A client asks a server for information/to do something. A server accepts a client request and generates a response. It may also do something, like move a servo, send an e-mail, charge a credit card, or light an LED.

I mean esp has some ip address i am not able to log on to this ip using browser.

Bummer. Still no code, so still no help.

i am using station ip.

I have no idea what this means.

Also my esp baudrate is 115200,once i change using at command it wont remain same baudrate if i turn off the module

So? Setting the baud rate again at every startup isn't that hard.

Notice that I used capital letters as appropriate. It would be nice if you did too.

Also my esp baudrate is 115200,once i change using at command it wont remain same baudrate if i turn off the module.

I have 2 ESP8266. When I set the baud to 9600 both retain the setting. Something is wrong there, I think.

ok thanks

I need to connect to this wifi ip i am opening in browser with wifi ip number,but i am not able to open the page it getting an error. If i need to communicate with this server i need to open with wifi ip rt. In at command AT+CIPSTART="TCP","client ip address",80. I given client ip adress but still it is not opening

Thanks

rahulsubbu:
ok thanks

I need to connect to this wifi ip i am opening in browser with wifi ip number,but i am not able to open the page it getting an error. If i need to communicate with this server i need to open with wifi ip rt. In at command AT+CIPSTART="TCP","client ip address",80. I given client ip adress but still it is not opening

Thanks

do you think that the chip comes pre-loaded with a web page, maybe some pop-up ads ?

it is this simple " you are doing something wrong. and we cannot help you unless we know what you are doing."
if you open the address, the only thing that will be there is what you put there.
if you read 'how to use this forum" ITEM 7 http://forum.arduino.cc/index.php/topic,148850.0.html
and read about code tags
then please post your code.
only then can we offer anything more than just 'it should work, you are doing something wrong. and we cannot help you unless we know what you are doing."

#include <SoftwareSerial.h>

//i find that putting them here makes it easier to
//edit it when trying out new things

#define RX_PIN 2
#define TX_PIN 3
#define ESP_BRATE 115200

SoftwareSerial esp8266(RX_PIN, TX_PIN);

void setup()
{
Serial.begin(9600);
esp8266.begin(ESP_BRATE); // I changed this
}

void loop()
{
esp8266.println("AT\r\n"); //the newline and CR added
// delay(10);
esp8266.println("AT+RST\r\n");
// delay(10);
esp8266.println("AT+CWMODE=3\r\n");
// delay(10);
esp8266.println("AT+CWLAP\r\n");
// delay(10);
esp8266.println("AT+CWJAP=”vajramuni”,”12121313”\r\n");
// delay(10);
esp8266.println("AT+CIFSR\r\n");
// delay(10);
esp8266.println("AT+CIPMUX=1\r\n");
// delay(10);
esp8266.println("AT+CIPSERVER=1,8888\r\n");
delay(10); //arbitrary value

if(esp8266.available()) // check if the esp is sending a message
{
while(esp8266.available())
{
// The esp has data so display its output to the serial window
char c = esp8266.read(); // read the next character.
Serial.write(c);
}
}
}

This the code i am not able to connect to ip.

if you read 'how to use this forum" ITEM 7 http://forum.arduino.cc/index.php/topic,148850.0.html
and read about code tags

please, go back and edit your post.

Below is some vsry simple server code that produces a web control page. You might try this approach with your esp8266.

//zoomkat 10-6-13
//simple button GET with iframe code
//open serial monitor to see what the arduino receives
//use the ' instead of " in html ilnes 
//address will look like http://192.168.1.102:84/ when submited
//for use with W5100 based ethernet shields

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

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //ethernet shield mac address
byte ip[] = { 192, 168, 1, 102 }; // arduino IP in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(84); //server port

String readString; 

//////////////////////

void setup(){

  pinMode(4, OUTPUT); //pin selected to control
  //start Ethernet
  Ethernet.begin(mac, ip, gateway, gateway, subnet);
  server.begin();

  //enable serial data print 
  Serial.begin(9600); 
  Serial.println("servertest1"); // so I can keep track of what is loaded
}

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 

          //now output HTML data header
             if(readString.indexOf('?') >=0) { //don't send new page
               client.println("HTTP/1.1 204 Zoomkat\r\n\r\n");
             }
             else {
          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>Arduino GET test page</TITLE>");
          client.println("</HEAD>");
          client.println("<BODY>");

          client.println("<H1>Zoomkat's simple Arduino button</H1>");
          
          client.println("<a href='/?on1' target='inlineframe'>ON</a>"); 
          client.println("<a href='/?off' target='inlineframe'>OFF</a>"); 

          client.println("<IFRAME name=inlineframe style='display:none'>");          
          client.println("</IFRAME>");

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

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

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

        }
      }
    }
  }
}