Setup and test the ESP8266 Wi Fi SOC from Sparkfun. Sets SSID and PASSWORD and prints status messages. For use on mbed LPC1768. Also reports IP and MAC address. See https://developer.mbed.org/users/4180_1/notebook/using-the-esp8266-with-the-mbed-lpc1768/

Dependencies:   mbed

Fork of ESP8266-configuaration-baudrate by Paul Staron

Revision:
3:14e33fec26c3
Parent:
2:c5515c7eba46
Child:
4:f40e7eb1ba1e
--- 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");
 }