Chat freely about anything...

User avatar
By thenameless
#49528 void setup()
{
Serial.begin(9600);
esp8266.begin(9600); // your esp's baud rate might be different

pinMode(11,OUTPUT);
digitalWrite(11,LOW);

pinMode(12,OUTPUT);
digitalWrite(12,LOW);

pinMode(13,OUTPUT);
digitalWrite(13,LOW);

pinMode(10,OUTPUT);
digitalWrite(10,LOW);

sendCommand("AT+RST\r\n",2000,DEBUG); // reset module
sendCommand("AT+CWMODE=1\r\n",1000,DEBUG); // configure as access point
sendCommand("AT+CWJAP=\"ssid\",\"password\"\r\n",3000,DEBUG);
delay(10000);
sendCommand("AT+CIFSR\r\n",1000,DEBUG); // get ip address
sendCommand("AT+CIPMUX=1\r\n",1000,DEBUG); // configure for multiple connections
sendCommand("AT+CIPSERVER=1,80\r\n",1000,DEBUG); // turn on server on port 80

Serial.println("Server Ready");
}

the code above i copy from somewhere else but when i command i only get the "Server Ready" without any ip address, the ssid and password i have changed to my wifi.

how i can solve this problem?
User avatar
By Dusk
#49555 Hi !

Try to put
esp8266.begin(115200);
sendCommand("AT+CIOBAUD=9600");
esp8266.begin(9600);

in your void Setup()
When you open monitor serie put : Both CL and NL (I can't remember, sorry french :oops: ) and 9600baud
User avatar
By Dusk
#49565 Hi !

Have you tried to put it in your setup() ?

Code: Select allSerial.begin(9600);
esp8266.begin(115200);
sendCommand("AT+CIOBAUD=9600");
delay(4000);
esp8266.begin(9600);



I tried something with 'delay' and .. Don't work for me. (Just "Serial.println("test") ) and nothing else.

So, try to add a new function :

Code: Select allvoid getESP8266(const int timeout)
    {
      String answer = "";
      long int time = millis();
      while( (time+timeout) > millis())
      {
        while(esp8266.available())
        {
          char c = esp8266.read();
          answer+=c;
        }
      }
      Serial.print(answer);   
    }


And replace
Code: Select alldelay
with
Code: Select allgetESP8266("1000")