Simple configuration program for the ESP8266 Wi-Fi module. Includes baud rate changes. If module [Vendor:www.ai-thinker.com Version:0.9.2.4], the baud rate can be changed from 9600(default) to 230400. Other baud rates that did not work: 460800, 921600. These will set but could not get stable communications. No complicated libraries, once configured the module will store the settings ready to be used in the application. Can be reconfigured if required. Start with 9600, i.e. esp.baud(9600); If no response try esp.baud(57600); and esp.baud(115200); After config completes the program continuously gets AP and IP list.

Dependencies:   mbed

Revision:
3:14e33fec26c3
Parent:
2:c5515c7eba46
--- a/main.cpp	Tue Feb 10 16:59:16 2015 +0000
+++ b/main.cpp	Tue Feb 10 17:14:53 2015 +0000
@@ -23,6 +23,24 @@
     //ESPsetbaudrate();   //******************  include this routine to set a different ESP8266 baudrate  ******************
 
     ESPconfig();        //******************  include Config to set the ESP8266 configuration  ***********************
+    
+   
+   // contiuosly get AP list and IP
+    while(1){
+        pc.printf("\n---------- Listing Acces Points ----------\r\n");
+        strcpy(snd, "AT+CWLAP\r\n");
+        SendCMD();
+        timeout=3;
+        getreply();   
+        pc.printf(buf);
+
+        pc.printf("\n---------- Get IP's ----------\r\n"); 
+        strcpy(snd, "AT+CIFSR\r\n");
+        SendCMD();
+        timeout=2;
+        getreply(); 
+        pc.printf(buf);
+    }    
      
 }
 
@@ -107,6 +125,15 @@
     getreply(); 
     pc.printf(buf);
     
+    wait(1);
+    
+    pc.printf("\n---------- Get Connection Status ----------\r\n"); 
+    strcpy(snd, "AT+CIPSTATUS\r\n");
+    SendCMD();
+    timeout=2;
+    getreply(); 
+    pc.printf(buf);   
+    
     pc.printf("\n\n\n  If you get a valid IP, ESP8266 has been set up.\r\n");
     pc.printf("  Run this if you want to reconfig the ESP8266 at any time.\r\n");
 }